From e76ad3b416a07d9c4bdaa45b64370d28504c0d41 Mon Sep 17 00:00:00 2001 From: hama3254 <52826614+hama3254@users.noreply.github.com> Date: Mon, 5 Dec 2022 18:16:07 +0100 Subject: [PATCH] fallback CR 403 added fallback CR 403 added --- .vs/Crunchyroll Downloader/v17/.suo | Bin 168448 -> 187392 bytes Crunchyroll Downloader/Browser.vb | 129 ++++++-- Crunchyroll Downloader/Main.designer.vb | 12 +- Crunchyroll Downloader/Main.resx | 300 +++++++----------- Crunchyroll Downloader/Main.vb | 53 +++- .../My Project/AssemblyInfo.vb | 4 +- 6 files changed, 271 insertions(+), 227 deletions(-) diff --git a/.vs/Crunchyroll Downloader/v17/.suo b/.vs/Crunchyroll Downloader/v17/.suo index 862e801e294708bf7f19dc259a26bee6fda089b0..de4f8d3dc61a7ec9cee00093edc249a25d4dfa98 100644 GIT binary patch delta 20239 zcmeHP34B!5)qm$@vWJj_03n1hgct)PFj+`KM44hq0Z4rnvsHg*2aiJ)-^;0Vr&|lpxC@4{c?|9K`M6Fs&3F5SBp|zsM>jpytO64o{6e~=s!D7NN)jSNYfq-u?y7S_h z{7{w%;IeQ>8j3W{k>@r&ksk!O8jt}<2XOnYjx-i&7eEYP8Q@AlA3&s{Ojia20V8gb z0VT+nB8>xF3z!8M42S~s2JoOMNM{3j0Stgl0H~vpB^7B7AP+DDP$~}lb+d3UCR`Ta zIzSm_;bmqc&vi*i2LQ$a`T_a_&H#P_cmpsRa00+>omW7+`$;bMQylp(^mO$3B20LN zqmU;qME)wk5Jy?DBMnCSGe8M|xilRx7w~fcPy8x4J%n=czrW7xern&~6aRSN(zxwh zN_(y|xBUUkZRRdt%x#v0&bZAI!Q74qaQjQ*Hg|O8Hgn&V+g#tC+g!%n9tP04%|s0X zWC6IAxy>nan`OfcaL4V*DCc(0Yb@@WSu6qF0Qmrxf*SzbW+GAthcyOs8JIk}Wf131 za&ns+@a2x%z8LI6+zv1rx~YmHVguqW;mC9c^Z@h(Fi#?p_5<_=L;?B$q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cXl0yH4+&v9E2&Gr43Q+6bM@$gt=I!V~fWude%_h_Df`j!(LHV>6mM;NTb@a zl`B`|=UZ$;b8>T1vjz{zNVVh)$xqG9NY6_Z?7T6y+?+A#>CYVv7^LWd<(?@Tz8QLTxuy~5kE4Lz^PdoRkAS(G@sqJ8iIw3eI@a$yZIbc* za?H6|^s~-v$$GA5?j+mn!UYx1*<+pdMQOIcwy-9|b79Us7q+EdU|Iy9K&g#5#=1Fw z4!4q)SYb1CtRWN)jP;Nn8pb|jT)WqVrU+J|8$yrGZN=a-2A;LIMld@n!`L_X7$ni4 zV!+-9X^YSL3uNLmv5e!FQEYeHP8Lli>KIFr2E?%`O5LgUSrjoo@w><>)%0Y42Fjll z2~%%-9@wB~QBj6}$y@APTIrZKb9P!9f5zRf(-7>J$gZO9G@FCJOk_sfqGz9Uo(5@} zq4#{jbD@=4@a06d1iQsERp(j6 zVk!Wv5|psYP;_LowWy1wTRrQxI5+n}7CQ(B7e#W5>JC$Z>n z(FE-alpOO}Vz}fgU@is?_43a-t|G$db|6Aq)^u5C<1dcMRWIe*@UD>^RG`bEmS8WR! z*ww;(s68XDPRFR}qyKnQV>Yh(fMrEE%4g&{Di_b4e_33bLMrUOPH$KPkFZE?+dZ1k iS!BY7d=@RaPBSY*r3SR1#1qF@=SS?@9+1BqI{ppeTkE+1 diff --git a/Crunchyroll Downloader/Browser.vb b/Crunchyroll Downloader/Browser.vb index 063647d..1e8d800 100644 --- a/Crunchyroll Downloader/Browser.vb +++ b/Crunchyroll Downloader/Browser.vb @@ -19,7 +19,10 @@ Public Class Browser Private Sub WebView2_CoreWebView2InitializationCompleted(sender As Object, e As CoreWebView2InitializationCompletedEventArgs) Handles WebView2.CoreWebView2InitializationCompleted WebView2.CoreWebView2.AddWebResourceRequestedFilter("https://www.crunchyroll.com/*", CoreWebView2WebResourceContext.All) WebView2.CoreWebView2.AddWebResourceRequestedFilter("https://www.funimation.com/*", CoreWebView2WebResourceContext.All) + WebView2.CoreWebView2.AddWebResourceRequestedFilter("https://www.crunchyroll.com/*", CoreWebView2WebResourceContext.All) + 'WebView2.CoreWebView2.AddWebResourceRequestedFilter("*", CoreWebView2WebResourceContext.All) + AddHandler WebView2.CoreWebView2.WebResourceResponseReceived, AddressOf ObserveResponse AddHandler WebView2.CoreWebView2.WebResourceRequested, AddressOf ObserveHttp WebView2.CoreWebView2.Settings.UserAgent = My.Resources.ffmpeg_user_agend.Replace(Chr(34), "").Replace("User-Agent: ", "") @@ -69,7 +72,7 @@ Public Class Browser End Sub - Private Sub GeckoFX_Load(sender As Object, e As EventArgs) Handles Me.Load + Private Sub Browser_Load(sender As Object, e As EventArgs) Handles Me.Load Main.waveOutSetVolume(0, 0) If Me.Width > My.Computer.Screen.Bounds.Width Then Me.Width = My.Computer.Screen.Bounds.Width @@ -141,6 +144,90 @@ Public Class Browser End Sub + Private Async Sub ObserveResponse(ByVal sender As Object, ByVal e As CoreWebView2WebResourceResponseReceivedEventArgs) + + + + + If CBool(InStr(Main.LoadingUrl, "crunchyroll.com")) Then + + + + + If CBool(InStr(e.Request.Uri, "crunchyroll.com/")) And CBool(InStr(e.Request.Uri, "streams?")) Then + Debug.WriteLine("Crunchyroll-Single: " + 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.LoadedUrls.Add(e.Request.Uri) + Main.CR_VideoJson = New UrlJson(e.Request.Uri, ContentString) + + Exit Sub + ElseIf CBool(InStr(e.Request.Uri, "crunchyroll.com/")) And CBool(InStr(e.Request.Uri, "/objects/")) And CBool(InStr(Main.LoadingUrl, "/watch/")) Then + Debug.WriteLine(e.Request.Uri) + Main.LoadedUrls.Add(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.CR_ObjectsJson = New UrlJson(e.Request.Uri, ContentString) + Exit Sub + ElseIf CBool(InStr(e.Request.Uri, "crunchyroll.com/")) And CBool(InStr(e.Request.Uri, "seasons?series_id=")) And CBool(InStr(Main.LoadingUrl, "/series/")) Then + Debug.WriteLine("Crunchyroll-Season: " + e.Request.Uri) + Main.LoadedUrls.Add(e.Request.Uri) + Main.LoadedUrls.Add(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.CR_SeasonJson = New UrlJson(e.Request.Uri, 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) + Dim parms As String() = e.Request.Uri.Split(New String() {"?deviceType="}, System.StringSplitOptions.RemoveEmptyEntries) + Main.FunimationDeviceRegion = "?deviceType=" + parms(1) + + End If + If CBool(InStr(e.Request.Uri, "https://title-api.prd.funimationsvc.com")) Then + Debug.WriteLine("Funimtaion: " + e.Request.Uri) + If (Me.InvokeRequired) Then + Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Uri)) + Exit Sub + Else + Main.LoadedUrls.Add(e.Request.Uri) + Exit Sub + End If + ElseIf CBool(InStr(e.Request.Uri, "/data/v2/shows/")) Then + Debug.WriteLine("Funimtaion: " + e.Request.Uri) + If (Me.InvokeRequired) Then + Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Uri)) + Exit Sub + Else + Main.LoadedUrls.Add(e.Request.Uri) + Exit Sub + End If + ElseIf CBool(InStr(e.Request.Uri, "/data/v1/episodes/")) Then + Debug.WriteLine("Funimtaion: " + e.Request.Uri) + If (Me.InvokeRequired) Then + Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Uri)) + Exit Sub + Else + Main.LoadedUrls.Add(e.Request.Uri) + Exit Sub + End If + End If + + + + End If + + End Sub + @@ -149,6 +236,7 @@ Public Class Browser Private Sub ObserveHttp(ByVal sender As Object, ByVal e As CoreWebView2WebResourceRequestedEventArgs) 'Handles RequestResource.GetUrl + If CBool(InStr(e.Request.Uri, "crunchyroll.com")) = True And Main.CrBetaBasic = Nothing Then Dim Headers As New List(Of KeyValuePair(Of String, String)) Headers.AddRange(e.Request.Headers.ToList) @@ -160,36 +248,31 @@ Public Class Browser Next End If - + Exit Sub If CBool(InStr(Main.LoadingUrl, "crunchyroll.com")) Then + If CBool(InStr(e.Request.Uri, "crunchyroll.com/")) And CBool(InStr(e.Request.Uri, "streams?")) Then Debug.WriteLine("Crunchyroll-Single: " + e.Request.Uri) - If (Me.InvokeRequired) Then - Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Uri)) - Exit Sub - Else - Main.LoadedUrls.Add(e.Request.Uri) - Exit Sub - End If + 'Dim ContentString As String = Nothing + 'Dim Content As New MemoryStream + 'e.Response.Content.CopyTo(Content) + 'Content.Position = 0 + 'ContentString = Encoding.UTF8.GetString(Content.ToArray()) + 'MsgBox(ContentString) + Main.LoadedUrls.Add(e.Request.Uri) + 'Main.CR_VideoJson = New UrlJson(e.Request.Uri, e.Request.Content.ToString) + Exit Sub ElseIf CBool(InStr(e.Request.Uri, "crunchyroll.com/")) And CBool(InStr(e.Request.Uri, "/objects/")) And CBool(InStr(e.Request.Uri, "/watch/")) Then - If (Me.InvokeRequired) Then - Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Uri)) - Exit Sub - Else - Main.LoadedUrls.Add(e.Request.Uri) - Exit Sub - End If Debug.WriteLine(e.Request.Uri) + Main.LoadedUrls.Add(e.Request.Uri) + 'Main.CR_ObjectsJson = New UrlJson(e.Request.Uri, e.Request.Content.ToString) + Exit Sub ElseIf CBool(InStr(e.Request.Uri, "crunchyroll.com/")) And CBool(InStr(e.Request.Uri, "seasons?series_id=")) Then Debug.WriteLine("Crunchyroll-Season: " + e.Request.Uri) - If (Me.InvokeRequired) Then - Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Uri)) - Exit Sub - Else - Main.LoadedUrls.Add(e.Request.Uri) - Exit Sub - End If + Main.LoadedUrls.Add(e.Request.Uri) + 'Main.CR_SeasonJson = New UrlJson(e.Request.Uri, e.Request.Content.ToString) + Exit Sub End If diff --git a/Crunchyroll Downloader/Main.designer.vb b/Crunchyroll Downloader/Main.designer.vb index 1c2e40f..82afaee 100644 --- a/Crunchyroll Downloader/Main.designer.vb +++ b/Crunchyroll Downloader/Main.designer.vb @@ -48,7 +48,7 @@ Partial Class Main Me.ThreadCount = New System.Windows.Forms.ToolStripMenuItem() Me.MsgBoxToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.CRCookieToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() - Me.ClearAllSettingsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.UrlJsonsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.ItemBoundsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.DummyItemToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.Panel1 = New System.Windows.Forms.Panel() @@ -161,7 +161,7 @@ Partial Class Main ' 'ContextMenuStrip1 ' - Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToggleDebugModeToolStripMenuItem, Me.OpenSettingsToolStripMenuItem, Me.Funimation_Token, Me.CheckCRBetaTokenToolStripMenuItem, Me.AddonHTMLToolStripMenuItem, Me.Timer3OffToolStripMenuItem, Me.ThreadCount, Me.MsgBoxToolStripMenuItem, Me.CRCookieToolStripMenuItem, Me.ClearAllSettingsToolStripMenuItem, Me.ItemBoundsToolStripMenuItem, Me.DummyItemToolStripMenuItem}) + Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToggleDebugModeToolStripMenuItem, Me.OpenSettingsToolStripMenuItem, Me.Funimation_Token, Me.CheckCRBetaTokenToolStripMenuItem, Me.AddonHTMLToolStripMenuItem, Me.Timer3OffToolStripMenuItem, Me.ThreadCount, Me.MsgBoxToolStripMenuItem, Me.CRCookieToolStripMenuItem, Me.UrlJsonsToolStripMenuItem, Me.ItemBoundsToolStripMenuItem, Me.DummyItemToolStripMenuItem}) Me.ContextMenuStrip1.Name = "ContextMenuStrip1" resources.ApplyResources(Me.ContextMenuStrip1, "ContextMenuStrip1") ' @@ -210,10 +210,10 @@ Partial Class Main Me.CRCookieToolStripMenuItem.Name = "CRCookieToolStripMenuItem" resources.ApplyResources(Me.CRCookieToolStripMenuItem, "CRCookieToolStripMenuItem") ' - 'ClearAllSettingsToolStripMenuItem + 'UrlJsonsToolStripMenuItem ' - Me.ClearAllSettingsToolStripMenuItem.Name = "ClearAllSettingsToolStripMenuItem" - resources.ApplyResources(Me.ClearAllSettingsToolStripMenuItem, "ClearAllSettingsToolStripMenuItem") + Me.UrlJsonsToolStripMenuItem.Name = "UrlJsonsToolStripMenuItem" + resources.ApplyResources(Me.UrlJsonsToolStripMenuItem, "UrlJsonsToolStripMenuItem") ' 'ItemBoundsToolStripMenuItem ' @@ -287,7 +287,7 @@ Partial Class Main Friend WithEvents ThreadCount As ToolStripMenuItem Friend WithEvents MsgBoxToolStripMenuItem As ToolStripMenuItem Friend WithEvents CRCookieToolStripMenuItem As ToolStripMenuItem - Friend WithEvents ClearAllSettingsToolStripMenuItem As ToolStripMenuItem + Friend WithEvents UrlJsonsToolStripMenuItem As ToolStripMenuItem Friend WithEvents ItemBoundsToolStripMenuItem As ToolStripMenuItem Friend WithEvents DummyItemToolStripMenuItem As ToolStripMenuItem Public WithEvents Panel1 As Panel diff --git a/Crunchyroll Downloader/Main.resx b/Crunchyroll Downloader/Main.resx index 4d741d5..bff13bf 100644 --- a/Crunchyroll Downloader/Main.resx +++ b/Crunchyroll Downloader/Main.resx @@ -231,6 +231,21 @@ 842, 630 + + True + + + 1, 71 + + + 798, 403 + + + 840, 546 + + + 0 + Panel1 @@ -243,6 +258,24 @@ 1 + + None + + + Flat + + + NoControl + + + 800, 1 + + + 40, 40 + + + 5 + Btn_Close @@ -255,6 +288,24 @@ 2 + + None + + + Flat + + + NoControl + + + 757, 1 + + + 40, 40 + + + 4 + Btn_min @@ -267,6 +318,24 @@ 3 + + Zoom + + + Flat + + + NoControl + + + 641, 18 + + + 80, 35 + + + 3 + Btn_Settings @@ -279,6 +348,21 @@ 4 + + Zoom + + + Flat + + + 124, 18 + + + 80, 35 + + + 2 + Btn_Browser @@ -291,6 +375,24 @@ 5 + + Zoom + + + Flat + + + NoControl + + + 11, 18 + + + 80, 35 + + + 1 + Btn_add @@ -405,10 +507,10 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ClearAllSettingsToolStripMenuItem + + UrlJsonsToolStripMenuItem - + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -438,165 +540,9 @@ 276, 52 - - Zoom - - - Flat - - - NoControl - - - 11, 18 - - - 80, 35 - - - 1 - - - Btn_add - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 6 - - - Zoom - - - Flat - - - 124, 18 - - - 80, 35 - - - 2 - - - Btn_Browser - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 5 - - - Zoom - - - Flat - - - NoControl - - - 641, 18 - - - 80, 35 - - - 3 - - - Btn_Settings - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 4 - - - None - - - Flat - - - NoControl - - - 757, 1 - - - 40, 40 - - - 4 - - - Btn_min - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - None - - - Flat - - - NoControl - - - 800, 1 - - - 40, 40 - - - 5 - - - Btn_Close - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - 352, 49 - - 234, 268 - - - ContextMenuStrip1 - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 233, 22 @@ -651,11 +597,11 @@ CR_Cookie - + 233, 22 - - Clear all settings + + UrlJsons 233, 22 @@ -669,32 +615,14 @@ Dummy_Item - - True + + 234, 290 - - 1, 71 + + ContextMenuStrip1 - - 798, 403 - - - 840, 546 - - - 0 - - - Panel1 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 167, 10 diff --git a/Crunchyroll Downloader/Main.vb b/Crunchyroll Downloader/Main.vb index 46e4393..f4b4dac 100644 --- a/Crunchyroll Downloader/Main.vb +++ b/Crunchyroll Downloader/Main.vb @@ -25,7 +25,11 @@ Public Class Main Public CheckCRLogin As Boolean = True - 'Public LoadedUrl As String = Nothing + + Public CR_SeasonJson As UrlJson = New UrlJson("", "") + Public CR_ObjectsJson As UrlJson = New UrlJson("", "") + Public CR_VideoJson As UrlJson = New UrlJson("", "") + Public CrBetaMass As String = Nothing Public CrBetaMassEpisodes As String = Nothing Public CrBetaMassParameters As String = Nothing @@ -1147,7 +1151,7 @@ Public Class Main End If If CBool(InStr(SeasonJson, "curl:")) = True Then - MsgBox("Error - Getting SeasonJson data" + vbNewLine + SeasonJson) + MsgBox("Error - Getting SeasonJson data" + vbNewLine + SeasonJson + vbNewLine + vbNewLine + JsonUrl) Exit Sub End If SeasonJson = CleanJSON(SeasonJson) @@ -1223,6 +1227,9 @@ Public Class Main Dim ObjectsURL As String = ObjectsURLBuilder(0) + "objects/" + ObjectsURLBuilder4(0) + ObjectsURLBuilder2(1) Debug.WriteLine(ObjectsURL) + + + ObjectJson = Curl(ObjectsURL) 'MsgBox(ObjectJson) @@ -1231,7 +1238,12 @@ Public Class Main ObjectJson = Curl(ObjectsURL) End If - If CBool(InStr(ObjectJson, "curl:")) = True Then + If CBool(InStr(ObjectJson, "curl:")) = True And CBool(InStr(CR_ObjectsJson.Url, ObjectsURLBuilder4(0))) Then + Debug.WriteLine("curl error, using UrlJson " + vbNewLine + ObjectJson) + + ObjectJson = CR_ObjectsJson.Content + CR_ObjectsJson = New UrlJson("", "") + ElseIf CBool(InStr(ObjectJson, "curl:")) Then MsgBox("Error - Getting ObjectJson data" + vbNewLine + ObjectJson) Exit Sub End If @@ -1533,7 +1545,16 @@ Public Class Main VideoJson = Curl(Streams) End If - If CBool(InStr(VideoJson, "curl:")) = True Then + Dim StreamsUrlBuilder() As String = ObjectJson.Split(New String() {"videos/"}, System.StringSplitOptions.RemoveEmptyEntries) + Dim StreamsUrlBuilder2() As String = StreamsUrlBuilder(1).Split(New String() {"/streams"}, System.StringSplitOptions.RemoveEmptyEntries) + + + + If CBool(InStr(VideoJson, "curl:")) = True And CBool(InStr(CR_VideoJson.Url, StreamsUrlBuilder2(0))) Then + Debug.WriteLine("curl error, using UrlJson " + vbNewLine + VideoJson) + VideoJson = CR_VideoJson.Content + CR_VideoJson = New UrlJson("", "") + ElseIf CBool(InStr(VideoJson, "curl:")) = True Then VideoJson = Nothing MsgBox("Error - Getting VideoJson data" + vbNewLine + VideoJson) Exit Sub @@ -4224,13 +4245,11 @@ Public Class Main 'MsgBox(CR_Cookies) End Sub - Private Sub ClearAllSettingsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ClearAllSettingsToolStripMenuItem.Click + Private Sub ClearAllSettingsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles UrlJsonsToolStripMenuItem.Click - - If MessageBox.Show("This will clear all settings and close the programm!", "confirm?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then - Registry.CurrentUser.DeleteSubKey("Software\CRDownloader") - Me.Close() - End If + MsgBox("Season" + vbNewLine + CR_SeasonJson.Content.Count.ToString) + MsgBox("Object" + vbNewLine + CR_ObjectsJson.Content.Count.ToString) + MsgBox("Streams" + vbNewLine + CR_VideoJson.Content.Count.ToString) End Sub @@ -4375,6 +4394,20 @@ Public Class CR_Beta_Stream End Function End Class +Public Class UrlJson + + Public Url As String + Public Content As String + Public Sub New(ByVal Url As String, ByVal Content As String) + Me.Url = Url + Me.Content = Content + + End Sub + + Public Overrides Function ToString() As String + Return String.Format("{0}, {1}", Me.Url, Me.Content) + End Function +End Class Public Class ServerResponse Public Type As String diff --git a/Crunchyroll Downloader/My Project/AssemblyInfo.vb b/Crunchyroll Downloader/My Project/AssemblyInfo.vb index 65fb66c..9e2d6d9 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: ' - - + +