hotfix curl output

hotfix curl output
This commit is contained in:
hama3254 2024-05-23 18:32:31 +02:00
parent ad4d8690cc
commit ca18ed8dbb
3 changed files with 9 additions and 5 deletions

Binary file not shown.

View File

@ -117,10 +117,14 @@ Module GetData
If CurlOutput = Nothing And CurlError = Nothing Then
Throw New System.Exception("Error - Getting" + Sender + vbNewLine + CurlError)
Return Nothing
ElseIf CBool(InStr(CurlOutput, "HTTP Status: 4")) Then
Return CurlOutput
ElseIf CBool(InStr(CurlError, "HTTP Status: 4")) Then
Return CurlError
ElseIf CurlError = Nothing Then
Dim OutputBody() As String = CurlOutput.Split(New String() {"HTTP Status:"}, System.StringSplitOptions.RemoveEmptyEntries)
Return OutputBody(0)
'Return CurlOutput
Dim Output As String = OutputBody(0)
Return Output
Else
Return CurlError
End If
@ -261,7 +265,7 @@ Module GetData
Return Nothing
ElseIf CBool(InStr(CurlOutput, "HTTP Status: 4")) Then
Debug.WriteLine(CurlOutput)
Throw New System.Exception("Error - Getting" + vbNewLine + CurlError)
Throw New System.Exception("Error - Getting" + vbNewLine + CurlOutput)
Return Nothing
Else
Return CurlOutput

View File

@ -3042,7 +3042,7 @@ Public Class Main
ProcessLoading(Url, Auth2, Loc_CR_Cookies, RT_count)
Else
Dim v1Token As String = CurlPost("https://www.crunchyroll.com/auth/v1/token", Loc_CR_Cookies, Auth, Post, "add_main_4494")
'MsgBox(v1Token)
If CBool(InStr(v1Token, "HTTP Status: 401")) = True Then
MsgBox("CR reported :" + vbNewLine + v1Token, MsgBoxStyle.Exclamation, "CR-Error 401")
LoginForm.ShowDialog()
@ -3154,7 +3154,7 @@ Public Class Main
Exit Sub
ElseIf CBool(InStr(ObjectJson, "videos/")) = False Then
MsgBox(ObjectJson)
'MsgBox(ObjectJson)
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")