fix display issue #773
fix curl error detection #777
This commit is contained in:
hama3254 2023-07-11 18:53:50 +02:00
parent 33be0da197
commit a81fe6a394
8 changed files with 90 additions and 47 deletions

Binary file not shown.

View File

@ -147,7 +147,9 @@ Public Class Anime_Add
ComboBox2.Items.AddRange(Result.ToArray)
ComboBox2.SelectedItem = SubFolder_Value
Catch ex As Exception
' MsgBox(ex.ToString)
'SubFolder_Nothing
ComboBox2.SelectedItem = SubFolder_Nothing
End Try
'Timer3.Enabled = True

View File

@ -18,25 +18,28 @@ Public Class Browser
Private Sub WebView2_CoreWebView2InitializationCompleted(sender As Object, e As CoreWebView2InitializationCompletedEventArgs) Handles WebView2.CoreWebView2InitializationCompleted
WebView2.CoreWebView2.AddWebResourceRequestedFilter("https://www.crunchyroll.com/*", CoreWebView2WebResourceContext.All)
WebView2.CoreWebView2.AddWebResourceRequestedFilter("https://www.funimation.com/*", CoreWebView2WebResourceContext.All)
Try
WebView2.CoreWebView2.AddWebResourceRequestedFilter("https://www.crunchyroll.com/*", CoreWebView2WebResourceContext.All)
WebView2.CoreWebView2.AddWebResourceRequestedFilter("https://www.funimation.com/*", CoreWebView2WebResourceContext.All)
'WebView2.CoreWebView2.AddWebResourceRequestedFilter("*", CoreWebView2WebResourceContext.All)
AddHandler WebView2.CoreWebView2.WebResourceResponseReceived, AddressOf ObserveResponse
AddHandler WebView2.CoreWebView2.WebResourceRequested, AddressOf ObserveHttp
'WebView2.CoreWebView2.Settings.UserAgent = My.Settings.User_Agend.Replace(Chr(34), "").Replace("User-Agent: ", "")
'
'WebView2.CoreWebView2.Settings.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Trident/7.0; rv:11.0) like Gecko"
My.Settings.User_Agend = Chr(34) + "User-Agent: " + WebView2.CoreWebView2.Settings.UserAgent + Chr(34)
'MsgBox(My.Settings.User_Agend)
'WebView2.CoreWebView2.AddWebResourceRequestedFilter("*", CoreWebView2WebResourceContext.All)
AddHandler WebView2.CoreWebView2.WebResourceResponseReceived, AddressOf ObserveResponse
AddHandler WebView2.CoreWebView2.WebResourceRequested, AddressOf ObserveHttp
'WebView2.CoreWebView2.Settings.UserAgent = My.Settings.User_Agend.Replace(Chr(34), "").Replace("User-Agent: ", "")
'
'WebView2.CoreWebView2.Settings.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Trident/7.0; rv:11.0) like Gecko"
My.Settings.User_Agend = Chr(34) + "User-Agent: " + WebView2.CoreWebView2.Settings.UserAgent + Chr(34)
'MsgBox(My.Settings.User_Agend)
If WebView2.CoreWebView2.Source = "about:blank" Or WebView2.CoreWebView2.Source = Nothing Then
'TextBox1.Text = Main.Startseite
WebView2.CoreWebView2.Navigate(Main.Startseite)
If WebView2.CoreWebView2.Source = "about:blank" Or WebView2.CoreWebView2.Source = Nothing Then
'TextBox1.Text = Main.Startseite
WebView2.CoreWebView2.Navigate(Main.Startseite)
End If
End If
Catch ex As Exception
End Try
End Sub
@ -79,6 +82,11 @@ Public Class Browser
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)
Main.Startseite = My.Settings.Startseite
End If
End If
End Sub

View File

@ -156,23 +156,29 @@ Public Class CRD_List_Item
Return StatusRunning
End Function
Public Function GetIsStatusFinished() As Boolean
If Canceld = True Then
If Canceld = True Or Finished = True Then
Return True
ElseIf HybridRunning = True Then
Return False
Else
Try
If proc.HasExited = True Then
Return True
Else
Return False
End If
Catch ex As Exception
Return False
End Try
Return False
End If
'If Canceld = True Then
' Return True
'ElseIf HybridRunning = True Then
' Return False
'Else
' Try
' If proc.HasExited = True Then
' Return True
' Else
' Return False
' End If
' Catch ex As Exception
' Return False
' End Try
'End If
End Function
Public Function GetThumbnailSource() As String
Try
@ -1381,6 +1387,8 @@ Public Class CRD_List_Item
If CBool(InStr(e.Data, "Duration: N/A, bitrate: N/A")) Then
ElseIf Finished = True Then
ElseIf CBool(InStr(e.Data, "Duration: ")) Then
Dim ZeitGesamt As String() = e.Data.Split(New String() {"Duration: "}, System.StringSplitOptions.RemoveEmptyEntries)
Dim ZeitGesamt2 As String() = ZeitGesamt(1).Split(New [Char]() {System.Convert.ToChar(".")})
@ -1440,6 +1448,8 @@ Public Class CRD_List_Item
ElseIf CBool(InStr(e.Data, "muxing overhead:")) Then
Finished = True
Me.Invoke(New Action(Function() As Object
ProgressBar1.Value = ProgressBar1.Maximum
Dim Done As String() = Label_percent.Text.Split(New String() {"MB"}, System.StringSplitOptions.RemoveEmptyEntries)
Label_percent.Text = "Finished - " + Done(0) + "MB"
Return Nothing

View File

@ -52,11 +52,11 @@ Module GetData
Loop Until Proc.HasExited Or Microsoft.VisualBasic.DateAndTime.Timer < finish
If CBool(InStr(CurlError, "curl")) Then
If CBool(InStr(CurlError, "curl:")) Then
Debug.WriteLine(CurlError)
Throw New System.Exception("Error - Getting" + vbNewLine + CurlError)
Return Nothing
ElseIf CBool(InStr(CurlOutput, "curl")) Then
ElseIf CBool(InStr(CurlOutput, "curl:")) Then
Debug.WriteLine(CurlOutput)
Throw New System.Exception("Error - Getting" + vbNewLine + CurlError)
Return Nothing
@ -115,11 +115,11 @@ Module GetData
Loop Until Proc.HasExited Or Microsoft.VisualBasic.DateAndTime.Timer < finish
If CBool(InStr(CurlError, "curl")) Then
If CBool(InStr(CurlError, "curl:")) Then
Debug.WriteLine(CurlError)
Throw New System.Exception("Error - Getting" + vbNewLine + CurlError)
Return Nothing
ElseIf CBool(InStr(CurlOutput, "curl")) Then
ElseIf CBool(InStr(CurlOutput, "curl:")) Then
Debug.WriteLine(CurlOutput)
Throw New System.Exception("Error - Getting" + vbNewLine + CurlError)
Return Nothing
@ -185,11 +185,11 @@ Module GetData
If CBool(InStr(CurlError, "curl")) Then
If CBool(InStr(CurlError, "curl:")) Then
Debug.WriteLine(CurlError)
Throw New System.Exception("Error - Getting" + vbNewLine + CurlError)
Return Nothing
ElseIf CBool(InStr(CurlOutput, "curl")) Then
ElseIf CBool(InStr(CurlOutput, "curl:")) Then
Debug.WriteLine(CurlOutput)
Throw New System.Exception("Error - Getting" + vbNewLine + CurlError)
Return Nothing

View File

@ -1147,12 +1147,15 @@ Public Class Main
VideoJson = CurlAuthNew(Streams, Loc_CR_Cookies, Loc_AuthToken)
Debug.WriteLine("VideoJson: " + VideoJson)
Debug.WriteLine("VideoStreams: " + Streams)
Dim CR_HardSubLang As String = SubSprache.CR_Value
VideoJson = CleanJSON(VideoJson)
'MsgBox(VideoJson)
#End Region
#Region "Check for dub override"
@ -1857,7 +1860,6 @@ Public Class Main
Dim SubText As String = ""
SubText = Curl(SoftSubsList(i2).Url.Replace(" -i ", "").Replace(Chr(34), ""))
If My.Settings.SubtitleMod1 = True Then
SubText = AddScaledBorderAndShadow(SubText)
End If
@ -2010,16 +2012,37 @@ Public Class Main
ElseIf CBool(InStr(ex.ToString, Chr(34) + "UserAbort" + Chr(34))) Then
MsgBox(ex.ToString, MsgBoxStyle.Information)
ElseIf CBool(InStr(ex.ToString, "Error - Getting")) Then
If RT_count = 0 Then
If File.Exists("cookies.txt") = True Then
MsgBox("Request refused, try a new cookies.txt", MsgBoxStyle.Exclamation)
End If
Navigate(WebsiteURL)
Pause(5)
LoadBrowser(WebsiteURL, 1)
Exit Sub
End If
MsgBox(ex.ToString)
'If RT_count = 0 Then
' If File.Exists("cookies.txt") = True Then
' MsgBox("Request refused, try a new cookies.txt", MsgBoxStyle.Exclamation)
' Exit Sub
' End If
' Me.Invoke(New Action(Function() As Object
' Anime_Add.StatusLabel.Text = "Browser reset..."
' Me.Text = "Browser reset..."
' ResoBackString = Nothing
' Me.Invalidate()
' Return Nothing
' End Function))
' If Application.OpenForms().OfType(Of Browser).Any = True Then
' Browser.Close()
' Startseite = WebsiteURL
' Pause(5)
' UserBowser = False
' Browser.Show()
' 'Anime_Add.btn_dl.Cursor = Cursors.Default
' 'Anime_Add.btn_dl.BackgroundImage = My.Resources.main_button_download_default
' End If
' 'Navigate(WebsiteURL)
' 'Pause(5)
' 'LoadBrowser(WebsiteURL, 1)
' Exit Sub
'End If
' MsgBox(ex.ToString)
' b = False
' Navigate(WebsiteURL)
Else

View File

@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("3.15.4")>
<Assembly: AssemblyFileVersion("3.15.4")>
<Assembly: AssemblyVersion("3.15.5.4")>
<Assembly: AssemblyFileVersion("3.15.5.4")>
<Assembly: NeutralResourcesLanguage("en")>

View File

@ -39,7 +39,7 @@ Public Class Einstellungen
CB_Mod1.Checked = My.Settings.SubtitleMod1
CB_vtt.Checked = My.Settings.vttStyleRemove
CB_vttStyle.Checked = My.Settings.vttStyleRemove
TempTB.Text = Main.TempFolder
LeadingZeroDD.SelectedIndex = Main.LeadingZero