From 190964aa813173d435ca2d94b834ff785ffb0e79 Mon Sep 17 00:00:00 2001 From: hama3254 <52826614+hama3254@users.noreply.github.com> Date: Tue, 27 Dec 2022 17:04:25 +0100 Subject: [PATCH] improved caching improved caching --- .vs/Crunchyroll Downloader/v17/.suo | Bin 189952 -> 176128 bytes Crunchyroll Downloader/Anime_Add.Designer.vb | 2 +- Crunchyroll Downloader/Anime_Add.resx | 2 +- Crunchyroll Downloader/Anime_Add.vb | 78 ++++++++++-------- Crunchyroll Downloader/Browser.vb | 16 +++- Crunchyroll Downloader/Main.vb | 34 ++++++-- .../My Project/AssemblyInfo.vb | 4 +- 7 files changed, 90 insertions(+), 46 deletions(-) diff --git a/.vs/Crunchyroll Downloader/v17/.suo b/.vs/Crunchyroll Downloader/v17/.suo index 46e94ae6169f94d34ab3e804d7208af6908181b1..e5970195ce2915913fde6650454563837ebf0cc6 100644 GIT binary patch delta 6785 zcmd5=3s}_0wf~=C7nawGMAt387DPnLW8EMsYFve?^@#>est7Cs7mW(RMKM=lwf0^# zG}Rr;SaM?t7q?#PO>wtjjWH=vt7%LPF*HV_1f%v9Q#ER0(kT7S?jmcWiMHQ&Z|D1d zd(NDhIWuz}^Pe5to1wOjkj=)yO!1WnMOhA34czMN?3B^~AR8FQ&n_z2Q#zLHfy*>a zG1Ee#PEs8&XI1QN;-9ix;nAch*70(PqV(aU>Qkixw*cq`XaH#JO!d)tP&vi7LB|38 zfRVsLpa&2Ld=HoogabLi5THLW2N((%029y?Gxr3I111AL16>{ReS9?NyFNY>^pcOC2Rhfse*!udm=ELug+My+2p~6N0bK@2-N~Sf04<>R z$sUUJF|xyA@K5;a@A#+=G!0&zEIm49;a5Cb;GDy07JQ}>e zk7azwxR6%!`WXI`P7ZzX!+TrrXD#sNHl~{k}GNYakafTj>qZx2NOa^sgz2(ji75~wr=xrYoAQb zTJ(^ad%IWY7?>bQnm|$9oxK?`d$m3>2m%cd41@r3%U$Jj^o#PF=Ac#7x4tNZf$ zYLzY#{kz&E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HQ72ytrTr-|t zrSPCcJkLW$Q`@eI=*Nu-c!29h;W<(DaZjf4cG$;b>udbwElIcwVLz|Q#n%MM0T3r= zk3fMzrrVlphEr*8Fd(|X}B!PzQne}PMuOD7F29Jt4M9Std z*aFZX+OJ}xKiS1Jt3zrdP$}$M|8H6zNalNnV;uc^BGZ4#HRBwMbpbZBQGZ#^3%`I! zer`M}$qbt323EJwS2j$^=;bDQfJIF` zjZ~@)!jZf@2v_r>;rJ{MP9(mFfjXuOTFliAsHP1%oUhBpcVzuq^m4GyTYiRFV&F!8 zVG-&5|Dk#-*N#UohwuJSI%J}w3GaQSH*jqZF67m@_}1Ol>OEdnPuHi==kT-}Gllu` z%6htZQ}w!nu8v|O3O5d>%jrvF$X95m^5-IH`z8t&Mctnj%$~pxY{bMy6K%Nr?6ey$ zIKs?lQ!x;_$*VVEZ{QVXyutLdH2j5^a4|m?hx6H4n?EnxL{57T?R8jY|BB+-l@z^w z9>-ihOHX^O%#2^khR1NNlKT$B`FxfZL*%tpXz;YuQD_N{z-_!aL434KKs|^ybGWd} z-m%l33z1mL_3Kb6ml?6bgCC>uSlNNS9LJ+hz3zhNo8uxYOySR`o>?~d-3=?(SWnD5 zF~MhE-^05H^=H)w3oVuCEe33~paDA7-me;FtkS=%KLGbSY-0#biW#TV#^{Yk6Xm1c z1V2`$4q#WOPhm~dBiXhYQ<#2+p4Ds}CFJ5Sg%|&5JNA1JY7@D&8>nU4t!6M)>Hi6W Cejy|P diff --git a/Crunchyroll Downloader/Anime_Add.Designer.vb b/Crunchyroll Downloader/Anime_Add.Designer.vb index 7683d67..41f1747 100644 --- a/Crunchyroll Downloader/Anime_Add.Designer.vb +++ b/Crunchyroll Downloader/Anime_Add.Designer.vb @@ -393,9 +393,9 @@ Partial Class Anime_Add Me.Controls.Add(Me.btn_dl) Me.Controls.Add(Me.Btn_min) Me.Controls.Add(Me.Btn_Close) - Me.Controls.Add(Me.GroupBox3) Me.Controls.Add(Me.groupBox2) Me.Controls.Add(Me.groupBox1) + Me.Controls.Add(Me.GroupBox3) Me.Font = New System.Drawing.Font("Arial", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Name = "Anime_Add" Me.Padding = New System.Windows.Forms.Padding(10, 60, 20, 20) diff --git a/Crunchyroll Downloader/Anime_Add.resx b/Crunchyroll Downloader/Anime_Add.resx index fa7a95f..b82665d 100644 --- a/Crunchyroll Downloader/Anime_Add.resx +++ b/Crunchyroll Downloader/Anime_Add.resx @@ -127,7 +127,7 @@ iVBORw0KGgoAAAANSUhEUgAAABoAAAAhCAYAAADH97ugAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vQAADr0BR/uQrQAAAAd0SU1FB+QMDQ03N1b5UIAAAAApSURBVEhL7cyxCQAwDASx339pZ4EUcTC4keDa + vAAADrwBlbxySQAAAAd0SU1FB+QMDQ03N1b5UIAAAAApSURBVEhL7cyxCQAwDASx339pZ4EUcTC4keDa CwDMqs/abpOXAGBZcgDKSBvlblfsRgAAAABJRU5ErkJggg== diff --git a/Crunchyroll Downloader/Anime_Add.vb b/Crunchyroll Downloader/Anime_Add.vb index f9eed17..2c3c3c5 100644 --- a/Crunchyroll Downloader/Anime_Add.vb +++ b/Crunchyroll Downloader/Anime_Add.vb @@ -54,7 +54,7 @@ Public Class Anime_Add Next - Debug.WriteLine(Cookies) + 'Debug.WriteLine(Cookies) Return Cookies End Function @@ -153,7 +153,7 @@ Public Class Anime_Add End If - MsgBox(v1Token) + 'MsgBox(v1Token) If CBool(InStr(v1Token, "curl:")) = True And CBool(InStr(v1Token, "400")) = True Then Me.StatusLabel.Text = "Status: Failed - bad request, check CR login" @@ -174,6 +174,7 @@ Public Class Anime_Add End If + 'MsgBox(v1Token) If CBool(InStr(v1Token, "curl:")) = True Then Browser.WebView2.CoreWebView2.Navigate(Url) @@ -263,9 +264,8 @@ Public Class Anime_Add 'End If If CBool(InStr(ObjectJson, "curl:")) = True Then - MsgBox(ObjectJson) - 'Browser.WebView2.CoreWebView2.Navigate(ObjectsUrl) - ' Main.LoadingUrl = ObjectsUrl + Browser.WebView2.CoreWebView2.Navigate(ObjectsUrl) + Main.LoadingUrl = ObjectsUrl Exit Sub ElseIf CBool(InStr(ObjectJson, "videos/")) = False Then @@ -488,7 +488,7 @@ Public Class Anime_Add 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) + 'MsgBox(v1JsonUrl) Dim v1Json As String = Nothing Try Using client As New WebClient() @@ -696,44 +696,25 @@ Public Class Anime_Add Dim EpisodeJsonURL As String = Main.CrBetaMassBaseURL + "episodes?season_id=" + SeasonSplit2(0) + "&locale=" + Main.CrBetaMassParameters - Debug.WriteLine(EpisodeJsonURL) + 'Debug.WriteLine(EpisodeJsonURL) Dim EpisodeJson As String = Main.Curl(EpisodeJsonURL) 'localHTML.Replace("", "").Replace("", "").Replace("
", "").Replace("
", "").Replace("", "").Replace(My.Resources.htmlReplace, "") + If CBool(InStr(EpisodeJson, "curl:")) Then - Main.CrBetaMassEpisodes = EpisodeJson + Main.GetBetaSeasonSingle = True + Browser.WebView2.Source = New Uri(EpisodeJsonURL) + Exit Sub - Dim EpisodeNameSplit() As String = EpisodeJson.Split(New String() {Chr(34) + "title" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) - - - Dim EpisodeSplit() As String = EpisodeJson.Split(New String() {Chr(34) + "episode" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) - For i As Integer = 1 To EpisodeSplit.Count - 1 - Dim EpisodeSplit2() As String = EpisodeSplit(i).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) - Dim EpisodeNameSplit2() As String = EpisodeNameSplit(i).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) - If EpisodeSplit(i).Substring(0, 1) = Chr(34) Then - comboBox3.Items.Add(EpisodeNameSplit2(0)) - comboBox4.Items.Add(EpisodeNameSplit2(0)) - Else - comboBox3.Items.Add("Episode " + EpisodeSplit2(0)) - comboBox4.Items.Add("Episode " + EpisodeSplit2(0)) - End If - - Next - - If comboBox3.Items.Count > 0 Then - comboBox3.SelectedIndex = 0 - comboBox4.SelectedIndex = comboBox4.Items.Count - 1 End If - comboBox3.Enabled = True - comboBox4.Enabled = True + + FillCREpisodes(EpisodeJson) - - - ElseIf Main.WebbrowserURL = "https://funimation.com/js" Then - comboBox3.Items.Clear() + ElseIf Main.WebbrowserURL = "https://funimation.com/js" Then + comboBox3.Items.Clear() comboBox4.Items.Clear() comboBox3.Text = Nothing comboBox4.Text = Nothing @@ -785,7 +766,36 @@ Public Class Anime_Add End If End Sub + Public Sub FillCREpisodes(ByVal EpisodeJson As String) + 'MsgBox(True.ToString) + Main.CrBetaMassEpisodes = EpisodeJson + Dim EpisodeNameSplit() As String = EpisodeJson.Split(New String() {Chr(34) + "title" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) + + + Dim EpisodeSplit() As String = EpisodeJson.Split(New String() {Chr(34) + "episode" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) + For i As Integer = 1 To EpisodeSplit.Count - 1 + Dim EpisodeSplit2() As String = EpisodeSplit(i).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) + Dim EpisodeNameSplit2() As String = EpisodeNameSplit(i).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) + If EpisodeSplit(i).Substring(0, 1) = Chr(34) Then + comboBox3.Items.Add(EpisodeNameSplit2(0)) + comboBox4.Items.Add(EpisodeNameSplit2(0)) + Else + comboBox3.Items.Add("Episode " + EpisodeSplit2(0)) + comboBox4.Items.Add("Episode " + EpisodeSplit2(0)) + End If + + Next + + If comboBox3.Items.Count > 0 Then + comboBox3.SelectedIndex = 0 + comboBox4.SelectedIndex = comboBox4.Items.Count - 1 + End If + + comboBox3.Enabled = True + comboBox4.Enabled = True + + End Sub Public Sub FillFunimationEpisodes(ByVal EpisodeJson As String) diff --git a/Crunchyroll Downloader/Browser.vb b/Crunchyroll Downloader/Browser.vb index 9158c16..80a673d 100644 --- a/Crunchyroll Downloader/Browser.vb +++ b/Crunchyroll Downloader/Browser.vb @@ -202,9 +202,23 @@ Public Class Browser Dim reader As New StreamReader(Content) ContentString = reader.ReadToEnd Main.CR_SeasonJson = New UrlJson(e.Request.Uri, ContentString) + If Main.GetBetaSeasonsRetry = True Then + Main.GetBetaSeasonsRetry = False + Main.GetBetaSeasons(e.Request.Uri, ContentString) + End If + Exit Sub + + + ElseIf CBool(InStr(e.Request.Uri, "crunchyroll.com/")) And CBool(InStr(e.Request.Uri, "episodes?season_id=")) And Main.GetBetaSeasonSingle = True Then + Debug.WriteLine("Crunchyroll-Single-Season: " + e.Request.Uri) + Dim Content As Stream = Await e.Response.GetContentAsync + Dim ContentString As String = Nothing + Dim reader As New StreamReader(Content) + ContentString = reader.ReadToEnd + Main.GetBetaSeasonSingle = False + Anime_Add.FillCREpisodes(ContentString) Exit Sub End If - ElseIf CBool(InStr(Main.LoadingUrl, "funimation.com")) Then If CBool(InStr(e.Request.Uri, "?deviceType=web")) Then 'Debug.WriteLine(e.Request.Uri) diff --git a/Crunchyroll Downloader/Main.vb b/Crunchyroll Downloader/Main.vb index d7f92dc..5f56d70 100644 --- a/Crunchyroll Downloader/Main.vb +++ b/Crunchyroll Downloader/Main.vb @@ -33,6 +33,8 @@ Public Class Main Public CR_VideoJson As UrlJson = New UrlJson("", "") Public CR_AuthToken As String = "" + Public GetBetaSeasonsRetry As Boolean = False + Public GetBetaSeasonSingle As Boolean = False Public CrBetaMass As String = Nothing Public CrBetaMassEpisodes As String = Nothing Public CrBetaMassParameters As String = Nothing @@ -1127,7 +1129,7 @@ Public Class Main Anime_Add.btn_dl.Text = "Download" 'Anime_Add.btn_dl.BackgroundImage = My.Resources.main_button_download_default End Sub - Public Sub GetBetaSeasons(ByVal JsonUrl As String) ', ByVal SeasonJson As String) + Public Sub GetBetaSeasons(ByVal JsonUrl As String, Optional ByVal BrowserData As String = Nothing) ', ByVal SeasonJson As String) Anime_Add.groupBox2.Visible = True Anime_Add.bt_Cancel_mass.Enabled = True Anime_Add.bt_Cancel_mass.Visible = True @@ -1151,16 +1153,34 @@ Public Class Main 'Catch ex As Exception ' Debug.WriteLine("error- getting SeasonJson data") 'End Try - SeasonJson = Curl(JsonUrl) + If BrowserData = Nothing Then - If CBool(InStr(SeasonJson, "curl:")) = True Then SeasonJson = Curl(JsonUrl) + + If CBool(InStr(SeasonJson, "curl:")) = True Then + SeasonJson = Curl(JsonUrl) + End If + + If CBool(InStr(SeasonJson, "curl:")) = True And (CR_SeasonJson.Url = JsonUrl) = False Then + GetBetaSeasonsRetry = True + Browser.WebView2.Source = New Uri(JsonUrl) + Exit Sub + End If + + If CBool(InStr(SeasonJson, "curl:")) = True And CBool(InStr(CR_SeasonJson.Url, JsonUrl)) Then + Debug.WriteLine("curl error, using CR_SeasonJson ") + + SeasonJson = CR_SeasonJson.Content + CR_ObjectsJson = New UrlJson("", "") + ElseIf CBool(InStr(SeasonJson, "curl:")) = True Then + MsgBox("Error - Getting SeasonJson data" + vbNewLine + SeasonJson + vbNewLine + vbNewLine + JsonUrl) + Exit Sub + End If + Else + SeasonJson = BrowserData + Debug.WriteLine("BrowserData: " + BrowserData) End If - If CBool(InStr(SeasonJson, "curl:")) = True Then - MsgBox("Error - Getting SeasonJson data" + vbNewLine + SeasonJson + vbNewLine + vbNewLine + JsonUrl) - Exit Sub - End If SeasonJson = CleanJSON(SeasonJson) Dim ParameterSplit() As String = JsonUrl.Split(New String() {"&locale="}, System.StringSplitOptions.RemoveEmptyEntries) CrBetaMassParameters = ParameterSplit(1) diff --git a/Crunchyroll Downloader/My Project/AssemblyInfo.vb b/Crunchyroll Downloader/My Project/AssemblyInfo.vb index ff225b1..11b74ea 100644 --- a/Crunchyroll Downloader/My Project/AssemblyInfo.vb +++ b/Crunchyroll Downloader/My Project/AssemblyInfo.vb @@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + +