fix funimation http 400

fix funimation http 400
This commit is contained in:
hama3254 2021-11-07 11:44:52 +01:00
parent e86e864343
commit 6aa8142b00
14 changed files with 46 additions and 9 deletions

Binary file not shown.

View File

@ -248,6 +248,7 @@ Public Class CefSharp_Browser
End If End If
' '
If CBool(InStr(e.RequestUrl, "?deviceType=web")) Then If CBool(InStr(e.RequestUrl, "?deviceType=web")) Then
'Debug.WriteLine(e.RequestUrl)
Dim parms As String() = e.RequestUrl.Split(New String() {"?deviceType="}, System.StringSplitOptions.RemoveEmptyEntries) Dim parms As String() = e.RequestUrl.Split(New String() {"?deviceType="}, System.StringSplitOptions.RemoveEmptyEntries)
Main.FunimationDeviceRegion = "?deviceType=" + parms(1) Main.FunimationDeviceRegion = "?deviceType=" + parms(1)

View File

@ -535,7 +535,7 @@
<value>181, 22</value> <value>181, 22</value>
</data> </data>
<data name="TestDownloadToolStripMenuItem.Text" xml:space="preserve"> <data name="TestDownloadToolStripMenuItem.Text" xml:space="preserve">
<value>Check Urls</value> <value>Check Token</value>
</data> </data>
<data name="ContextMenuStrip1.Size" type="System.Drawing.Size, System.Drawing"> <data name="ContextMenuStrip1.Size" type="System.Drawing.Size, System.Drawing">
<value>182, 92</value> <value>182, 92</value>

View File

@ -5190,7 +5190,7 @@ Public Class Main
PlayerClient.Encoding = Encoding.UTF8 PlayerClient.Encoding = Encoding.UTF8
PlayerClient.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), "")) PlayerClient.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), ""))
PlayerClient.Headers.Add(HttpRequestHeader.Accept, "application/json, text/plain, */*") PlayerClient.Headers.Add(HttpRequestHeader.Accept, "application/json, text/plain, */*")
PlayerClient.Headers.Add("origin: https://www.funimation.com") PlayerClient.Headers.Add("origin: https://www.funimation.com/")
PlayerClient.Headers.Add(HttpRequestHeader.Referer, "https://www.funimation.com/") PlayerClient.Headers.Add(HttpRequestHeader.Referer, "https://www.funimation.com/")
Dim BaseUrl As String = "https://playback.prd.funimationsvc.com/v1/play/" Dim BaseUrl As String = "https://playback.prd.funimationsvc.com/v1/play/"
@ -5202,7 +5202,12 @@ Public Class Main
'FunimationToken 'FunimationToken
'MsgBox(WebbrowserCookie) 'MsgBox(WebbrowserCookie)
'BaseUrl + FunimationEpisodeJson + FunimationDeviceRegion
Debug.WriteLine(PlayerClient.Headers.ToString) Debug.WriteLine(PlayerClient.Headers.ToString)
If FunimationDeviceRegion = Nothing Then
FunimationDeviceRegion = "?deviceType=web"
End If
Debug.WriteLine(BaseUrl + FunimationEpisodeJson + FunimationDeviceRegion)
If WebbrowserCookie = Nothing Then If WebbrowserCookie = Nothing Then
Else Else
PlayerClient.Headers.Add(HttpRequestHeader.Cookie, WebbrowserCookie) PlayerClient.Headers.Add(HttpRequestHeader.Cookie, WebbrowserCookie)
@ -5220,6 +5225,7 @@ Public Class Main
EpisodeJsonString = PlayerClient.DownloadString(BaseUrl + FunimationEpisodeJson + FunimationDeviceRegion) EpisodeJsonString = PlayerClient.DownloadString(BaseUrl + FunimationEpisodeJson + FunimationDeviceRegion)
Catch ex As Exception Catch ex As Exception
Debug.WriteLine(ex.ToString) Debug.WriteLine(ex.ToString)
Pause(2) Pause(2)
Debug.WriteLine("showexperience data via browser") Debug.WriteLine("showexperience data via browser")
@ -7978,15 +7984,45 @@ Public Class Main
End Sub End Sub
Private Sub TestDownloadToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TestDownloadToolStripMenuItem.Click Private Sub TestDownloadToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TestDownloadToolStripMenuItem.Click
'For i2 As Integer = 0 To LoadedUrls.Count - 1
' Debug.WriteLine(LoadedUrls.Item(i2)) Dim Collector As New TaskCookieVisitor
'Next Dim CM As ICookieManager = CefSharp_Browser.WebBrowser1.GetCookieManager
'ErrorBrowserString = "Funimation_showexperience" CM.VisitAllCookies(Collector)
'ErrorBrowserUrl = "beta.crunchyroll.com" Dim Token As String = Nothing
'ErrorBrowser.Show() Dim DeviceRegion As String = Nothing
Dim list As List(Of Global.CefSharp.Cookie) = Collector.Task.Result()
Dim Cookie As String = ""
For i As Integer = 0 To list.Count - 1
If CBool(InStr(list.Item(i).Domain, "funimation.com")) Then 'list.Item(i).Domain = "funimation.com" Then
'MsgBox(list.Item(i).Name + vbNewLine + list.Item(i).Value)
Cookie = Cookie + list.Item(i).Name + "=" + list.Item(i).Value + ";"
End If
If CBool(InStr(list.Item(i).Domain, "funimation.com")) And CBool(InStr(list.Item(i).Name, "src_token")) Then 'list.Item(i).Domain = "funimation.com" Then
'MsgBox(list.Item(i).Name + vbNewLine + list.Item(i).Value)
Token = "Token " + list.Item(i).Value
End If
If CBool(InStr(list.Item(i).Domain, "funimation.com")) And CBool(InStr(list.Item(i).Name, "region")) Then 'list.Item(i).Domain = "funimation.com" Then
'MsgBox(list.Item(i).Name + vbNewLine + list.Item(i).Value)
DeviceRegion = "?deviceType=web&" + list.Item(i).Name + "=" + list.Item(i).Value
End If
Next
' region=US;
If Token = Nothing Then
MsgBox("No Token has been found...", MsgBoxStyle.Exclamation)
Else
FunimationToken = Token
MsgBox("Token found!", MsgBoxStyle.Information)
End If
End Sub End Sub
#End Region #End Region

View File

@ -18,7 +18,7 @@ Public Class Einstellungen
Private Sub Einstellungen_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub Einstellungen_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Label6.Text = "You have: v" + Application.ProductVersion.ToString + " Chromium-U8" Label6.Text = "You have: v" + Application.ProductVersion.ToString + " Chromium-#389"
BackgroundWorker1.RunWorkerAsync() BackgroundWorker1.RunWorkerAsync()