diff --git a/.vs/Crunchyroll Downloader/v17/.suo b/.vs/Crunchyroll Downloader/v17/.suo index c6f504a..7b271e2 100644 Binary files a/.vs/Crunchyroll Downloader/v17/.suo and b/.vs/Crunchyroll Downloader/v17/.suo differ diff --git a/Crunchyroll Downloader/Browser.vb b/Crunchyroll Downloader/Browser.vb index cdad930..4bb5e22 100644 --- a/Crunchyroll Downloader/Browser.vb +++ b/Crunchyroll Downloader/Browser.vb @@ -21,6 +21,7 @@ Public Class Browser Try WebView2.CoreWebView2.AddWebResourceRequestedFilter("https://www.crunchyroll.com/*", CoreWebView2WebResourceContext.All) WebView2.CoreWebView2.AddWebResourceRequestedFilter("https://www.funimation.com/*", CoreWebView2WebResourceContext.All) + ' WebView2.CoreWebView2.AddWebResourceRequestedFilter("*", CoreWebView2WebResourceContext.All) 'WebView2.CoreWebView2.AddWebResourceRequestedFilter("*", CoreWebView2WebResourceContext.All) AddHandler WebView2.CoreWebView2.WebResourceResponseReceived, AddressOf ObserveResponse @@ -269,6 +270,8 @@ Public Class Browser Private Sub ObserveHttp(ByVal sender As Object, ByVal e As CoreWebView2WebResourceRequestedEventArgs) 'Handles RequestResource.GetUrl + ' Debug.WriteLine(e.Request.Uri) + 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) @@ -296,13 +299,13 @@ Public Class Browser ' ' - If CBool(InStr(e.Request.Uri, "9016.2bd48f1e07adf6596b2d.js")) = True Then ' - Debug.WriteLine(e.Request.Uri) - 'MsgBox("Found!") - e.Response = WebView2.CoreWebView2.Environment.CreateWebResourceResponse(StringToStream(File.ReadAllText(Application.StartupPath + "\WebInterface\9016.2bd48f1e07adf6596b2d.js"), Encoding.UTF8), 200, "Not found", "content-type: application/javascript") + 'If CBool(InStr(e.Request.Uri, "9016.2bd48f1e07adf6596b2d.js")) = True Then ' + ' Debug.WriteLine(e.Request.Uri) + ' 'MsgBox("Found!") + ' e.Response = WebView2.CoreWebView2.Environment.CreateWebResourceResponse(StringToStream(File.ReadAllText(Application.StartupPath + "\WebInterface\9016.2bd48f1e07adf6596b2d.js"), Encoding.UTF8), 200, "Not found", "content-type: application/javascript") - End If + 'End If End Sub diff --git a/Crunchyroll Downloader/Main.vb b/Crunchyroll Downloader/Main.vb index 379b7bf..5151af6 100644 --- a/Crunchyroll Downloader/Main.vb +++ b/Crunchyroll Downloader/Main.vb @@ -4459,18 +4459,19 @@ Public Class Main Url_locale = locale2(0) End If - If CBool(InStr(Url, "musicvideo/")) Then - SetStatusLabel("Status: musicvideo detected - partial support only") + 'If CBool(InStr(Url, "musicvideo/")) Then + ' SetStatusLabel("Status: musicvideo detected - partial support only") - Browser.WebView2.CoreWebView2.Navigate(Url) - Exit Sub - ElseIf CBool(InStr(Url, "/concert/")) Then + ' Browser.WebView2.CoreWebView2.Navigate(Url) + ' Exit Sub + 'Else + 'If CBool(InStr(Url, "/concert/")) Then - SetStatusLabel("Status: concert detected - partial support only") - Browser.WebView2.CoreWebView2.Navigate(Url) - Exit Sub + ' SetStatusLabel("Status: concert detected - partial support only") + ' Browser.WebView2.CoreWebView2.Navigate(Url) + ' Exit Sub - End If + ' End If End If @@ -4495,8 +4496,9 @@ Public Class Main If CBool(InStr(v1Token, "curl:")) = True And CBool(InStr(v1Token, "400")) = True Then - - v1Token = CurlPost("https://www.crunchyroll.com/auth/v1/token", Loc_CR_Cookies, Auth, Post.Replace("etp_rt_cookie", "client_id"), "add_main-4499") + Debug.WriteLine("Post error!, 400") + Debug.WriteLine(Post.Replace("etp_rt_cookie", "client_id")) + v1Token = CurlPost("https://www.crunchyroll.com/auth/v1/token", Loc_CR_Cookies, Auth, Post.Replace("etp_rt_cookie", "client_id"), "add_main-4499") End If @@ -4544,6 +4546,7 @@ Public Class Main Public Sub ProcessLoading(ByVal url As String, Auth2 As String, ByVal Loc_CR_Cookies As String, ByVal RT_Count As Integer) + ' MsgBox(url) If CBool(InStr(url, "crunchyroll.com")) = True And CBool(InStr(url, "series/")) = True Then Dim SeriesUrlBuilder() As String = url.Split(New String() {"series/"}, System.StringSplitOptions.RemoveEmptyEntries) @@ -4556,7 +4559,9 @@ Public Class Main GetBetaSeasons(url, SeriesUrl, Auth2) - ElseIf CBool(InStr(url, "crunchyroll.com")) = True And CBool(InStr(url, "watch/")) = True And CBool(CrBetaBasic = Nothing) = False Then + ElseIf CBool(InStr(url, "crunchyroll.com")) = True And CBool(InStr(url, "watch/")) = True And CBool(CrBetaBasic = Nothing) = False And CBool(InStr(url, "/musicvideo/")) = False And CBool(InStr(url, "/concert/")) = False Then +#Region "Anime" + Dim ObjectsUrl As String = Nothing @@ -4626,8 +4631,112 @@ Public Class Main End Try GetCRVideoProxy(StreamsUrl, Auth2, url, RT_Count) +#End Region + ElseIf CBool(InStr(url, "crunchyroll.com")) = True And CBool(InStr(url, "musicvideo/")) = True And CBool(CrBetaBasic = Nothing) = False Then +#Region "musik videos" + Dim ObjectsUrl As String = Nothing + + Dim ObjectsURLBuilder3() As String = url.Split(New String() {"musicvideo/"}, System.StringSplitOptions.RemoveEmptyEntries) + Dim ObjectsURLBuilder4() As String = ObjectsURLBuilder3(1).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries) + + + + ObjectsUrl = "https://www.crunchyroll.com/content/v2/music/music_videos/" + ObjectsURLBuilder4(0) + "?locale=" + locale + + Debug.WriteLine("ObjectsUrl: " + ObjectsUrl) + + + Dim StreamsUrl As String = Nothing + Dim ObjectJson As String + + Try + + ObjectJson = CurlAuthNew(ObjectsUrl, Loc_CR_Cookies, Auth2) + + Catch ex As Exception + + If CBool(InStr(ex.ToString, "Error - Getting")) Then + MsgBox("Error invalid CR respone") + Exit Sub + Else + MsgBox("Error processing data") + Exit Sub + End If + End Try + + + If CBool(InStr(ObjectJson, "/content/v2/music/")) = False Then + + SetStatusLabel("Status: Failed - no video, check CR login") + Me.Text = "Status: Failed - no video, check CR login" + Debug.WriteLine("Status: Failed - no video, check CR login") + + Exit Sub + End If + + 'Try + Dim StreamsUrlBuilder() As String = ObjectJson.Split(New String() {"/content/v2/music/"}, System.StringSplitOptions.RemoveEmptyEntries) + Dim StreamsUrlBuilder2() As String = StreamsUrlBuilder(1).Split(New String() {"/streams"}, System.StringSplitOptions.RemoveEmptyEntries) + + + StreamsUrl = "https://www.crunchyroll.com/content/v2/music/" + StreamsUrlBuilder2(0) + "/streams?locale=" + locale + + + GetCRVideoProxy(StreamsUrl, Auth2, url, RT_Count) +#End Region + ElseIf CBool(InStr(url, "crunchyroll.com")) = True And CBool(InStr(url, "concert/")) = True And CBool(CrBetaBasic = Nothing) = False Then + + Dim ObjectsUrl As String = Nothing + + Dim ObjectsURLBuilder3() As String = url.Split(New String() {"concert/"}, System.StringSplitOptions.RemoveEmptyEntries) + Dim ObjectsURLBuilder4() As String = ObjectsURLBuilder3(1).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries) + + + + ObjectsUrl = "https://www.crunchyroll.com/content/v2/music/concerts/" + ObjectsURLBuilder4(0) + "?locale=" + locale + + Debug.WriteLine("ObjectsUrl: " + ObjectsUrl) + + + Dim StreamsUrl As String = Nothing + Dim ObjectJson As String + + Try + + ObjectJson = CurlAuthNew(ObjectsUrl, Loc_CR_Cookies, Auth2) + + Catch ex As Exception + + If CBool(InStr(ex.ToString, "Error - Getting")) Then + MsgBox("Error invalid CR respone") + Exit Sub + Else + MsgBox("Error processing data") + Exit Sub + End If + End Try + + + If CBool(InStr(ObjectJson, "/content/v2/music/")) = False Then + + SetStatusLabel("Status: Failed - no video, check CR login") + Me.Text = "Status: Failed - no video, check CR login" + Debug.WriteLine("Status: Failed - no video, check CR login") + + Exit Sub + End If + + 'Try + Dim StreamsUrlBuilder() As String = ObjectJson.Split(New String() {"/content/v2/music/"}, System.StringSplitOptions.RemoveEmptyEntries) + Dim StreamsUrlBuilder2() As String = StreamsUrlBuilder(1).Split(New String() {"/streams"}, System.StringSplitOptions.RemoveEmptyEntries) + + + StreamsUrl = "https://www.crunchyroll.com/content/v2/music/" + StreamsUrlBuilder2(0) + "/streams?locale=" + locale + + + GetCRVideoProxy(StreamsUrl, Auth2, url, RT_Count) Else Browser.WebView2.CoreWebView2.Navigate(url) End If diff --git a/Crunchyroll Downloader/My Project/AssemblyInfo.vb b/Crunchyroll Downloader/My Project/AssemblyInfo.vb index 9618805..7b4ac42 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: ' - - + +