diff --git a/.vs/Crunchyroll Downloader/v15/.suo b/.vs/Crunchyroll Downloader/v15/.suo
index 15d1984..400c77a 100644
Binary files a/.vs/Crunchyroll Downloader/v15/.suo and b/.vs/Crunchyroll Downloader/v15/.suo differ
diff --git a/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide b/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide
index 73bd609..c9dc99e 100644
Binary files a/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide and b/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide differ
diff --git a/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide-shm b/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide-shm
index 389b135..8795cdd 100644
Binary files a/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide-shm and b/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide-shm differ
diff --git a/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide-wal b/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide-wal
index f3c4819..d1141d2 100644
Binary files a/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide-wal and b/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide-wal differ
diff --git a/Crunchyroll Downloader/Anime_Add.Designer.vb b/Crunchyroll Downloader/Anime_Add.Designer.vb
index d86481d..37f788d 100644
--- a/Crunchyroll Downloader/Anime_Add.Designer.vb
+++ b/Crunchyroll Downloader/Anime_Add.Designer.vb
@@ -34,7 +34,7 @@ Partial Class Anime_Add
Me.TextBox2 = New MetroFramework.Controls.MetroTextBox()
- Me.textBox2 = New MetroFramework.Controls.MetroTextBox()
+
Me.groupBox2 = New System.Windows.Forms.GroupBox()
Me.comboBox4 = New MetroFramework.Controls.MetroComboBox()
diff --git a/Crunchyroll Downloader/Anime_Add.vb b/Crunchyroll Downloader/Anime_Add.vb
index f88856d..743a1cf 100644
--- a/Crunchyroll Downloader/Anime_Add.vb
+++ b/Crunchyroll Downloader/Anime_Add.vb
@@ -883,10 +883,25 @@ Public Class Anime_Add
comboBox4.Items.Clear()
comboBox3.Text = Nothing
comboBox4.Text = Nothing
+ Dim ContentID As String = Nothing
+
+ For i As Integer = 0 To Main.FunimtaionSeasonList.Count - 1
+ If ComboBox1.Text = Main.FunimtaionSeasonList.Item(i).Title Then
+ ContentID = Main.FunimtaionSeasonList.Item(i).ID
+ Exit For
+ End If
+ Next
+
+ If ContentID = Nothing Then
+ MsgBox("error during season selection")
+ Exit Sub
+ End If
+
+ Dim BaseUrl() As String = Main.FunimationSeasonAPIUrl.Split(New String() {"/shows/"}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim EpisodeJsonURL As String = "https://title-api.prd.funimationsvc.com/v1/seasons/" + Main.FunimtaionAPISeasonID.Item(ComboBox1.SelectedIndex) + Main.FunimationAPIRegion
+ Dim EpisodeJsonURL As String = BaseUrl(0) + "/seasons/" + ContentID + ".json"
Dim EpisodeJson As String = Nothing
Debug.WriteLine(EpisodeJsonURL)
@@ -904,9 +919,28 @@ Public Class Anime_Add
Exit Sub
End Try
-
-
FillFunimationEpisodes(EpisodeJson)
+ 'Dim EpisodeJsonURL As String = "https://title-api.prd.funimationsvc.com/v1/seasons/" + Main.FunimtaionAPISeasonID.Item(ComboBox1.SelectedIndex) + Main.FunimationAPIRegion
+ 'Dim EpisodeJson As String = Nothing
+ 'Debug.WriteLine(EpisodeJsonURL)
+
+ 'Try
+ ' Using client As New WebClient()
+ ' client.Encoding = System.Text.Encoding.UTF8
+ ' client.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), ""))
+ ' EpisodeJson = client.DownloadString(EpisodeJsonURL)
+ ' End Using
+ 'Catch ex As Exception
+ ' Debug.WriteLine("error- getting EpisodeJson data")
+ ' Debug.WriteLine(ex.ToString)
+ ' Main.FunimationJsonBrowser = "EpisodeJson"
+ ' CefSharp_Browser.WebBrowser1.Load(EpisodeJsonURL)
+ ' Exit Sub
+ 'End Try
+
+
+
+ 'FillFunimationEpisodes(EpisodeJson)
ElseIf AoD_Mode = False Then
@@ -972,18 +1006,18 @@ Public Class Anime_Add
Public Sub FillFunimationEpisodes(ByVal EpisodeJson As String)
Main.FunimationEpisodeJSON = EpisodeJson
-
-
comboBox3.Enabled = True
comboBox4.Enabled = True
- Dim EpisodeSplit() As String = EpisodeJson.Split(New String() {Chr(34) + "episodeNumber" + Chr(34) + ": " + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
+ Dim EpisodeSplit() As String = EpisodeJson.Split(New String() {Chr(34) + "episodeNumber" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
+ 'EpisodeJson.Split(New String() {Chr(34) + "episodeNumber" + Chr(34) + ": " + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
+ Debug.WriteLine(EpisodeSplit.Count.ToString)
For i As Integer = 1 To EpisodeSplit.Count - 1
Dim EpisodeSplit2() As String = EpisodeSplit(i).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
comboBox3.Items.Add("Episode " + EpisodeSplit2(0))
comboBox4.Items.Add("Episode " + EpisodeSplit2(0))
Next
-
+ Main.WebbrowserURL = "https://funimation.com/js"
End Sub
Private Sub PictureBox1_MouseEnter(sender As Object, e As EventArgs) Handles PictureBox1.MouseEnter
PictureBox1.Image = My.Resources.add_mass_cancel_hover
diff --git a/Crunchyroll Downloader/CefSharp_Browser.vb b/Crunchyroll Downloader/CefSharp_Browser.vb
index 88ae654..a009f76 100644
--- a/Crunchyroll Downloader/CefSharp_Browser.vb
+++ b/Crunchyroll Downloader/CefSharp_Browser.vb
@@ -240,49 +240,72 @@ Public Class CefSharp_Browser
Private Sub ObserveHttp(e As RequestResourceEventArgs) 'Handles RequestResource.GetUrl
'Debug.WriteLine(e.RequestUrl)
- If CBool(InStr(e.RequestUrl, "https://beta-api.crunchyroll.com/")) And CBool(InStr(e.RequestUrl, "streams?")) Then
+ If (Me.InvokeRequired) Then
+ If Main.b = True And Main.FunimationJsonBrowser = Nothing Then
+ Exit Sub
+ End If
+ Else
+ If Main.b = True And Main.FunimationJsonBrowser = Nothing Then
+ Exit Sub
+ End If
+ End If
+
+ If CBool(InStr(e.RequestUrl, "https://title-api.prd.funimationsvc.com")) Then
If (Me.InvokeRequired) Then
Me.Invoke(Sub() Main.LoadedUrls.Add(e.RequestUrl))
+ Exit Sub
Else
Main.LoadedUrls.Add(e.RequestUrl)
+ Exit Sub
+ End If
+ Debug.WriteLine(e.RequestUrl)
+ ElseIf CBool(InStr(e.RequestUrl, "/data/v2/shows/")) Then
+ If (Me.InvokeRequired) Then
+ Me.Invoke(Sub() Main.LoadedUrls.Add(e.RequestUrl))
+ Exit Sub
+ Else
+ Main.LoadedUrls.Add(e.RequestUrl)
+ Exit Sub
+ End If
+ Debug.WriteLine(e.RequestUrl)
+ ElseIf CBool(InStr(e.RequestUrl, "https://beta-api.crunchyroll.com/")) And CBool(InStr(e.RequestUrl, "streams?")) Then
+ If (Me.InvokeRequired) Then
+ Me.Invoke(Sub() Main.LoadedUrls.Add(e.RequestUrl))
+ Exit Sub
+ Else
+ Main.LoadedUrls.Add(e.RequestUrl)
+ Exit Sub
End If
Debug.WriteLine(e.RequestUrl)
ElseIf CBool(InStr(e.RequestUrl, "https://beta-api.crunchyroll.com/")) And CBool(InStr(e.RequestUrl, "seasons?series_id=")) Then
If (Me.InvokeRequired) Then
Me.Invoke(Sub() Main.LoadedUrls.Add(e.RequestUrl))
+ Exit Sub
Else
Main.LoadedUrls.Add(e.RequestUrl)
+ Exit Sub
End If
Debug.WriteLine(e.RequestUrl)
ElseIf CBool(InStr(e.requesturl, "https://api.vrv.co")) And CBool(InStr(e.requesturl, "streams?")) Then
If (Me.InvokeRequired) Then
Me.Invoke(Sub() Main.LoadedUrls.Add(e.RequestUrl))
+ Exit Sub
Else
Main.LoadedUrls.Add(e.RequestUrl)
+ Exit Sub
End If
Debug.WriteLine(e.RequestUrl)
ElseIf CBool(InStr(e.requesturl, "https://api.vrv.co")) And CBool(InStr(e.requesturl, "seasons?series_id=")) Then
If (Me.InvokeRequired) Then
Me.Invoke(Sub() Main.LoadedUrls.Add(e.RequestUrl))
+ Exit Sub
Else
Main.LoadedUrls.Add(e.RequestUrl)
+ Exit Sub
End If
Debug.WriteLine(e.RequestUrl)
- ElseIf CBool(InStr(e.RequestUrl, "https://title-api.prd.funimationsvc.com")) Then
- If (Me.InvokeRequired) Then
- Me.Invoke(Sub() Main.LoadedUrls.Add(e.RequestUrl))
- Else
- Main.LoadedUrls.Add(e.RequestUrl)
+
End If
- Debug.WriteLine(e.RequestUrl)
- ElseIf CBool(InStr(e.RequestUrl, "/data/v1/shows/")) Then
- If (Me.InvokeRequired) Then
- Me.Invoke(Sub() Main.LoadedUrls.Add(e.RequestUrl))
- Else
- Main.LoadedUrls.Add(e.RequestUrl)
- End If
- Debug.WriteLine(e.RequestUrl)
- End If
Exit Sub
diff --git a/Crunchyroll Downloader/Main.designer.vb b/Crunchyroll Downloader/Main.designer.vb
index 4946563..fe5bdb6 100644
--- a/Crunchyroll Downloader/Main.designer.vb
+++ b/Crunchyroll Downloader/Main.designer.vb
@@ -45,6 +45,7 @@ Partial Class Main
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.ToggleDebugModeToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.OpenSettingsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
+ Me.TestDownloadToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
CType(Me.PictureBox5, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox6, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.MetroStyleManager1, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -178,7 +179,7 @@ Partial Class Main
'
'ContextMenuStrip1
'
- Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToggleDebugModeToolStripMenuItem, Me.OpenSettingsToolStripMenuItem})
+ Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToggleDebugModeToolStripMenuItem, Me.OpenSettingsToolStripMenuItem, Me.TestDownloadToolStripMenuItem})
Me.ContextMenuStrip1.Name = "ContextMenuStrip1"
resources.ApplyResources(Me.ContextMenuStrip1, "ContextMenuStrip1")
'
@@ -192,6 +193,11 @@ Partial Class Main
Me.OpenSettingsToolStripMenuItem.Name = "OpenSettingsToolStripMenuItem"
resources.ApplyResources(Me.OpenSettingsToolStripMenuItem, "OpenSettingsToolStripMenuItem")
'
+ 'TestDownloadToolStripMenuItem
+ '
+ Me.TestDownloadToolStripMenuItem.Name = "TestDownloadToolStripMenuItem"
+ resources.ApplyResources(Me.TestDownloadToolStripMenuItem, "TestDownloadToolStripMenuItem")
+ '
'Main
'
Me.ApplyImageInvert = True
@@ -242,4 +248,5 @@ Partial Class Main
Friend WithEvents ContextMenuStrip1 As ContextMenuStrip
Friend WithEvents ToggleDebugModeToolStripMenuItem As ToolStripMenuItem
Friend WithEvents OpenSettingsToolStripMenuItem As ToolStripMenuItem
+ Friend WithEvents TestDownloadToolStripMenuItem As ToolStripMenuItem
End Class
diff --git a/Crunchyroll Downloader/Main.resx b/Crunchyroll Downloader/Main.resx
index 35fafbd..8198e11 100644
--- a/Crunchyroll Downloader/Main.resx
+++ b/Crunchyroll Downloader/Main.resx
@@ -498,6 +498,12 @@
System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ TestDownloadToolStripMenuItem
+
+
+ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
Main
@@ -525,8 +531,14 @@
Open Settings
+
+ 181, 22
+
+
+ Check Urls
+
- 182, 48
+ 182, 92
ContextMenuStrip1
diff --git a/Crunchyroll Downloader/Main.vb b/Crunchyroll Downloader/Main.vb
index 2108a5d..7520a5e 100644
--- a/Crunchyroll Downloader/Main.vb
+++ b/Crunchyroll Downloader/Main.vb
@@ -42,6 +42,8 @@ Public Class Main
Public FunimationShowPath As String = Nothing
Public FunimationEpisodeJSON As String = Nothing
Public FunimtaionAPISeasonID As New List(Of String)
+ Public FunimtaionSeasonList As New List(Of FunimationOverview)
+ Public FunimationSeasonAPIUrl As String = Nothing
Public FunimationJsonBrowser As String = Nothing
Public Manager As New MetroStyleManager
@@ -375,11 +377,12 @@ Public Class Main
Private Sub Form8_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.ContextMenuStrip = ContextMenuStrip1
-
Dim tbtl As TextBoxTraceListener = New TextBoxTraceListener(TheTextBox)
Trace.Listeners.Add(tbtl)
b = True
+ Thread.CurrentThread.Name = "Main"
+ Debug.WriteLine("Thread Name: " + Thread.CurrentThread.Name)
Try
Dim rkg As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\CRDownloader")
@@ -2148,17 +2151,7 @@ Public Class Main
End If
End If
- If KodiNaming = True Then
- Dim KodiString As String = "[S"
- If CR_Anime_Staffel_int = "0" Then
- CR_Anime_Staffel_int = "01"
- Else
- CR_Anime_Staffel_int = "0" + CR_Anime_Staffel_int
- End If
- KodiString = KodiString + CR_Anime_Staffel_int + " E" + CR_episode_int
- KodiString = KodiString + "] "
- CR_FilenName = KodiString + CR_FilenName
- End If
+
If KodiNaming = True Then
@@ -4476,10 +4469,103 @@ Public Class Main
End Sub
#Region "Funimation JS "
-
-
Public Sub GetFunimationJS_Seasons(Optional ByVal JsonUrl As String = Nothing, Optional ByVal Json As String = Nothing)
+ Dim SeasonJson As String = Nothing
+ Debug.WriteLine("JsonUrl: " + JsonUrl)
+ If JsonUrl = Nothing Then
+ SeasonJson = Json
+ Else
+ FunimationSeasonAPIUrl = JsonUrl
+ 'Navigate(JsonUrl)
+ 'FunimationJsonBrowser = "SeasonJson"
+ 'Exit Sub
+
+ Try
+ Using client As New WebClient()
+ client.Encoding = System.Text.Encoding.UTF8
+ client.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), ""))
+ SeasonJson = client.DownloadString(JsonUrl)
+
+
+ End Using
+ Catch ex As Exception
+ Debug.WriteLine("error- getting funimation SeasonJson data")
+ FunimationJsonBrowser = "SeasonJson"
+ Navigate(JsonUrl)
+ 'Navigate(JsonUrl)
+ Exit Sub
+ End Try
+ End If
+
+
+
+ Dim ser As JObject = JObject.Parse(SeasonJson)
+ Dim data As List(Of JToken) = ser.Children().ToList
+ Dim Slug As String = Nothing
+ Dim Title As String = Nothing
+ Dim ID As String = Nothing
+
+ For Each item As JProperty In data
+ item.CreateReader()
+ 'MsgBox(item.Name)
+ Select Case item.Name
+ Case "slug"
+ Slug = item.Value.ToString
+
+ Case "index" 'each record is inside the entries array
+
+ Dim SubData2 As List(Of JToken) = item.Values("seasons").Children().ToList
+
+ For i As Integer = 0 To SubData2.Count - 1
+ Dim SubItem As JToken = SubData2.Item(i)
+ Dim SeasonSubData As List(Of JToken) = SubItem.Children().ToList
+
+ For Each SeasonSubItem As JProperty In SeasonSubData
+ SeasonSubItem.CreateReader()
+ Select Case SeasonSubItem.Name
+ Case "contentId"
+ 'MsgBox(SeasonSubItem.Value.ToString)
+ ID = SeasonSubItem.Value.ToString
+ Case "title"
+ ' MsgBox(SeasonSubItem.Value.Item("en").ToString)
+ Title = SeasonSubItem.Value.Item("en").ToString
+ FunimtaionSeasonList.Add(New FunimationOverview(Slug, ID, Title))
+ End Select
+ Next
+ Next
+ End Select
+
+
+
+ Next
+
+
+ Anime_Add.groupBox2.Visible = True
+ Anime_Add.PictureBox1.Enabled = True
+ Anime_Add.PictureBox1.Visible = True
+ Anime_Add.groupBox1.Visible = False
+ Anime_Add.ComboBox1.Items.Clear()
+ Anime_Add.comboBox3.Items.Clear()
+ Anime_Add.comboBox4.Items.Clear()
+ Anime_Add.ComboBox1.Text = Nothing
+ Anime_Add.comboBox3.Text = Nothing
+ Anime_Add.comboBox4.Text = Nothing
+ Anime_Add.ComboBox1.Enabled = True
+ Anime_Add.comboBox3.Enabled = False
+ Anime_Add.comboBox4.Enabled = False
+ WebbrowserURL = "https://funimation.com/js"
+
+ Debug.WriteLine("Count: " + FunimtaionSeasonList.Count.ToString)
+ For i As Integer = 1 To FunimtaionSeasonList.Count - 1
+ Debug.WriteLine(FunimtaionSeasonList.Item(i).Title)
+ Anime_Add.ComboBox1.Items.Add(FunimtaionSeasonList.Item(i).Title)
+ Next
+
+ End Sub
+
+ Public Sub GetFunimationJS_SeasonsOld(Optional ByVal JsonUrl As String = Nothing, Optional ByVal Json As String = Nothing)
+
FunimtaionAPISeasonID.Clear()
@@ -4565,14 +4651,14 @@ Public Class Main
Debug.WriteLine("EpisodeJson: " + FunimationEpisodeJSON)
Anime_Add.Add_Display.Text = "preparing ...."
Dim ListOfEpisodes As New List(Of String)
- Dim BaseURL As String = "https://www.funimation.com/shows/"
- If FunimationRegion IsNot Nothing Then
+ Dim BaseURL As String = "https://www.funimation.com/v/" + FunimtaionSeasonList.Item(0).Slug + "/"
+ 'If FunimationRegion IsNot Nothing Then
- BaseURL = "https://www.funimation.com/" + FunimationRegion + "/shows/"
- Else
+ ' BaseURL = "https://www.funimation.com/" + FunimationRegion + "/shows/"
+ 'Else
- BaseURL = "https://www.funimation.com/en/shows/"
- End If
+ ' BaseURL = "https://www.funimation.com/en/shows/"
+ 'End If
'Dim EpisodeSplit() As String = FunimationEpisodeJSON.Split(New String() {Chr(34) + "slug" + Chr(34) + ": " + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
@@ -4595,8 +4681,12 @@ Public Class Main
For Each Entry As JObject In item.Values
Dim slug As String = Entry("slug").ToString
- Debug.WriteLine(BaseURL + FunimationShowPath + slug)
- ListOfEpisodes.Add(BaseURL + FunimationShowPath + slug) '+ FunimationAPIRegion)
+ 'Debug.WriteLine(BaseURL + FunimationShowPath + slug)
+ 'ListOfEpisodes.Add(BaseURL + FunimationShowPath + slug) '+ FunimationAPIRegion)
+
+ Debug.WriteLine(BaseURL + slug)
+ ListOfEpisodes.Add(BaseURL + slug)
+
Next
@@ -4707,6 +4797,7 @@ Public Class Main
End If
End Function
Public Sub GetFunimationJS_VideoProxy(Optional ByVal v1JsonURL As String = Nothing, Optional ByVal v1JsonData As String = Nothing)
+ LoadedUrls.Clear()
Dim Evaluator = New Thread(Sub() Me.GetFunimationJS_Video(v1JsonURL, v1JsonData))
Evaluator.Start()
End Sub
@@ -4718,6 +4809,7 @@ Public Class Main
v1Json = v1JsonData
Else
Try
+ 'Throw New Exception("TEst")
Using client As New WebClient()
client.Encoding = System.Text.Encoding.UTF8
client.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), ""))
@@ -5673,13 +5765,41 @@ Public Class Main
#Region "process html"
Public Sub ProcessHTML(ByVal document As String, ByVal Address As String, ByVal DocumentTitle As String)
- If b = True Then
- Exit Sub
- End If
Dim localHTML As String = document
Debug.WriteLine(Date.Now.ToString + "." + Date.Now.Millisecond.ToString)
Debug.WriteLine(Address)
+ If CBool(InStr(Address, "title-api.prd.funimationsvc.com")) Then
+
+ If FunimationJsonBrowser = "EpisodeJson" Then
+ Anime_Add.FillFunimationEpisodes(localHTML.Replace("", "").Replace("", "").Replace("", "").Replace("
", "").Replace("