Skip to content
This repository has been archived by the owner on Jul 13, 2024. It is now read-only.

Commit

Permalink
fix locale url parameter
Browse files Browse the repository at this point in the history
fix locale url parameter #944
  • Loading branch information
hama3254 committed Apr 30, 2024
1 parent a8aeceb commit 3d0467e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 79 deletions.
Binary file modified .vs/Crunchyroll Downloader/v17/.suo
Binary file not shown.
4 changes: 2 additions & 2 deletions Crunchyroll Downloader/CRD_List_Item.vb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Public Class CRD_List_Item

Dim FailedSegments As New List(Of FailedSegemtsWithURL)
Dim LogText As New List(Of String)
Dim GlobalLogfile As String
'Dim GlobalLogfile As String

Private Event UpdateUI(ByVal Percent As Integer, ByVal di As DirectoryInfo, ByVal Idle As Integer)

Expand Down Expand Up @@ -485,7 +485,7 @@ Public Class CRD_List_Item
HistoryDL_Pfad = DL_Pfad
HistoryFilename = Filename

GlobalLogfile = DL_Pfad.Replace(".mkv", ".txt").Replace(Chr(34), "")
'GlobalLogfile = DL_Pfad.Replace(".mkv", ".txt").Replace(Chr(34), "")

'Debug.WriteLine(GlobalLogfile)

Expand Down
99 changes: 22 additions & 77 deletions Crunchyroll Downloader/Main.vb
Original file line number Diff line number Diff line change
Expand Up @@ -2908,91 +2908,36 @@ Public Class Main



#Region "Get Cookies"
#Region "Get local"

'CR_Cookies = "Cookie: "
''MsgBox("Cookies")
'If File.Exists("cookies.txt") = True Then
' CR_Cookies = GetCookiesFromFile("crunchyroll.com")
' NoBrowser = True
' CrBetaBasic = "Basic bm9haWhkZXZtXzZpeWcwYThsMHE6"
' 'MsgBox(True.ToString)
'Else
' Browser.GetCookies(Url)

' Debug.WriteLine(CookieList.Count.ToString)
' If CookieList.Count = 0 Then
' Browser.WebView2.CoreWebView2.Navigate(Url)
' SetStatusLabel("Status: loading in browser...")
' Me.Text = "Status: loading in browser..."
' Exit Sub
' End If



' For i As Integer = 0 To CookieList.Count - 1

' If CBool(InStr(CookieList.Item(i).Domain, ".crunchyroll.com")) And CBool(InStr(CookieList.Item(i).Name, "_evidon_suppress")) = False Then
' CR_Cookies = CR_Cookies + CookieList.Item(i).Name + "=" + CookieList.Item(i).Value + ";"
' End If

' Next

'End If

''MsgBox(Main.CR_Cookies)

'Dim DeviceRegion As String = Nothing

'If CBool(InStr(Url, "/series")) Then
' Dim locale1() As String = Url.Split(New String() {"crunchyroll.com/"}, System.StringSplitOptions.RemoveEmptyEntries)
' Dim locale2() As String = locale1(1).Split(New String() {"/series"}, System.StringSplitOptions.RemoveEmptyEntries)
' locale = Convert_locale(locale2(0))
' If locale = "en-US" Then
' Url_locale = ""
' Else
' Url_locale = locale2(0)
' End If


'ElseIf CBool(InStr(Url, "/watch")) Then
' Dim locale1() As String = Url.Split(New String() {"crunchyroll.com/"}, System.StringSplitOptions.RemoveEmptyEntries)
' Dim locale2() As String = locale1(1).Split(New String() {"/watch"}, System.StringSplitOptions.RemoveEmptyEntries)
' 'MsgBox(locale2(0))

' locale = Convert_locale(locale2(0))
' 'End If
' If locale = "en-US" Then
' Url_locale = ""
' Else
' Url_locale = locale2(0)
' End If

' 'If CBool(InStr(Url, "musicvideo/")) Then
' ' SetStatusLabel("Status: musicvideo detected - partial support only")

' ' 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

' ' End If
If CBool(InStr(Url, "/series")) Then
Dim locale1() As String = Url.Split(New String() {"crunchyroll.com/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim locale2() As String = locale1(1).Split(New String() {"/series"}, System.StringSplitOptions.RemoveEmptyEntries)
locale = Convert_locale(locale2(0))
If locale = "en-US" Then
Url_locale = ""
Else
Url_locale = locale2(0)
End If

ElseIf CBool(InStr(Url, "/watch")) Then
Dim locale1() As String = Url.Split(New String() {"crunchyroll.com/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim locale2() As String = locale1(1).Split(New String() {"/watch"}, System.StringSplitOptions.RemoveEmptyEntries)
'MsgBox(locale2(0))

'End If
locale = Convert_locale(locale2(0))
'End If
If locale = "en-US" Then
Url_locale = ""
Else
Url_locale = locale2(0)
End If

''Debug.WriteLine("###" + CR_Cookies + "###")

'Dim Loc_CR_Cookies = " -H " + Chr(34) + CR_Cookies + Chr(34)
End If


''CR_v1Token = "Get"
''Browser.WebView2.Source = New Uri(Url)
''Exit Sub

#End Region

Expand Down

0 comments on commit 3d0467e

Please sign in to comment.