Option Strict On Imports Microsoft.Win32 Imports System.Net Imports System.IO Imports System.Threading Imports MetroFramework.Forms Imports MetroFramework Imports MetroFramework.Components Imports System.Text Imports System.Runtime.InteropServices.ComTypes Imports System.Windows.Forms.VisualStyles.VisualStyleElement.Status Public Class Anime_Add Public Mass_DL_Cancel As Boolean = False Public List_DL_Cancel As Boolean = False Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox2.SelectedIndexChanged Try If ComboBox2.Text = SubFolder_Nothing Then SubFolder_Value = SubFolder_Nothing My.Settings.SubFolder_Value = SubFolder_Value ElseIf ComboBox2.Text = SubFolder_automatic Then SubFolder_Value = SubFolder_automatic My.Settings.SubFolder_Value = SubFolder_Value ElseIf ComboBox2.Text = SubFolder_automatic2 Then SubFolder_Value = SubFolder_automatic2 My.Settings.SubFolder_Value = SubFolder_Value Else SubFolder_Value = ComboBox2.Text My.Settings.SubFolder_Value = SubFolder_Value End If Catch ex As Exception ComboBox2.Text = SubFolder_Nothing End Try End Sub Dim Manager As MetroStyleManager = Main.Manager Private Sub Anime_Add_Load(sender As Object, e As EventArgs) Handles MyBase.Load SubTitlesOnlyCB.SelectedIndex = 0 Manager.Owner = Me Me.StyleManager = Manager Btn_Close.Image = Main.CloseImg Btn_min.Image = Main.MinImg Try Me.Icon = My.Resources.icon Catch ex As Exception End Try Try Main.waveOutSetVolume(0, 0) Catch ex As Exception End Try Me.Location = New Point(CInt(Main.Location.X + Main.Width / 2 - Me.Width / 2), CInt(Main.Location.Y + Main.Height / 2 - Me.Height / 2)) TextBox4.Text = Main.Pfad ' Dim SubFolder_Value As String Try SubFolder_Value = My.Settings.SubFolder_Value If SubFolder_Value = SubFolder_Nothing Then ComboBox2.Items.Add(SubFolder_automatic) ComboBox2.Items.Add(SubFolder_automatic2) ComboBox2.Items.Add(SubFolder_Nothing) ElseIf SubFolder_Value = SubFolder_automatic Then ComboBox2.Items.Add(SubFolder_automatic) ComboBox2.Items.Add(SubFolder_automatic2) ComboBox2.Items.Add(SubFolder_Nothing) ElseIf SubFolder_Value = SubFolder_automatic2 Then ComboBox2.Items.Add(SubFolder_automatic) ComboBox2.Items.Add(SubFolder_automatic2) ComboBox2.Items.Add(SubFolder_Nothing) Else ComboBox2.Items.Add(SubFolder_automatic) ComboBox2.Items.Add(SubFolder_automatic2) ComboBox2.Items.Add(SubFolder_Nothing) ComboBox2.Items.Add(SubFolder_Value) End If Catch ex As Exception ComboBox2.Items.Add(SubFolder_automatic) ComboBox2.Items.Add(SubFolder_automatic2) ComboBox2.Items.Add(SubFolder_Nothing) ComboBox2.SelectedItem = SubFolder_Nothing SubFolder_Value = SubFolder_Nothing End Try Try Dim di As New System.IO.DirectoryInfo(Main.Pfad) For Each fi As System.IO.DirectoryInfo In di.EnumerateDirectories("*.*", System.IO.SearchOption.TopDirectoryOnly) If fi.Attributes.HasFlag(System.IO.FileAttributes.Hidden) Then Else ComboBox2.Items.Add(fi.Name) End If Next Dim Result As New List(Of String) 'Jeder Eintrag in der Combobox durchgehen For Each item As String In ComboBox2.Items 'Wenn der Combobox-Eintrag noch nicht in der Result-List vorhanden ist, Eintrag der Result-List hinzufügen If Result.Contains(item) = False Then Result.Add(item) End If Next 'In der Result-List sind jetzt alle Einträge einmal vorhanden 'Combobox leeren ComboBox2.Items.Clear() 'Die Result-List der Combobox hinzufügen ComboBox2.Items.AddRange(Result.ToArray) ComboBox2.SelectedItem = SubFolder_Value Catch ex As Exception End Try 'Timer3.Enabled = True End Sub Private Sub Btn_dl_Click(sender As Object, e As EventArgs) Handles btn_dl.Click Main.LoginOnly = "Download Mode!" 'MsgBox(Main.WebbrowserURL) If SubTitlesOnlyCB.Text = "[Default]" Then Main.SubsOnly = False Else Main.SubsOnly = True End If If groupBox1.Visible = True Then ' Main.LoadedUrls.Clear() Try If CBool(InStr(textBox1.Text, "crunchyroll.com")) Or CBool(InStr(textBox1.Text, "funimation.com")) Then 'If StatusLabel.Text = "Status: waiting for episode selection" Then ' If MessageBox.Show("Are you sure you want cancel the advanced download?", "confirm?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then ' StatusLabel.Text = "Status: idle" ' Else ' Exit Sub ' btn_dl.Enabled = True ' End If ' 'ElseIf LabelUpdate = "Status: looking for video file" Then ' ' Exit Sub ' ' pictureBox4.Enabled = True 'Else If Main.RunningDownloads >= Main.MaxDL Then Debug.WriteLine("Max_Dl") 'ListBox1.Items.Add(textBox1.Text) Main.ListBoxList.Add(textBox1.Text) textBox1.ForeColor = Color.FromArgb(9248044) Pause(2) textBox1.ForeColor = Color.Black textBox1.Text = "URL" Else If CBool(InStr(textBox1.Text, "funimation.com")) Then Main.WebbrowserURL = textBox1.Text If CBool(InStr(textBox1.Text, "funimation.com/v/")) Then Dim Episode0() As String = textBox1.Text.Split(New String() {"?"}, System.StringSplitOptions.RemoveEmptyEntries) Dim Episode() As String = Episode0(0).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries) Dim v1JsonUrl As String = "https://d33et77evd9bgg.cloudfront.net/data/v1/episodes/" + Episode(Episode.Length - 1) + ".json" 'MsgBox(v1JsonUrl) Dim v1Json As String = Nothing Try Using client As New WebClient() client.Encoding = System.Text.Encoding.UTF8 client.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), "")) v1Json = client.DownloadString(v1JsonUrl) End Using Main.WebbrowserURL = textBox1.Text Main.GetFunimationNewJS_VideoProxy(Nothing, v1Json) Exit Sub Catch ex As Exception Debug.WriteLine("error- getting v1Json data for the bypass") Debug.WriteLine(ex.ToString) End Try End If End If If Main.Grapp_RDY = True Then Main.b = False Debug.WriteLine("what's going on?: " + Date.Now.ToString) StatusLabel.Text = "Status: loading ...." Main.LoadBrowser(textBox1.Text) Else Debug.WriteLine("Not Ready!") End If End If 'End If ElseIf CBool(InStr(textBox1.Text, "Test=true")) Then Main.LoadBrowser(textBox1.Text) Else MsgBox(Main.URL_Invaild, MsgBoxStyle.OkOnly) End If Catch ex As Exception MsgBox(ex.ToString) Main.b = True MsgBox(Main.URL_Invaild, MsgBoxStyle.OkOnly) End Try ElseIf groupBox2.Visible = True Then If Mass_DL_Cancel = True Then Mass_DL_Cancel = False groupBox2.Visible = False Main.Grapp_Abord = True Main.b = True groupBox1.Visible = True btn_dl.Text = "Download" btn_dl.BackgroundImage = My.Resources.main_button_download_default StatusLabel.Text = "Status: idle" ElseIf CBool(InStr(Main.WebbrowserURL, "funimation.com")) = True Then 'btn_dl.BackgroundImage = My.Resources.add_mass_running_cancel btn_dl.Text = "Cancel" Mass_DL_Cancel = True bt_Cancel_mass.Enabled = False bt_Cancel_mass.Visible = False Main.DownloadFunimationJS_Seasons() comboBox4.Enabled = False comboBox3.Enabled = False ComboBox1.Enabled = False ElseIf CBool(InStr(Main.WebbrowserURL, "crunchyroll.com")) = True Then StatusLabel.Text = "Status: idle" 'btn_dl.BackgroundImage = My.Resources.add_mass_running_cancel btn_dl.Text = "Cancel" Mass_DL_Cancel = True bt_Cancel_mass.Enabled = False bt_Cancel_mass.Visible = False Main.DownloadBetaSeasons() comboBox4.Enabled = False comboBox3.Enabled = False ComboBox1.Enabled = False End If End If btn_dl.Enabled = True End Sub Public Sub ProcessFunimationJS(ByVal InputURL As String) Dim FunUri As String = Nothing If CBool(InStr(InputURL, "?")) Then Dim ClearUri As String() = InputURL.Split(New String() {"?"}, System.StringSplitOptions.RemoveEmptyEntries) FunUri = ClearUri(0) Else FunUri = InputURL End If Dim ShowPath As String = Nothing Dim EpisodePath As String = Nothing Dim ShowPath1 As String() = FunUri.Split(New String() {"/shows/"}, System.StringSplitOptions.RemoveEmptyEntries) 'If CBool(InStr(ShowPath1(1), "/") Then Dim ShowPath2 As String() = ShowPath1(1).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries) If ShowPath2.Count > 1 Then ShowPath = ShowPath2(0).Replace("/", "") EpisodePath = ShowPath2(1).Replace("/", "") Else ShowPath = ShowPath1(1).Replace("/", "") End If Main.FunimationShowPath = ShowPath + "/" Debug.WriteLine(ShowPath) Debug.WriteLine(Main.FunimationAPIRegion) If EpisodePath = Nothing Then 'overview site Main.GetFunimationJS_Seasons("https://title-api.prd.funimationsvc.com/v2/shows/" + ShowPath + Main.FunimationAPIRegion) Else 'single episode End If Dim FunimationCC As String() = ShowPath1(0).Split(New String() {"funimation.com"}, System.StringSplitOptions.RemoveEmptyEntries) If FunimationCC.Count > 1 Then Main.FunimationRegion = FunimationCC(1).Replace("/", "") End If End Sub Private Sub Btn_dl_MouseEnter(sender As Object, e As EventArgs) Handles btn_dl.MouseEnter If Mass_DL_Cancel = True Then btn_dl.Text = "Cancel" btn_dl.BackgroundImage = My.Resources.main_button_download_hovert ElseIf List_DL_Cancel = True Then btn_dl.Text = "Cancel" btn_dl.BackgroundImage = My.Resources.main_button_download_hovert Else btn_dl.Text = "Download" btn_dl.BackgroundImage = My.Resources.main_button_download_hovert End If End Sub Private Sub Btn_dl_MouseLeave(sender As Object, e As EventArgs) Handles btn_dl.MouseLeave If Mass_DL_Cancel = True Then btn_dl.Text = "Cancel" btn_dl.BackgroundImage = My.Resources.main_button_download_hovert ElseIf List_DL_Cancel = True Then btn_dl.Text = "Cancel" btn_dl.BackgroundImage = My.Resources.main_button_download_hovert Else btn_dl.Text = "Download" btn_dl.BackgroundImage = My.Resources.main_button_download_default End If End Sub Private Sub TextBox1_Click(sender As Object, e As EventArgs) Handles textBox1.Click If textBox1.Text = "URL" Then textBox1.Text = Nothing End If End Sub Private Sub bt_Cancel_mass_Click(sender As Object, e As EventArgs) Handles bt_Cancel_mass.Click groupBox1.Visible = True groupBox2.Visible = False End Sub Private Sub bt_Cancel_mass_MouseEnter(sender As Object, e As EventArgs) Handles bt_Cancel_mass.MouseEnter bt_Cancel_mass.BackgroundImage = My.Resources.add_mass_cancel_hover End Sub Private Sub bt_Cancel_mass_MouseLeave(sender As Object, e As EventArgs) Handles bt_Cancel_mass.MouseLeave bt_Cancel_mass.BackgroundImage = My.Resources.add_mass_cancel End Sub Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged If CBool(InStr(Main.WebbrowserURL, "crunchyroll.com")) = True Then comboBox3.Items.Clear() comboBox4.Items.Clear() comboBox3.Enabled = False comboBox4.Enabled = False comboBox3.Text = Nothing comboBox4.Text = Nothing Dim SeasonSplit() As String = Main.CrBetaMass.Split(New String() {Chr(34) + "id" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) Dim SeasonSplit2() As String = SeasonSplit(ComboBox1.SelectedIndex + 1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) Dim EpisodeJsonURL As String = Main.CrBetaMassBaseURL + "episodes?season_id=" + SeasonSplit2(0) + "&locale=" + Main.CrBetaMassParameters 'Debug.WriteLine(EpisodeJsonURL) Dim EpisodeJson As String = Main.Curl(EpisodeJsonURL) 'localHTML.Replace("
", "").Replace("", "").Replace("", "").Replace("", "").Replace("