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

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
fix hybrid mode 'keep cache' (keyfile false positive) #946
removed Browser dependency (browser no longer open in the background)
  • Loading branch information
hama3254 committed May 2, 2024
1 parent 3d0467e commit afd5f06
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 20 deletions.
Binary file modified .vs/Crunchyroll Downloader/v17/.suo
Binary file not shown.
2 changes: 1 addition & 1 deletion Crunchyroll Downloader/Anime_Add.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Crunchyroll Downloader/Anime_Add.vb
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ Public Class Anime_Add
End Try

'Timer3.Enabled = True
btn_dl.Cursor = Cursors.Default
btn_dl.BackgroundImage = My.Resources.main_button_download_default

End Sub

Expand Down Expand Up @@ -458,17 +460,19 @@ Public Class Anime_Add
Dim JsonUrl As String = "https://www.crunchyroll.com/content/v2/cms/seasons/" + guid + "/episodes?preferred_audio_language=" + Main.DubSprache.CR_Value + "&locale=" + Main.locale


Dim Loc_CR_Cookies = " -H " + Chr(34) + Main.CR_Cookies.Replace(Chr(34), "").Replace(" -H ", "") + Chr(34)
Dim Loc_CR_Cookies = "" 'No more cookies " -H " + Chr(34) + Main.CR_Cookies.Replace(Chr(34), "").Replace(" -H ", "") + Chr(34)


Dim EpisodeJson As String = Nothing 'CurlAuth(JsonUrl, Loc_CR_Cookies, Main.CR_MassSeasons.Item(ComboBox1.SelectedIndex).Auth) '

Debug.WriteLine("TEST")

Try

EpisodeJson = CurlAuthNew(JsonUrl, Loc_CR_Cookies, Main.CR_MassSeasons.Item(CB_Season.SelectedIndex).Auth) '

Catch ex As Exception
Debug.WriteLine("TEST Failed" + ex.ToString)
If CBool(InStr(ex.ToString, "Error - Getting")) Then
MsgBox("Error invalid CR respone")
Exit Sub
Expand Down
8 changes: 4 additions & 4 deletions Crunchyroll Downloader/Browser.vb
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ Public Class Browser

Main.BowserWasOpen = True

If Application.OpenForms().OfType(Of Anime_Add).Any = True Then
Anime_Add.btn_dl.Cursor = Cursors.Default
Anime_Add.btn_dl.BackgroundImage = My.Resources.main_button_download_default
End If
'If Application.OpenForms().OfType(Of Anime_Add).Any = True Then
' Anime_Add.btn_dl.Cursor = Cursors.Default
' Anime_Add.btn_dl.BackgroundImage = My.Resources.main_button_download_default
'End If

If Main.Startseite IsNot My.Settings.Startseite Then
Main.LoadBrowser(Main.Startseite, 1)
Expand Down
12 changes: 6 additions & 6 deletions Crunchyroll Downloader/CRD_List_Item.vb
Original file line number Diff line number Diff line change
Expand Up @@ -991,12 +991,12 @@ Public Class CRD_List_Item
KeyLine = KeyFileUri(0) + "URI=" + Chr(34) + KeyFileCache + Chr(34)
End If

If KeepCacheFiles = True Then
'Dim Bytes() As Byte = File.ReadAllBytes(Application.StartupPath + "\" + KeyFile)
'File.WriteAllBytes(Folder + "\" + KeyFile, Bytes)
Dim Evaluator2 = New Thread(Sub() Me.TS_DownloadAsync(KeyFileUri3, Folder + "\" + KeyFile))
Evaluator2.Start()
End If
'If KeepCacheFiles = True Then
' 'Dim Bytes() As Byte = File.ReadAllBytes(Application.StartupPath + "\" + KeyFile)
' 'File.WriteAllBytes(Folder + "\" + KeyFile, Bytes)
' Dim Evaluator2 = New Thread(Sub() Me.TS_DownloadAsync(KeyFileUri3, Folder + "\" + KeyFile))
' Evaluator2.Start()
'End If
End If
m3u8FileContent = m3u8FileContent + KeyLine + vbLf

Expand Down
16 changes: 8 additions & 8 deletions Crunchyroll Downloader/Main.vb
Original file line number Diff line number Diff line change
Expand Up @@ -2122,13 +2122,13 @@ Public Class Main

Private Sub Btn_add_Click(sender As Object, e As EventArgs) Handles Btn_add.Click

If File.Exists("cookies.txt") = False Then
If Application.OpenForms().OfType(Of Browser).Any = True Then
Else
UserBowser = False
Browser.Show()
End If
End If
'If File.Exists("cookies.txt") = False Then
' If Application.OpenForms().OfType(Of Browser).Any = True Then
' Else
' UserBowser = False
' Browser.Show()
' End If
'End If

If Anime_Add.WindowState = System.Windows.Forms.FormWindowState.Minimized Then
Anime_Add.WindowState = System.Windows.Forms.FormWindowState.Normal
Expand Down Expand Up @@ -2897,7 +2897,7 @@ Public Class Main
LoadingUrl = Url
LoadedUrls.Clear()
Dim NoBrowser As Boolean = False

WebbrowserURL = Url

'CR_v1Token = "Get"
'Browser.WebView2.Source = New Uri(Url)
Expand Down

0 comments on commit afd5f06

Please sign in to comment.