minor fixes

fix hybrid mode 'keep cache' (keyfile false positive) #946
removed Browser dependency (browser no longer open in the background)
This commit is contained in:
hama3254 2024-05-02 17:43:12 +02:00
parent 3d0467ed8a
commit afd5f06a17
6 changed files with 24 additions and 20 deletions

Binary file not shown.

View File

@ -364,8 +364,8 @@ Partial Class Anime_Add
Me.Controls.Add(Me.btn_dl)
Me.Controls.Add(Me.Btn_min)
Me.Controls.Add(Me.Btn_Close)
Me.Controls.Add(Me.groupBox1)
Me.Controls.Add(Me.groupBox2)
Me.Controls.Add(Me.groupBox1)
Me.Font = New System.Drawing.Font("Arial", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Name = "Anime_Add"
Me.Padding = New System.Windows.Forms.Padding(10, 60, 20, 20)

View File

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

View File

@ -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)

View File

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

View File

@ -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
@ -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)