fix hbride mode gzip, fix funimation issues

fix hbride mode gzip, fix funimation issues
This commit is contained in:
hama3254 2021-10-14 19:05:48 +02:00
parent 596c6e4438
commit 11d7799739
17 changed files with 445 additions and 391 deletions

1
.gitignore vendored
View File

@ -13,3 +13,4 @@ Crunchyroll Downloader/bin/x64/Debug/lib/libcef.dll
Crunchyroll Downloader/bin/x64/Debug/ffmpeg.exe
Crunchyroll Downloader/bin/x64/Crunchyroll-Downloader-Chromium/ffmpeg.exe
packages/
Crunchyroll Downloader/bin/x64/Crunchyroll-Downloader-Chromium-release/

Binary file not shown.

View File

@ -998,9 +998,11 @@ Public Class CRD_List_Item
Dim InputURL As String() = InuputStreams(int).Split(New [Char]() {Chr(34)})
Dim InputClient As New WebClient
InputClient.Encoding = Encoding.UTF8
If Main.WebbrowserCookie = Nothing Then
Else
InputClient.Headers.Add(HttpRequestHeader.Cookie, Main.WebbrowserCookie)
End If
Dim SubsFile As String = Pfad2 + GeräteID() + ".txt"
@ -1009,8 +1011,17 @@ Public Class CRD_List_Item
End If
Try
Dim InputData As String = InputClient.DownloadString(InputURL(0))
Dim InputData As String = Nothing
Try
InputData = InputClient.DownloadString(InputURL(0))
Catch ex As Exception
InputClient.Headers.Add(HttpRequestHeader.AcceptEncoding, "*")
InputData = DecompressString(InputClient.DownloadData(InputURL(0)))
End Try
If InputData = Nothing Then
Throw New System.Exception("No Input Data...")
End If
If CBool(InStr(InputData, "RESOLUTION=")) = True And CBool(InStr(InputData, "#EXT-X-BYTERANGE:")) = False Then 'master m3u8 no fragments
@ -1330,6 +1341,7 @@ Public Class CRD_List_Item
Dim iWert As Integer = i
Using client As New WebClient()
client.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), ""))
client.Headers.Add(HttpRequestHeader.AcceptEncoding, "*")
client.DownloadFile(BaseURL + SiteList(i), Pfad_DL + "\" + SiteList(i))
Pause(1)
End Using

View File

@ -92,7 +92,7 @@ Public Class CefSharp_Browser
Private Sub GeckoFX_Load(sender As Object, e As EventArgs) Handles MyBase.Load
AddHandler RequestResource.GetUrl, AddressOf ObserveHttp
WebBrowser1.RequestHandler = New CEFRequestHandler()
Main.waveOutSetVolume(0, 0)
If Me.Width > My.Computer.Screen.Bounds.Width Then
Me.Width = My.Computer.Screen.Bounds.Width
WebBrowser1.Width = Me.Size.Width - 15 ', Me.Size.Height - 69)

View File

@ -414,12 +414,14 @@ Public Class Main
settings.CachePath = ProfileFolder
End If
'--disable-features=PreloadMediaEngagementData, MediaEngagementBypassAutoplayPolicies
settings.CefCommandLineArgs.Add("disable-features=PreloadMediaEngagementData, MediaEngagementBypassAutoplayPolicies")
settings.CefCommandLineArgs.Add("disable-gpu")
settings.CefCommandLineArgs.Add("disable-gpu-vsync")
settings.CefCommandLineArgs.Add("disable-d3d11")
settings.CefCommandLineArgs.Add("disable-gpu-rasterization")
settings.CefCommandLineArgs("autoplay-policy") = "no-user-gesture-required"
'settings.CefCommandLineArgs("autoplay-policy") = "no-user-gesture-required"
settings.LogFile = Path.Combine(Application.StartupPath, "lib", "browser.log")
'Initialize Cef with the provided settings
Cef.Initialize(settings)
@ -1438,7 +1440,7 @@ Public Class Main
End If
End If
If KodiNaming = True Then
If KodiNaming = True And CR_Anime_Folge_int IsNot Nothing Then
Dim KodiString As String = "[S"
If CR_Anime_Staffel_int = "0" Then
CR_Anime_Staffel_int = "01"
@ -2744,13 +2746,13 @@ Public Class Main
End If
ElseIf CR_NameMethode = 1 Then 'name
If CR_season_number = Nothing Then
CR_FilenName = CR_series_title + " " + CR_series_title + " " + CR_title
CR_FilenName = CR_series_title + " " + CR_title
Else
CR_FilenName = CR_series_title + " " + CR_season_number + " " + CR_title
End If
ElseIf CR_NameMethode = 2 Then ' nummer - name
If CR_season_number = Nothing Then
CR_FilenName = CR_series_title + " " + CR_series_title + " " + CR_episode + " " + CR_title
CR_FilenName = CR_series_title + " " + CR_episode + " " + CR_title
Else
CR_FilenName = CR_series_title + " " + CR_season_number + " " + CR_episode + " " + CR_title
End If
@ -2763,6 +2765,7 @@ Public Class Main
End If
Try
If KodiNaming = True Then
Dim KodiString As String = "[S"
@ -2772,14 +2775,20 @@ Public Class Main
CR_Anime_Staffel_int = "0" + CR_Anime_Staffel_int
End If
Dim CR_episode_nr As String = CR_episode_int
If CR_episode_nr.Length = 1 Then
CR_episode_nr = "0" + CR_episode_nr
ElseIf CR_episode_nr.Length = 0 Then
Throw New System.Exception("no episode")
End If
KodiString = KodiString + CR_Anime_Staffel_int + " E" + CR_episode_nr
KodiString = KodiString + "] "
CR_FilenName = KodiString + CR_FilenName
End If
Catch ex As Exception
End Try
Debug.WriteLine(CR_FilenName)
#End Region
@ -4500,7 +4509,7 @@ Public Class Main
End Try
End If
Debug.WriteLine("SeasonJson: " + SeasonJson)
Dim ser As JObject = JObject.Parse(SeasonJson)
Dim data As List(Of JToken) = ser.Children().ToList
@ -4542,6 +4551,7 @@ Public Class Main
Next
Debug.WriteLine("SeasonJson: ")
Anime_Add.groupBox2.Visible = True
Anime_Add.PictureBox1.Enabled = True
@ -4559,7 +4569,7 @@ Public Class Main
WebbrowserURL = "https://funimation.com/js"
Debug.WriteLine("Count: " + FunimtaionSeasonList.Count.ToString)
For i As Integer = 1 To FunimtaionSeasonList.Count - 1
For i As Integer = 0 To FunimtaionSeasonList.Count - 1
Debug.WriteLine(FunimtaionSeasonList.Item(i).Title)
Anime_Add.ComboBox1.Items.Add(FunimtaionSeasonList.Item(i).Title)
Next
@ -4802,6 +4812,13 @@ Public Class Main
LoadedUrls.Clear()
Dim Evaluator = New Thread(Sub() Me.GetFunimationJS_Video(v1JsonURL, v1JsonData))
Evaluator.Start()
'Me.Invoke(New Action(Function() As Object
' GetFunimationJS_Video(v1JsonURL, v1JsonData)
' Return Nothing
' End Function))
End Sub
Public Sub GetFunimationJS_Video(ByVal v1JsonUrl As String, ByVal v1JsonData As String) ', ByVal WebsiteURL As String
Debug.WriteLine(v1JsonUrl)
@ -5111,31 +5128,45 @@ Public Class Main
End Function))
Dim showexperience As String = Nothing
'Try
' 'Throw New System.Exception("Test")
' Using client As New WebClient()
' client.Encoding = System.Text.Encoding.UTF8
' client.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), ""))
' showexperience = client.DownloadString("https://www.funimation.com/api/showexperience/" + ExperienceID + "/?pinst_id=fzQc9p9f")
' End Using
'Catch ex As Exception
Dim PlayerClient As New WebClient
PlayerClient.Encoding = Encoding.UTF8
'MsgBox(WebbrowserCookie)
If WebbrowserCookie = Nothing Then
Else
PlayerClient.Headers.Add(HttpRequestHeader.Cookie, WebbrowserCookie)
End If
If SystemWebBrowserCookie = Nothing Then
Else
PlayerClient.Headers.Add(HttpRequestHeader.Cookie, SystemWebBrowserCookie)
End If
' Dim PlayerPage As String = SubsClient.DownloadString("https://www.funimation.com/player/" + ExperienceID + "/?bdub=0&qid=")
Try
'Throw New System.Exception("Test")
showexperience = PlayerClient.DownloadString("https://www.funimation.com/api/showexperience/" + ExperienceID + "/?pinst_id=fzQc9p9f")
Catch ex As Exception
Debug.WriteLine("showexperience data via browser")
Me.Invoke(New Action(Function() As Object
Me.Text = "Status: Resolution not found!"
Me.Invalidate()
ErrorBrowserString = "Funimation_showexperience"
ErrorBrowserUrl = "https://www.funimation.com/api/showexperience/" + ExperienceID + "/?pinst_id=fzQc9p9f"
Debug.WriteLine("2-showexperience data via browser")
ErrorBrowser.ShowDialog()
Debug.WriteLine("3-showexperience data via browser")
showexperience = ErrorBrowserBackString
Return Nothing
End Function))
'Me.Invoke(New Action(Function() As Object
showexperience = PlayerClient.DownloadString("https://www.funimation.com/api/showexperience/" + ExperienceID + "/?pinst_id=fzQc9p9f")
'Debug.WriteLine("Thread Name: " + Thread.CurrentThread.Name)
'ErrorBrowserString = "Funimation_showexperience"
'ErrorBrowserUrl = "https://www.funimation.com/api/showexperience/" + ExperienceID + "/?pinst_id=fzQc9p9f"
'Debug.WriteLine("2-showexperience data via browser")
'ErrorBrowser.ShowDialog()
'Debug.WriteLine("3-showexperience data via browser")
'showexperience = ErrorBrowserBackString
End Try
'End Try
@ -5149,7 +5180,9 @@ Public Class Main
'Dim str0 As String = client0.DownloadString("")
''MsgBox("https://www.funimation.com/api/showexperience/" + Player_ID2(0) + "/?pinst_id=fzQc9p9f")
''MsgBox(str0)
'End Sub
'Sub weier()
Dim Funimation_m3u8() As String = showexperience.Split(New String() {My.Resources.Funimation_src_string}, System.StringSplitOptions.RemoveEmptyEntries)
Dim Funimation_m3u8_Main As String = Nothing
For i As Integer = 0 To Funimation_m3u8.Count - 1
@ -5374,7 +5407,7 @@ Public Class Main
'Dim thumbnail2 As String() = thumbnail(1).Split(New String() {"https://"}, System.StringSplitOptions.RemoveEmptyEntries) '(New [Char]() {"-"})
'Dim thumbnail3 As String() = thumbnail2(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) '(New [Char]() {"-"})
Dim thumbnail4 As String = ""
For Each item As JProperty In data
For Each item As JProperty In Data
item.CreateReader()
Select Case item.Name
Case "images" 'each record is inside the entries array
@ -5418,26 +5451,21 @@ Public Class Main
Dim PlayerPage As String = Nothing
Try
'Throw New System.Exception("Test")
Using client As New WebClient()
client.Encoding = System.Text.Encoding.UTF8
client.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), ""))
PlayerPage = SubsClient.DownloadString("https://www.funimation.com/player/" + ExperienceID + "/?bdub=0&qid=")
End Using
Catch ex As Exception
Debug.WriteLine("error- getting funimation PlayerPage")
Me.Invoke(New Action(Function() As Object
'Me.Text = "Status: Resolution not found!"
'Me.Invalidate()
ErrorBrowserString = "Funimation_showexperience"
ErrorBrowserUrl = "https://www.funimation.com/player/" + ExperienceID + "/?bdub=0&qid="
Debug.WriteLine("error-2-getting funimation PlayerPage")
ErrorBrowser.ShowDialog()
Debug.WriteLine("error-3-getting funimation PlayerPage")
PlayerPage = ErrorBrowserBackString
Return Nothing
End Function))
PlayerPage = SubsClient.DownloadString("https://www.funimation.com/player/" + ExperienceID + "/?bdub=0&qid=")
'Me.Invoke(New Action(Function() As Object
' ErrorBrowserString = "Funimation_showexperience"
' ErrorBrowserUrl = "https://www.funimation.com/player/" + ExperienceID + "/?bdub=0&qid="
' Debug.WriteLine("error-2-getting funimation PlayerPage")
' ErrorBrowser.ShowDialog()
' Debug.WriteLine("error-3-getting funimation PlayerPage")
' PlayerPage = ErrorBrowserBackString
' Return Nothing
' End Function))
End Try
@ -5834,11 +5862,15 @@ Public Class Main
ElseIf CBool(InStr(Address, "/data/v2/shows/")) Then
If FunimationJsonBrowser = "SeasonJson" Then
Me.Invoke(New Action(Function() As Object
'My.Computer.Clipboard.SetText(localHTML)
FunimationSeasonAPIUrl = Address
GetFunimationJS_Seasons(Nothing, localHTML.Replace("<body>", "").Replace("</body>", "").Replace("<pre>", "").Replace("</pre>", "").Replace("</html>", "").Replace("<html><head></head><pre style=" + Chr(34) + "word-wrap: break-word; white-space: pre-wrap;" + Chr(34) + ">", "")) '
FunimationJsonBrowser = Nothing
WebbrowserURL = "https://funimation.com/js"
Return Nothing
End Function))
End If
Exit Sub
End If
@ -5978,7 +6010,7 @@ Public Class Main
t.Start()
Exit Sub
Else
'WebbrowserCookie = Cookie
WebbrowserCookie = Cookie
WebbrowserURL = Address
Text = "Crunchyroll Downloader"
For i As Integer = 10 To 0 Step -1
@ -6096,7 +6128,17 @@ Public Class Main
If CBool(InStr(requesturl, "/data/v2/shows/")) Then
b = True
'MsgBox("The new Funimation Overview is not supportet yet!", MsgBoxStyle.Information)
Me.Invoke(New Action(Function() As Object
'My.Computer.Clipboard.SetText(localHTML)
GetFunimationJS_Seasons(requesturl)
WebbrowserURL = "https://funimation.com/js"
Return Nothing
End Function))
LoadedUrls.Clear()
Exit Sub
@ -6158,7 +6200,25 @@ Public Class Main
'Else
If CBool(InStr(requesturl, "https://title-api.prd.funimationsvc.com/v1/show")) And CBool(InStr(requesturl, "/episodes/")) Then
b = True
Try
Dim Collector As New TaskCookieVisitor
Dim CM As ICookieManager = CefSharp_Browser.WebBrowser1.GetCookieManager
CM.VisitAllCookies(Collector)
Dim list As List(Of Global.CefSharp.Cookie) = Collector.Task.Result()
Dim Cookie As String = ""
For ii As Integer = 0 To list.Count - 1
If CBool(InStr(list.Item(ii).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(ii).Name + "=" + list.Item(ii).Value + ";"
End If
Next
WebbrowserCookie = Cookie
Catch ex As Exception
End Try
GetFunimationJS_VideoProxy(requesturl)
Debug.WriteLine("processing :" + requesturl)
LoadedUrls.Clear()

View File

@ -33,5 +33,5 @@ Imports System.Runtime.InteropServices
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("3.8")>
<Assembly: AssemblyFileVersion("3.8.0.2")>
<Assembly: AssemblyFileVersion("3.8.0.3")>
<Assembly: NeutralResourcesLanguage("en")>

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib" />
<dependentAssembly>
<assemblyIdentity name="CefSharp" publicKeyToken="40c4b6fc221f4138" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-93.1.140.0" newVersion="93.1.140.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CefSharp.Core" publicKeyToken="40c4b6fc221f4138" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-93.1.140.0" newVersion="93.1.140.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

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