From 503e471418f1836a745a9c116e742537d938cf8a Mon Sep 17 00:00:00 2001 From: hama3254 <52826614+hama3254@users.noreply.github.com> Date: Sat, 28 May 2022 22:17:12 +0200 Subject: [PATCH] added crunchyroll beta direct api access added crunchyroll beta api processing adjustems for changed RequestHandler library --- .../project-colors.json | 5 + .vs/Crunchyroll Downloader/v17/.suo | Bin 129536 -> 124416 bytes Crunchyroll Downloader/Anime_Add.vb | 170 ++++++++++++++++-- Crunchyroll Downloader/App.config | 5 + Crunchyroll Downloader/CefSharp_Browser.vb | 108 ++++++----- .../Crunchyroll Downloader.vbproj | 28 +-- Crunchyroll Downloader/Main.designer.vb | 9 +- Crunchyroll Downloader/Main.resx | 22 ++- Crunchyroll Downloader/Main.vb | 11 +- Crunchyroll Downloader/packages.config | 8 +- 10 files changed, 288 insertions(+), 78 deletions(-) diff --git a/.vs/Crunchyroll Downloader/project-colors.json b/.vs/Crunchyroll Downloader/project-colors.json index 4d7fa50..b2743bf 100644 --- a/.vs/Crunchyroll Downloader/project-colors.json +++ b/.vs/Crunchyroll Downloader/project-colors.json @@ -5,6 +5,11 @@ "ProjectGuid": "9b604819-2db7-4be1-ba43-43babebb5ec3", "DisplayName": "Crunchyroll Downloader", "ColorIndex": 0 + }, + "a2fe74e1-b743-11d0-ae1a-00a0c90fffc3": { + "ProjectGuid": "a2fe74e1-b743-11d0-ae1a-00a0c90fffc3", + "DisplayName": "Sonstige Dateien", + "ColorIndex": -1 } }, "NextColorIndex": 1 diff --git a/.vs/Crunchyroll Downloader/v17/.suo b/.vs/Crunchyroll Downloader/v17/.suo index b771338c874ff5c662e9113a1df8c2c785bdf5e5..5fc27bcd2ca242f0fa7a9341a73af3520656532c 100644 GIT binary patch delta 8541 zcmeHM3s}_0wV(4}76BIoTy%?oETBO|Ug0g8$RO=1)guTj(BQa6`c#fmqY8beG%G$koM(%kej7F%p@ybAZse|H6wXl_h;o9})d zzr(!FoO9;PIlr0zYVI3mJ~Ql@$O#fMq<9nJiCqDye_&vM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?hxCn!P)O9efp3}P|qjWUXJbWrelG0 zJWOUH;8qIPQQ$3$9!=eAzSVuQ1A$tRv)kYrVl*K!X40d63SvZBF1#-BZ4+Lp@GhJb zh0_o$Z5iMWpYcii{~(TU0x!rAPi4Y+@x?vR&d)4#7N1RrEMd+>6z0qUE%~?$-E;^N zrYtxkW^}-_Li+;fo?Qc%1RfbwHr5Qf5o_N5lhzF=0?FyRTr|SYMG|Zr&we-PEGKEE zxHJnc!)Lb4+&UZnB6^;J5C#3~c|J4>-+Az*!)knfAHsUYT<8!NboLdhd==E9qZVcjFr7{hCV`K37n}1zX??OA z^iI@C;*ZNS?}+0Y!C5?%30?|6oZcXS72d-;iVGyLh@(23sE^p!2)S@Y!XC~fT=6r! z>ymByIExWt>(3EqA3cIGL!2GHIt6j&5s>3+?DFV8@U>&Y#gRuL=%wD30K)ugKOV)_ zmEdpfeGE2%nA-}^BE*+J*(rir@n!#W+hX84go`iUfv+8cw{?AV%HkLPh&qZrz)~=V~v`iqh5A%6xLE@pc zpn_QO)T{UgM3J`UyaFlLy?%B8tvX@c1}j8FDgu?Bg|E_x$zKwXbymFeu}t*nKx>`8 U9V$TVm<~14(pjf}2o+BM14ELFG5`Po diff --git a/Crunchyroll Downloader/Anime_Add.vb b/Crunchyroll Downloader/Anime_Add.vb index 760b6d2..e9d4b4d 100644 --- a/Crunchyroll Downloader/Anime_Add.vb +++ b/Crunchyroll Downloader/Anime_Add.vb @@ -7,6 +7,8 @@ Imports System.Threading Imports MetroFramework.Forms Imports MetroFramework Imports MetroFramework.Components +Imports CefSharp +Imports System.Text Public Class Anime_Add Public Mass_DL_Cancel As Boolean = False @@ -15,13 +17,161 @@ Public Class Anime_Add Public ThreadList As New List(Of Thread) - - - - Public Authorization As String = Nothing Public AuthorizationCookie As String = Nothing + + Private Sub LoadBrowser(ByVal Url As String) + Dim locale As String = "en-US" + If CBool(InStr(Url, "beta.crunchyroll.com")) = True And CBool(InStr(Url, "watch")) = True And CBool(Main.CrBetaBasic = Nothing) = False Then +#Region "Get Cookies" + Dim Cookies As String = "Cookie: " + Try + Dim Collector As New TaskCookieVisitor + Dim CM As ICookieManager = CefSharp_Browser.WebBrowser1.GetCookieManager + CM.VisitAllCookies(Collector) + Dim DeviceRegion As String = Nothing + Dim list As List(Of Global.CefSharp.Cookie) = Collector.Task.Result() + For i As Integer = 0 To list.Count - 1 + If CBool(InStr(list.Item(i).Domain, ".crunchyroll.com")) And CBool(InStr(list.Item(i).Name, "_evidon_suppress")) = False Then + Cookies = Cookies + list.Item(i).Name + "=" + list.Item(i).Value + ";" + End If + If CBool(InStr(list.Item(i).Domain, ".crunchyroll.com")) And CBool(InStr(list.Item(i).Name, "c_locale")) Then + locale = list.Item(i).Value + End If + Next + Catch ex As Exception + CefSharp_Browser.WebBrowser1.Load(Url) + Exit Sub + End Try + +#End Region + Dim CRBetaBearer As String = "Bearer " + Try + + Dim Request As HttpWebRequest = CType(WebRequest.Create("https://beta.crunchyroll.com/auth/v1/token"), HttpWebRequest) + Request.Method = "POST" + Request.ContentType = "application/x-www-form-urlencoded" + Request.Accept = "application/json, text/plain, */*" + 'Request.Headers.Add("Accept-Language: de,en-US;q=0.7,en;q=0.3") + Request.Headers.Add("Accept-Encoding: identity") + Request.Headers.Add("Authorization: " + Main.CrBetaBasic) + 'Request.Headers.Add("Referer: " + Url) + Request.Referer = Url + Request.Headers.Add("Origin: https://beta.crunchyroll.com") + Request.Headers.Add(Cookies) + Dim Post As String = "grant_type=etp_rt_cookie" + Dim byteArray() As Byte = Encoding.UTF8.GetBytes(Post) + Request.ContentLength = byteArray.Length + Dim DataStream As Stream = Request.GetRequestStream() + DataStream.Write(byteArray, 0, byteArray.Length) + DataStream.Close() + Dim Response As HttpWebResponse = CType(Request.GetResponse(), HttpWebResponse) + DataStream = Response.GetResponseStream() + Dim reader As New StreamReader(DataStream) + Dim ServerResponseString As String = reader.ReadToEnd() + reader.Close() + DataStream.Close() + Response.Close() + 'Debug.WriteLine(ServerResponseString) + Dim Token() As String = ServerResponseString.Split(New String() {Chr(34) + "access_token" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) + Dim Token2() As String = Token(1).Split(New String() {Chr(34) + "," + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) + CRBetaBearer = CRBetaBearer + Token2(0) + Catch ex As Exception + Debug.WriteLine(ex.ToString) + CefSharp_Browser.WebBrowser1.Load(Url) + Exit Sub + End Try + + Dim ObjectsUrl 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), "")) + client.Headers.Add("ACCEPT: application/json, text/javascript, */*; q=0.01") + client.Headers.Add("Accept-Encoding: identity") + client.Headers.Add("Referer: " + Url) + client.Headers.Add("Authorization: " + CRBetaBearer) + client.Headers.Add(Cookies) '+ WebBrowser1.Document.Cookie) + 'MsgBox(OmUStreamSplitEpisodeIndex(1)) + Dim v2Content As String = client.DownloadString("https://beta.crunchyroll.com/index/v2") + 'Debug.WriteLine(v2Content) + + Dim v2ContentBeta() As String = v2Content.Split(New String() {Chr(34) + "cms_beta" + Chr(34) + ":"}, System.StringSplitOptions.RemoveEmptyEntries) + + + Dim bucket() As String = v2ContentBeta(1).Split(New String() {Chr(34) + "bucket" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) + Dim bucket2() As String = bucket(1).Split(New String() {Chr(34) + "," + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) + + Dim policy() As String = v2ContentBeta(1).Split(New String() {Chr(34) + "policy" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) + Dim policy2() As String = policy(1).Split(New String() {Chr(34) + "," + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) + + Dim signature() As String = v2ContentBeta(1).Split(New String() {Chr(34) + "signature" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) + Dim signature2() As String = signature(1).Split(New String() {Chr(34) + "," + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) + + Dim key_pair_id() As String = v2ContentBeta(1).Split(New String() {Chr(34) + "key_pair_id" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) + Dim key_pair_id2() As String = key_pair_id(1).Split(New String() {Chr(34) + "," + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) + + Dim ObjectsURLBuilder3() As String = Url.Split(New String() {"watch/"}, System.StringSplitOptions.RemoveEmptyEntries) + Dim ObjectsURLBuilder4() As String = ObjectsURLBuilder3(1).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries) + + + ObjectsUrl = "https://beta.crunchyroll.com/cms/v2" + bucket2(0) + "/objects/" + ObjectsURLBuilder4(0) + "?locale=" + locale + "&Signature=" + signature2(0) + "&Policy=" + policy2(0) + "&Key-Pair-Id=" + key_pair_id2(0) + End Using + + + 'Debug.WriteLine(ObjectsUrl) + + Catch ex As Exception + CefSharp_Browser.WebBrowser1.Load(Url) + Exit Sub + End Try + + Dim StreamsUrl As String = Nothing + Dim ObjectJson As String + Try + Try + Using client As New WebClient() + client.Encoding = System.Text.Encoding.UTF8 + client.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), "")) + ObjectJson = client.DownloadString(ObjectsUrl) + End Using + Catch ex As Exception + Debug.WriteLine("error- getting name data") + Exit Sub + End Try + + Catch ex As Exception + CefSharp_Browser.WebBrowser1.Load(Url) + Exit Sub + End Try + + Try + 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) + + Dim StreamsUrlBuilder3() As String = ObjectsUrl.Split(New String() {"objects/"}, System.StringSplitOptions.RemoveEmptyEntries) + Dim StreamsUrlBuilder4() As String = StreamsUrlBuilder3(1).Split(New String() {"?"}, System.StringSplitOptions.RemoveEmptyEntries) + + StreamsUrl = StreamsUrlBuilder3(0) + "videos/" + StreamsUrlBuilder2(0) + "/streams?" + StreamsUrlBuilder4(1) + + ' Debug.WriteLine(StreamsUrl) + Catch ex As Exception + CefSharp_Browser.WebBrowser1.Load(Url) + Exit Sub + End Try + + Main.GetBetaVideoProxy(StreamsUrl, Url) + + + Else + CefSharp_Browser.WebBrowser1.Load(Url) + End If + + + End Sub + Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox2.SelectedIndexChanged Try If ComboBox2.Text = SubFolder_Nothing Then @@ -242,7 +392,7 @@ Public Class Anime_Add Main.b = False Debug.WriteLine("Start loading: " + Date.Now.ToString) - CefSharp_Browser.WebBrowser1.Load(textBox1.Text) + LoadBrowser(textBox1.Text) StatusLabel.Text = "Status: loading ...." End If @@ -251,12 +401,12 @@ Public Class Anime_Add ElseIf CBool(InStr(textBox1.Text, "Test=true")) Then - CefSharp_Browser.WebBrowser1.Load(textBox1.Text) + LoadBrowser(textBox1.Text) 'Else 'If CBool(InStr(textBox1.Text, "vrv.co")) Then ElseIf CBool(InStr(textBox1.Text, "https://")) Then If MessageBox.Show("This in NOT a Crunchyroll URL, try anyway?", "confirm?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then Main.b = False - CefSharp_Browser.WebBrowser1.Load(textBox1.Text) + LoadBrowser(textBox1.Text) StatusLabel.Text = "Status: looking for non CR video file" Else @@ -562,7 +712,7 @@ Public Class Anime_Add Debug.WriteLine("error- getting EpisodeJson data") Debug.WriteLine(ex.ToString) Main.FunimationJsonBrowser = "EpisodeJson" - CefSharp_Browser.WebBrowser1.Load(EpisodeJsonURL) + LoadBrowser(EpisodeJsonURL) Exit Sub End Try @@ -710,7 +860,7 @@ Public Class Anime_Add Main.WebbrowserURL = UriUsed ListBox1.Items.Remove(ListBox1.Items(0)) Main.b = False - CefSharp_Browser.WebBrowser1.Load(UriUsed) + LoadBrowser(UriUsed) StatusLabel.Text = "Status: loading in browser" Main.Text = "Status: loading in browser" @@ -720,7 +870,7 @@ Public Class Anime_Add Else If Main.Grapp_RDY = True Then Main.Grapp_RDY = False - CefSharp_Browser.WebBrowser1.Load(ListBox1.GetItemText(ListBox1.Items(0))) + LoadBrowser(ListBox1.GetItemText(ListBox1.Items(0))) ListBox1.Items.Remove(ListBox1.Items(0)) Main.b = False StatusLabel.Text = "Status: loading ..." diff --git a/Crunchyroll Downloader/App.config b/Crunchyroll Downloader/App.config index dfdc4ad..ccbc179 100644 --- a/Crunchyroll Downloader/App.config +++ b/Crunchyroll Downloader/App.config @@ -16,4 +16,9 @@ + + + + + diff --git a/Crunchyroll Downloader/CefSharp_Browser.vb b/Crunchyroll Downloader/CefSharp_Browser.vb index 5a4ba49..33b576b 100644 --- a/Crunchyroll Downloader/CefSharp_Browser.vb +++ b/Crunchyroll Downloader/CefSharp_Browser.vb @@ -243,7 +243,7 @@ Public Class CefSharp_Browser Private Sub ObserveHttp(e As RequestResourceEventArgs) 'Handles RequestResource.GetUrl - 'Debug.WriteLine(e.RequestUrl) + 'Debug.WriteLine(e.Request.Url) If (Me.InvokeRequired) Then If Main.b = True And Main.FunimationJsonBrowser = Nothing Then @@ -254,97 +254,119 @@ Public Class CefSharp_Browser Exit Sub End If End If - ' - 'Debug.WriteLine(e.RequestUrl) - If CBool(InStr(e.RequestUrl, "?deviceType=web")) Then - 'Debug.WriteLine(e.RequestUrl) - Dim parms As String() = e.RequestUrl.Split(New String() {"?deviceType="}, System.StringSplitOptions.RemoveEmptyEntries) + + + If (Me.InvokeRequired) Then + Me.Invoke(Sub() + If CBool(InStr(e.Request.Url, "beta.crunchyroll.com")) = True And CBool(InStr(e.Request.Headers, "Basic ")) = True And Main.CrBetaBasic = Nothing Then + Dim Basic As String() = e.Request.Headers.Split(New String() {"Basic "}, System.StringSplitOptions.RemoveEmptyEntries) + Dim Basic2 As String() = Basic(1).Split(New String() {","}, System.StringSplitOptions.RemoveEmptyEntries) + Main.CrBetaBasic = "Basic " + Basic2(0) + Debug.WriteLine(Main.CrBetaBasic) + End If + End Sub) + Else + If CBool(InStr(e.Request.Url, "beta.crunchyroll.com")) = True And CBool(InStr(e.Request.Headers, "Basic ")) = True And Main.CrBetaBasic = Nothing Then + Dim Basic As String() = e.Request.Headers.Split(New String() {"Basic "}, System.StringSplitOptions.RemoveEmptyEntries) + Dim Basic2 As String() = Basic(1).Split(New String() {","}, System.StringSplitOptions.RemoveEmptyEntries) + Main.CrBetaBasic = "Basic " + Basic2(0) + Debug.WriteLine(Main.CrBetaBasic) + End If + End If + + + ' + 'Debug.WriteLine(e.Request.Url) + + If CBool(InStr(e.Request.Url, "?deviceType=web")) Then + 'Debug.WriteLine(e.Request.Url) + Dim parms As String() = e.Request.Url.Split(New String() {"?deviceType="}, System.StringSplitOptions.RemoveEmptyEntries) Main.FunimationDeviceRegion = "?deviceType=" + parms(1) End If - If CBool(InStr(e.RequestUrl, "https://title-api.prd.funimationsvc.com")) Then + If CBool(InStr(e.Request.Url, "https://title-api.prd.funimationsvc.com")) Then If (Me.InvokeRequired) Then - Me.Invoke(Sub() Main.LoadedUrls.Add(e.RequestUrl)) + Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Url)) Exit Sub Else - Main.LoadedUrls.Add(e.RequestUrl) + Main.LoadedUrls.Add(e.Request.Url) Exit Sub End If - Debug.WriteLine(e.RequestUrl) - ElseIf CBool(InStr(e.RequestUrl, "/data/v2/shows/")) Then + Debug.WriteLine(e.Request.Url) + ElseIf CBool(InStr(e.Request.Url, "/data/v2/shows/")) Then If (Me.InvokeRequired) Then - Me.Invoke(Sub() Main.LoadedUrls.Add(e.RequestUrl)) + Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Url)) Exit Sub Else - Main.LoadedUrls.Add(e.RequestUrl) + Main.LoadedUrls.Add(e.Request.Url) Exit Sub End If - Debug.WriteLine(e.RequestUrl) - ElseIf CBool(InStr(e.RequestUrl, "/data/v1/episodes/")) Then + Debug.WriteLine(e.Request.Url) + ElseIf CBool(InStr(e.Request.Url, "/data/v1/episodes/")) Then If (Me.InvokeRequired) Then - Me.Invoke(Sub() Main.LoadedUrls.Add(e.RequestUrl)) + Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Url)) Exit Sub Else - Main.LoadedUrls.Add(e.RequestUrl) + Main.LoadedUrls.Add(e.Request.Url) Exit Sub End If - Debug.WriteLine(e.RequestUrl) + Debug.WriteLine(e.Request.Url) - ElseIf CBool(InStr(e.RequestUrl, "https://beta-api.crunchyroll.com/")) And CBool(InStr(e.RequestUrl, "streams?")) Then + ElseIf CBool(InStr(e.Request.Url, "https://beta-api.crunchyroll.com/")) And CBool(InStr(e.Request.Url, "streams?")) Then If (Me.InvokeRequired) Then - Me.Invoke(Sub() Main.LoadedUrls.Add(e.RequestUrl)) + Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Url)) Exit Sub Else - Main.LoadedUrls.Add(e.RequestUrl) + Main.LoadedUrls.Add(e.Request.Url) Exit Sub End If - Debug.WriteLine(e.RequestUrl) - ElseIf CBool(InStr(e.RequestUrl, "https://beta.crunchyroll.com/")) And CBool(InStr(e.RequestUrl, "streams?")) Then + Debug.WriteLine(e.Request.Url) + ElseIf CBool(InStr(e.Request.Url, "https://beta.crunchyroll.com/")) And CBool(InStr(e.Request.Url, "streams?")) Then If (Me.InvokeRequired) Then - Me.Invoke(Sub() Main.LoadedUrls.Add(e.RequestUrl)) + Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Url)) Exit Sub Else - Main.LoadedUrls.Add(e.RequestUrl) + Main.LoadedUrls.Add(e.Request.Url) 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 + Debug.WriteLine(e.Request.Url) + ElseIf CBool(InStr(e.Request.Url, "https://beta-api.crunchyroll.com/")) And CBool(InStr(e.Request.Url, "seasons?series_id=")) Then If (Me.InvokeRequired) Then - Me.Invoke(Sub() Main.LoadedUrls.Add(e.RequestUrl)) + Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Url)) Exit Sub Else - Main.LoadedUrls.Add(e.RequestUrl) + Main.LoadedUrls.Add(e.Request.Url) Exit Sub End If - Debug.WriteLine(e.RequestUrl) - ElseIf CBool(InStr(e.RequestUrl, "https://beta.crunchyroll.com/")) And CBool(InStr(e.RequestUrl, "seasons?series_id=")) Then + Debug.WriteLine(e.Request.Url) + ElseIf CBool(InStr(e.Request.Url, "https://beta.crunchyroll.com/")) And CBool(InStr(e.Request.Url, "seasons?series_id=")) Then If (Me.InvokeRequired) Then - Me.Invoke(Sub() Main.LoadedUrls.Add(e.RequestUrl)) + Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Url)) Exit Sub Else - Main.LoadedUrls.Add(e.RequestUrl) + Main.LoadedUrls.Add(e.Request.Url) Exit Sub End If - Debug.WriteLine(e.RequestUrl) - ElseIf CBool(InStr(e.RequestUrl, "https://api.vrv.co")) And CBool(InStr(e.RequestUrl, "streams?")) Then + Debug.WriteLine(e.Request.Url) + ElseIf CBool(InStr(e.Request.Url, "https://api.vrv.co")) And CBool(InStr(e.Request.Url, "streams?")) Then If (Me.InvokeRequired) Then - Me.Invoke(Sub() Main.LoadedUrls.Add(e.RequestUrl)) + Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Url)) Exit Sub Else - Main.LoadedUrls.Add(e.RequestUrl) + Main.LoadedUrls.Add(e.Request.Url) 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 + Debug.WriteLine(e.Request.Url) + ElseIf CBool(InStr(e.Request.Url, "https://api.vrv.co")) And CBool(InStr(e.Request.Url, "seasons?series_id=")) Then If (Me.InvokeRequired) Then - Me.Invoke(Sub() Main.LoadedUrls.Add(e.RequestUrl)) + Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Url)) Exit Sub Else - Main.LoadedUrls.Add(e.RequestUrl) + Main.LoadedUrls.Add(e.Request.Url) Exit Sub End If - Debug.WriteLine(e.RequestUrl) + Debug.WriteLine(e.Request.Url) End If @@ -353,7 +375,7 @@ Public Class CefSharp_Browser Dim requesturl As String = Nothing Try - requesturl = e.RequestUrl + requesturl = e.Request.Url Catch ex As Exception Exit Sub End Try diff --git a/Crunchyroll Downloader/Crunchyroll Downloader.vbproj b/Crunchyroll Downloader/Crunchyroll Downloader.vbproj index a895873..e26e231 100644 --- a/Crunchyroll Downloader/Crunchyroll Downloader.vbproj +++ b/Crunchyroll Downloader/Crunchyroll Downloader.vbproj @@ -1,8 +1,8 @@  - - - + + + Debug @@ -105,14 +105,14 @@ 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036 - - ..\packages\CefSharp.Common.101.0.150\lib\net452\CefSharp.dll + + ..\packages\CefSharp.Common.101.0.180\lib\net452\CefSharp.dll - - ..\packages\CefSharp.Common.101.0.150\lib\net452\CefSharp.Core.dll + + ..\packages\CefSharp.Common.101.0.180\lib\net452\CefSharp.Core.dll - - ..\packages\CefSharp.WinForms.101.0.150\lib\net462\CefSharp.WinForms.dll + + ..\packages\CefSharp.WinForms.101.0.180\lib\net462\CefSharp.WinForms.dll False @@ -410,10 +410,10 @@ Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}". - - - - + + + + - + \ No newline at end of file diff --git a/Crunchyroll Downloader/Main.designer.vb b/Crunchyroll Downloader/Main.designer.vb index fe5bdb6..07d4f76 100644 --- a/Crunchyroll Downloader/Main.designer.vb +++ b/Crunchyroll Downloader/Main.designer.vb @@ -46,6 +46,7 @@ Partial Class Main Me.ToggleDebugModeToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.OpenSettingsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.TestDownloadToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.CheckCRBetaTokenToolStripMenuItem = 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() @@ -179,7 +180,7 @@ Partial Class Main ' 'ContextMenuStrip1 ' - Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToggleDebugModeToolStripMenuItem, Me.OpenSettingsToolStripMenuItem, Me.TestDownloadToolStripMenuItem}) + Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToggleDebugModeToolStripMenuItem, Me.OpenSettingsToolStripMenuItem, Me.TestDownloadToolStripMenuItem, Me.CheckCRBetaTokenToolStripMenuItem}) Me.ContextMenuStrip1.Name = "ContextMenuStrip1" resources.ApplyResources(Me.ContextMenuStrip1, "ContextMenuStrip1") ' @@ -198,6 +199,11 @@ Partial Class Main Me.TestDownloadToolStripMenuItem.Name = "TestDownloadToolStripMenuItem" resources.ApplyResources(Me.TestDownloadToolStripMenuItem, "TestDownloadToolStripMenuItem") ' + 'CheckCRBetaTokenToolStripMenuItem + ' + Me.CheckCRBetaTokenToolStripMenuItem.Name = "CheckCRBetaTokenToolStripMenuItem" + resources.ApplyResources(Me.CheckCRBetaTokenToolStripMenuItem, "CheckCRBetaTokenToolStripMenuItem") + ' 'Main ' Me.ApplyImageInvert = True @@ -249,4 +255,5 @@ Partial Class Main Friend WithEvents ToggleDebugModeToolStripMenuItem As ToolStripMenuItem Friend WithEvents OpenSettingsToolStripMenuItem As ToolStripMenuItem Friend WithEvents TestDownloadToolStripMenuItem As ToolStripMenuItem + Friend WithEvents CheckCRBetaTokenToolStripMenuItem As ToolStripMenuItem End Class diff --git a/Crunchyroll Downloader/Main.resx b/Crunchyroll Downloader/Main.resx index bb384fc..b6256a8 100644 --- a/Crunchyroll Downloader/Main.resx +++ b/Crunchyroll Downloader/Main.resx @@ -504,6 +504,12 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + CheckCRBetaTokenToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Main @@ -520,25 +526,31 @@ 966, 17 - 181, 22 + 205, 22 Toggle Debug Mode - 181, 22 + 205, 22 Open Settings - 181, 22 + 205, 22 - Check Token + Check Funimation Token + + + 205, 22 + + + Check CR Beta Token - 182, 70 + 206, 92 ContextMenuStrip1 diff --git a/Crunchyroll Downloader/Main.vb b/Crunchyroll Downloader/Main.vb index cb55002..628a5f0 100644 --- a/Crunchyroll Downloader/Main.vb +++ b/Crunchyroll Downloader/Main.vb @@ -24,6 +24,7 @@ Public Class Main Public CrBetaMassEpisodes As String = Nothing Public CrBetaMassParameters As String = Nothing Public CrBetaMassBaseURL As String = Nothing + Public CrBetaBasic As String = Nothing Public BlockList As List(Of String) Public LoadedUrls As New List(Of String) Public VRVMass As String = Nothing @@ -1735,6 +1736,9 @@ Public Class Main End Sub Public Sub GetBetaVideo(ByVal Streams As String, ByVal WebsiteURL As String) + Debug.WriteLine(Streams) + Debug.WriteLine(vbCrLf) + Debug.WriteLine(WebsiteURL) Try Grapp_RDY = False Dim ffmpeg_command_temp As String = ffmpeg_command @@ -5193,8 +5197,13 @@ Public Class Main End If End Sub - Private Sub ContextMenuStrip1_Opening(sender As Object, e As CancelEventArgs) Handles ContextMenuStrip1.Opening + Private Sub CheckCRBetaTokenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CheckCRBetaTokenToolStripMenuItem.Click + If CrBetaBasic = Nothing Then + MsgBox("No CR Beta Basic Token has been found...", MsgBoxStyle.Exclamation) + Else + MsgBox("CR Beta Basic Token found!" + vbNewLine + CrBetaBasic, MsgBoxStyle.Information) + End If End Sub #End Region diff --git a/Crunchyroll Downloader/packages.config b/Crunchyroll Downloader/packages.config index f7651c1..2085cfb 100644 --- a/Crunchyroll Downloader/packages.config +++ b/Crunchyroll Downloader/packages.config @@ -1,8 +1,8 @@  - - - - + + + + \ No newline at end of file