switch to the new api (switch endpoiunt)

switch to the new api with every abomination i could think of
#918
This commit is contained in:
hama3254 2024-04-04 19:52:43 +02:00
parent 04bb552ec6
commit 04e9730ad1
8 changed files with 239 additions and 431 deletions

Binary file not shown.

View File

@ -723,10 +723,10 @@ Public Class Anime_Add
End Sub
Private Sub SubTitlesOnlyCB_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DownloadScope.SelectedIndexChanged
DownloadScope.SelectedIndex = DownloadScopeEnum.SubsOnly
'Main.DownloadScope = DownloadScope.SelectedIndex
'My.Settings.DownloadScope = Main.DownloadScope
'My.Settings.Save()
'DownloadScope.SelectedIndex = DownloadScopeEnum.OldDefault
Main.DownloadScope = DownloadScope.SelectedIndex
My.Settings.DownloadScope = Main.DownloadScope
My.Settings.Save()
End Sub

View File

@ -21,7 +21,7 @@ Public Class Browser
Try
WebView2.CoreWebView2.AddWebResourceRequestedFilter("https://www.crunchyroll.com/*", CoreWebView2WebResourceContext.All)
WebView2.CoreWebView2.AddWebResourceRequestedFilter("https://www.funimation.com/*", CoreWebView2WebResourceContext.All)
'WebView2.CoreWebView2.AddWebResourceRequestedFilter("https://cr-play-service.prd.crunchyrollsvc.com/*", CoreWebView2WebResourceContext.All)
WebView2.CoreWebView2.AddWebResourceRequestedFilter("https://cr-play-service.prd.crunchyrollsvc.com/*", CoreWebView2WebResourceContext.All)
' WebView2.CoreWebView2.AddWebResourceRequestedFilter("*", CoreWebView2WebResourceContext.All)
'cr-play-service.prd.crunchyrollsvc.com
'WebView2.CoreWebView2.AddWebResourceRequestedFilter("*", CoreWebView2WebResourceContext.All)
@ -49,7 +49,6 @@ Public Class Browser
End Sub
Private Sub WebView2_SourceChanged(sender As Object, e As CoreWebView2SourceChangedEventArgs) Handles WebView2.SourceChanged
Try
TextBox1.Text = WebView2.CoreWebView2.Source
@ -101,9 +100,17 @@ Public Class Browser
End Try
End Sub
Async Sub Startup()
Dim WVOptions As New CoreWebView2EnvironmentOptions()
WVOptions.AdditionalBrowserArguments = "--disable-web-security" '+ " " + "--disable-cache" + " " + "--disk-cache-size=1" + " " + "--disable-gpu" '+ '" " + "--use-fake-device-for-media-stream" "--disable-web-security" + " " +
Dim Env As CoreWebView2Environment = Await CoreWebView2Environment.CreateAsync(Nothing, Nothing, WVOptions)
Await WebView2.EnsureCoreWebView2Async(Env)
End Sub
Private Sub Browser_Load(sender As Object, e As EventArgs) Handles Me.Load
Startup()
Main.waveOutSetVolume(0, 0)
If Me.Width > My.Computer.Screen.Bounds.Width Then
Me.Width = My.Computer.Screen.Bounds.Width
@ -149,7 +156,6 @@ Public Class Browser
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'MsgBox(Main.CR_etp_rt)
'MsgBox(Main.CR_ajs_user_id)
@ -282,13 +288,23 @@ Public Class Browser
If CBool(InStr(Headers.Item(i).Value, "Basic")) Then
Main.CrBetaBasic = Headers.Item(i).Value
Debug.WriteLine("Auth-Basic: " + Main.CrBetaBasic)
ElseIf CBool(InStr(Headers.Item(i).Value, "Bearer")) Then
Main.CR_AuthToken = Headers.Item(i).Value
Debug.WriteLine("Auth-Bearer: " + Main.CR_AuthToken)
End If
Next
End If
'If CBool(InStr(e.Request.Uri, "crunchyrollsvc.com")) = True And Main.CR_AuthToken = Nothing Then
' Dim Headers As New List(Of KeyValuePair(Of String, String))
' Headers.AddRange(e.Request.Headers.ToList)
' For i As Integer = 0 To Headers.Count
' Debug.WriteLine(Headers.Item(i).Key + "--" + Headers.Item(i).Value)
' If CBool(InStr(Headers.Item(i).Key, "ETP-Anonymous-ID")) Then
' Main.CR_AuthToken = Headers.Item(i).Value
' Debug.WriteLine("ETP-Anonymous-ID: " + Main.CR_AuthToken)
' End If
' Next
'End If
'If CBool(InStr(e.Request.Uri, "crunchyroll.com/")) And CBool(InStr(e.Request.Uri, "streams?")) Then
' Dim Headers As New List(Of KeyValuePair(Of String, String))
' Headers.AddRange(e.Request.Headers.ToList)

View File

@ -492,7 +492,7 @@ Public Class CRD_List_Item
HybridMode = True
HybridRunning = True
Else
DownloadFFMPEG(DL_URL, DL_Pfad, Filename)
DownloadFFMPEG("-protocol_whitelist file,http,https,tcp,tls,crypto,data " + DL_URL, DL_Pfad, Filename)
End If
End Sub
@ -1151,19 +1151,6 @@ Public Class CRD_List_Item
Dim int As Integer = i
If CBool(InStr(InuputStreams(int), ":\")) Then
Continue For
End If
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"
If File.Exists(SubsFile) Then
@ -1171,33 +1158,53 @@ Public Class CRD_List_Item
End If
Try
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
Dim InputData As String = Nothing
Dim InputPath As String = Nothing
If CBool(InStr(InuputStreams(int), ":\")) = True Then
Dim InputFile As String() = InuputStreams(int).Split(New [Char]() {Chr(34)})
InputPath = InputFile(0)
InputData = My.Computer.FileSystem.ReadAllText(InputPath)
Else
Dim InputURL As String() = InuputStreams(int).Split(New [Char]() {Chr(34)})
InputPath = InputURL(0)
Dim InputClient As New WebClient
InputClient.Encoding = Encoding.UTF8
If Main.WebbrowserCookie = Nothing Then
Else
InputClient.Headers.Add(HttpRequestHeader.Cookie, Main.WebbrowserCookie)
End If
Try
InputData = InputClient.DownloadString(InputURL(0))
Catch ex As Exception
InputClient.Headers.Add(HttpRequestHeader.AcceptEncoding, "*")
InputData = DecompressString(InputClient.DownloadData(InputURL(0)))
End Try
End If
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
'If CBool(InStr(InputData, "RESOLUTION=")) = True And CBool(InStr(InputData, "#EXT-X-BYTERANGE:")) = False Then 'master m3u8 no fragments
Dim index_m3u8() As String = InputData.Split(New String() {vbLf}, System.StringSplitOptions.RemoveEmptyEntries)
If TargetReso = 42 Then
TargetReso = 1080
End If
For line As Integer = 0 To index_m3u8.Count - 1
If CBool(InStr(index_m3u8(line), "x" + TargetReso.ToString)) = True Then
' Dim index_m3u8() As String = InputData.Split(New String() {vbLf}, System.StringSplitOptions.RemoveEmptyEntries)
' If TargetReso = 42 Then
' TargetReso = 1080
' End If
' For line As Integer = 0 To index_m3u8.Count - 1
' If CBool(InStr(index_m3u8(line), "x" + TargetReso.ToString)) = True Then
InputData = InputClient.DownloadString(GetFullUri(InputURL(0), index_m3u8(line + 1)))
InputURL(0) = index_m3u8(line + 1)
Exit For
End If
Next
End If
' InputData = InputClient.DownloadString(GetFullUri(InputURL(0), index_m3u8(line + 1)))
' InputURL(0) = index_m3u8(line + 1)
' Exit For
' End If
' Next
'End If
If CBool(InStr(InputData, "#EXT-X-VERSION:3")) Or CBool(InStr(InputData, "#EXT-X-VERSION:5")) Then
@ -1205,13 +1212,23 @@ Public Class CRD_List_Item
Pfad2 = Path.GetDirectoryName(DL_Pfad.Replace(Chr(34), "")) + "\" + NameP2.Replace(" ", "-") + "\"
End If
ProcessV3(InputURL(0), InputData, Pfad2, DL_Pfad, DL_URL)
ProcessV3(InputPath, InputData, Pfad2, DL_Pfad, DL_URL)
DL_URL = DL_URL.Replace("-i " + Chr(34) + InputURL(0), "-allowed_extensions ALL " + "-i " + Chr(34) + Pfad2 + "index.m3u8")
If CBool(InStr(DL_URL, "-allowed_extensions ALL ")) = True Then
DL_URL = DL_URL.Replace("-allowed_extensions ALL ", "")
End If
DL_URL = DL_URL.Replace("-i " + Chr(34) + InputPath, "-allowed_extensions ALL " + "-i " + Chr(34) + Pfad2 + "index.m3u8")
ElseIf CBool(InStr(InputData, "#EXT-X-VERSION:4")) Then
ProcessV4(InputURL(0), InputData, Pfad2 + "Stream-" + int.ToString + "\")
DL_URL = DL_URL.Replace("-i " + Chr(34) + InputURL(0), "-allowed_extensions ALL " + "-i " + Chr(34) + Pfad2 + "Stream-" + int.ToString + "\index.m3u8")
ProcessV4(InputPath, InputData, Pfad2 + "Stream-" + int.ToString + "\")
If CBool(InStr(DL_URL, "-allowed_extensions ALL ")) = True Then
DL_URL = DL_URL.Replace("-allowed_extensions ALL ", "")
End If
DL_URL = DL_URL.Replace("-i " + Chr(34) + InputPath, "-allowed_extensions ALL " + "-i " + Chr(34) + Pfad2 + "Stream-" + int.ToString + "\index.m3u8")
Else
'write string to file
If Not Directory.Exists(Path.GetDirectoryName(Pfad2)) Then
@ -1244,11 +1261,11 @@ Public Class CRD_List_Item
Using sink As New StreamWriter(SubsFile, False, utf8WithoutBom2)
sink.WriteLine(InputData)
End Using
'replace url with local file
DL_URL = DL_URL.Replace(InputURL(0), SubsFile)
End If
sink.WriteLine(InputData)
End Using
'replace url with local file
DL_URL = DL_URL.Replace(InputPath, SubsFile)
End If
Catch ex As Exception
Debug.WriteLine(ex.ToString)
DL_URL = DL_URL_old

View File

@ -30,7 +30,6 @@ Public Class Main
Public CheckCRLogin As Boolean = True
Public CR_AuthToken As String = ""
Public CR_v1Token As String = ""
@ -445,7 +444,7 @@ Public Class Main
DarkModeValue = My.Settings.DarkModeValue
DownloadScope = DownloadScopeEnum.SubsOnly 'My.Settings.DownloadScope
DownloadScope = My.Settings.DownloadScope
Manager.Style = MetroColorStyle.Orange
If DarkModeValue = True Then
@ -1735,68 +1734,68 @@ Public Class Main
Dim ObjectsURLBuilder() As String = Streams.Split(New String() {"videos"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim ObjectsURLBuilder2() As String = ObjectsURLBuilder(1).Split(New String() {"/streams"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim ObjectsURLBuilder3() As String = WebsiteURL.Split(New String() {"watch/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim ObjectsURLBuilder4() As String = ObjectsURLBuilder3(1).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim ObjectsURL As String = ObjectsURLBuilder(0) + "objects/" + ObjectsURLBuilder4(0) + ObjectsURLBuilder2(1)
Dim ObjectsURLBuilder2() As String = ObjectsURLBuilder(1).Split(New String() {"/streams"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim ObjectsURLBuilder3() As String = WebsiteURL.Split(New String() {"watch/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim ObjectsURLBuilder4() As String = ObjectsURLBuilder3(1).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim ObjectsURL As String = ObjectsURLBuilder(0) + "objects/" + ObjectsURLBuilder4(0) + ObjectsURLBuilder2(1)
CR_EpisodeID = ObjectsURLBuilder4(0)
CR_EpisodeID = ObjectsURLBuilder4(0)
Debug.WriteLine(ObjectsURL)
Debug.WriteLine(ObjectsURL)
ObjectJson = CurlAuthNew(ObjectsURL, Loc_CR_Cookies, Loc_AuthToken)
ObjectJson = CurlAuthNew(ObjectsURL, Loc_CR_Cookies, Loc_AuthToken)
'Filter JSON esqaped characters
'Debug.WriteLine(Date.Now.ToString + "before:" + ObjectJson)
Debug.WriteLine("1288: " + ObjectJson)
ObjectJson = CleanJSON(ObjectJson)
'Debug.WriteLine(Date.Now.ToString + "after:" + ObjectJson)
'Filter JSON esqaped characters
'Debug.WriteLine(Date.Now.ToString + "before:" + ObjectJson)
Debug.WriteLine("1288: " + ObjectJson)
ObjectJson = CleanJSON(ObjectJson)
'Debug.WriteLine(Date.Now.ToString + "after:" + ObjectJson)
Dim ser As JObject = JObject.Parse(ObjectJson)
Dim data As List(Of JToken) = ser.Children().ToList
Dim ser As JObject = JObject.Parse(ObjectJson)
Dim data As List(Of JToken) = ser.Children().ToList
For Each item As JProperty In data
item.CreateReader()
Select Case item.Name
For Each item As JProperty In data
item.CreateReader()
Select Case item.Name
Case "data" 'each record is inside the entries array
For Each Entry As JObject In item.Values
Try
Dim Title As String = Entry("title").ToString
CR_title = String.Join(" ", Title.Split(invalids, StringSplitOptions.RemoveEmptyEntries)).TrimEnd("."c).Replace(Chr(34), "").Replace("\", "").Replace("/", "").Replace(":", "")
Debug.WriteLine(Date.Now.ToString + " CR-Title: " + CR_title)
Catch ex As Exception
End Try
Dim SubData As List(Of JToken) = Entry.Children().ToList
For Each SubItem As JProperty In SubData
'SubItem.CreateReader()
Select Case SubItem.Name
Case "episode_metadata"
For Each SubEntry As JProperty In SubItem.Values
Select Case SubEntry.Name
Case "series_title"
CR_series_title = SubEntry.Value.ToString.Replace(Chr(34), "").Replace("\", "").Replace("/", "").Replace(":", "")
Case "data" 'each record is inside the entries array
For Each Entry As JObject In item.Values
Try
Dim Title As String = Entry("title").ToString
CR_title = String.Join(" ", Title.Split(invalids, StringSplitOptions.RemoveEmptyEntries)).TrimEnd("."c).Replace(Chr(34), "").Replace("\", "").Replace("/", "").Replace(":", "")
Debug.WriteLine(Date.Now.ToString + " CR-Title: " + CR_title)
Catch ex As Exception
End Try
Dim SubData As List(Of JToken) = Entry.Children().ToList
For Each SubItem As JProperty In SubData
'SubItem.CreateReader()
Select Case SubItem.Name
Case "episode_metadata"
For Each SubEntry As JProperty In SubItem.Values
Select Case SubEntry.Name
Case "series_title"
CR_series_title = SubEntry.Value.ToString.Replace(Chr(34), "").Replace("\", "").Replace("/", "").Replace(":", "")
'Case "season_title"
' CR_season_title = SubEntry.Value.ToString
Case "season_number"
CR_season_number = SubEntry.Value.ToString.Replace(Chr(34), "").Replace("\", "").Replace("/", "").Replace(":", "")
Case "episode_number"
CR_episode2 = SubEntry.Value.ToString.Replace(Chr(34), "").Replace("\", "").Replace("/", "").Replace(":", "")
Case "episode"
CR_episode = SubEntry.Value.ToString.Replace(Chr(34), "").Replace("\", "").Replace("/", "").Replace(":", "")
Case "duration_ms"
CR_episode_duration_ms = SubEntry.Value.ToString.Replace(Chr(34), "").Replace("\", "").Replace("/", "").Replace(":", "")
Case "is_dubbed"
CR_audio_isDubbed = CBool(SubEntry.Value.ToString.Replace(Chr(34), "").Replace("\", "").Replace("/", "").Replace(":", ""))
'Case "eligible_region"
' CR_Region = SubEntry.Value.ToString.Replace(Chr(34), "").Replace("\", "").Replace("/", "").Replace(":", "")
End Select
Next '
End Select
Next
Case "season_number"
CR_season_number = SubEntry.Value.ToString.Replace(Chr(34), "").Replace("\", "").Replace("/", "").Replace(":", "")
Case "episode_number"
CR_episode2 = SubEntry.Value.ToString.Replace(Chr(34), "").Replace("\", "").Replace("/", "").Replace(":", "")
Case "episode"
CR_episode = SubEntry.Value.ToString.Replace(Chr(34), "").Replace("\", "").Replace("/", "").Replace(":", "")
Case "duration_ms"
CR_episode_duration_ms = SubEntry.Value.ToString.Replace(Chr(34), "").Replace("\", "").Replace("/", "").Replace(":", "")
Case "is_dubbed"
CR_audio_isDubbed = CBool(SubEntry.Value.ToString.Replace(Chr(34), "").Replace("\", "").Replace("/", "").Replace(":", ""))
'Case "eligible_region"
' CR_Region = SubEntry.Value.ToString.Replace(Chr(34), "").Replace("\", "").Replace("/", "").Replace(":", "")
End Select
Next '
End Select
Next
End Select
Next
Next
End Select
Next
#Region "VideoJson"
@ -1928,44 +1927,44 @@ Public Class Main
item.CreateReader()
Select Case item.Name
Case "streams" 'each record is inside the entries array
For Each Entry As JProperty In item.Values
'For Each Entry As JProperty In item.Values
Dim JsonEntryFormat As String = Entry.Name
If CBool(InStr(Entry.Name, "drm")) Or CBool(InStr(Entry.Name, "dash")) Or CBool(InStr(Entry.Name, "urls")) Then
Continue For
End If
' Dim JsonEntryFormat As String = Entry.Name
' If CBool(InStr(Entry.Name, "drm")) Or CBool(InStr(Entry.Name, "dash")) Or CBool(InStr(Entry.Name, "urls")) Then
' Continue For
' End If
Dim SubData As List(Of JToken) = Entry.Children().ToList
For Each SubItem As JObject In SubData
SubItem.CreateReader()
' Dim SubData As List(Of JToken) = Entry.Children().ToList
' For Each SubItem As JObject In SubData
' SubItem.CreateReader()
Dim StreamFormats As List(Of JToken) = SubItem.Children().ToList
' Dim StreamFormats As List(Of JToken) = SubItem.Children().ToList
For Each Formats As JProperty In StreamFormats
Formats.CreateReader()
Dim SubLang As String = Formats.Name
If SubLang = Nothing Or SubLang = "" Then
SubLang = "null"
End If
' For Each Formats As JProperty In StreamFormats
' Formats.CreateReader()
' Dim SubLang As String = Formats.Name
' If SubLang = Nothing Or SubLang = "" Then
' SubLang = "null"
' End If
Dim Url As String = CStr(Formats.Value("url"))
' Dim Url As String = CStr(Formats.Value("url"))
If CBool(InStr(JsonEntryFormat, "download")) Then
download_hls = New CR_Beta_Stream(SubLang, JsonEntryFormat, Url)
Continue For
End If
' If CBool(InStr(JsonEntryFormat, "download")) Then
' download_hls = New CR_Beta_Stream(SubLang, JsonEntryFormat, Url)
' Continue For
' End If
CR_Streams.Add(New CR_Beta_Stream(SubLang, JsonEntryFormat, Url))
' CR_Streams.Add(New CR_Beta_Stream(SubLang, JsonEntryFormat, Url))
Next
Next
Next
' Next
' Next
'Next
Case "audio_locale" 'each record is inside the entries array
'MsgBox(item.Value)
If CR_audio_isDubbed = True Then
@ -1977,9 +1976,52 @@ Public Class Main
End Select
Next
If download_hls IsNot Nothing Then
CR_Streams.Add(download_hls)
End If
'If download_hls IsNot Nothing Then
' CR_Streams.Add(download_hls)
'End If
Dim NewAPI_0 As String() = WebsiteURL.Split(New String() {"watch/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim NewAPI_1 As String() = NewAPI_0(1).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim NewAPI As String = "https://cr-play-service.prd.crunchyrollsvc.com/v1/" + NewAPI_1(0) + "/console/switch/play"
Dim NewAPIData As String = CurlAuthNew(NewAPI, "", Loc_AuthToken)
'MsgBox(NewAPIData)
Dim VideoJSON_New As String = CleanJSON(NewAPIData)
Dim VideoJObjectNew As JObject = JObject.Parse(VideoJSON_New)
Dim VideoJSON2New As String = "[" & VideoJSON_New.Replace("}{", "},{") & "]"
Dim jsonArray As JArray = JArray.Parse(VideoJSON2New)
For Each item As JObject In jsonArray
Dim hardSubs As JObject = CType(item("hardSubs"), JObject)
For Each prop As JProperty In hardSubs.Properties()
Dim Sublang As String = prop.Value("hlang").ToString
Dim vUrl As String = prop.Value("url").ToString.Replace("manifest.mpd", "master.m3u8")
CR_Streams.Add(New CR_Beta_Stream(Sublang, "fake_hls", vUrl))
Next
Next
Dim VideoDataNew As List(Of JToken) = VideoJObjectNew.Children().ToList
For Each item As JProperty In VideoDataNew
item.CreateReader()
Select Case item.Name
Case "url"
Dim vUrl As String = item.Value.ToString.Replace("manifest.mpd", "master.m3u8")
CR_Streams.Add(New CR_Beta_Stream("null", "fake_hls", vUrl))
'MsgBox(Title)
End Select
Next
Dim CR_URI_Master As New List(Of String)
@ -2037,21 +2079,21 @@ Public Class Main
'MsgBox(CR_URI_Master.Count.ToString)
If CBool(InStr(CR_URI_Master(0), "master.m3u8")) Then
Me.Invoke(New Action(Function() As Object
Anime_Add.StatusLabel.Text = "Status: m3u8 found, looking for resolution"
Me.Text = "Status: m3u8 found, looking for resolution"
Me.Invalidate()
Return Nothing
End Function))
Else
If MessageBox.Show("The Url below failed a check, continue?" + vbNewLine + CR_URI_Master(0), "Mission failed?", MessageBoxButtons.OKCancel) = DialogResult.OK Then
'If CBool(InStr(CR_URI_Master(0), "master.m3u8")) Then
' Me.Invoke(New Action(Function() As Object
' Anime_Add.StatusLabel.Text = "Status: m3u8 found, looking for resolution"
' Me.Text = "Status: m3u8 found, looking for resolution"
' Me.Invalidate()
' Return Nothing
' End Function))
'Else
' If MessageBox.Show("The Url below failed a check, continue?" + vbNewLine + CR_URI_Master(0), "Mission failed?", MessageBoxButtons.OKCancel) = DialogResult.OK Then
Else
Throw New System.Exception("Premium Episode")
End If
'Throw New System.Exception("Premium Episode")
End If
' Else
' Throw New System.Exception("Premium Episode")
' End If
' Throw New System.Exception("Premium Episode")
'End If
#End Region
@ -2364,77 +2406,18 @@ Public Class Main
#Region "GetResolution"
If Reso = 42 And HybridMode = False Then
ffmpegInput = "-i " + Chr(34) + CR_URI_Master(0) + Chr(34)
ElseIf DownloadScope = DownloadScopeEnum.SubsOnly Then
If DownloadScope = DownloadScopeEnum.SubsOnly Then
ffmpegInput = "-i [Subtitles only]"
Else
Dim str As String = Nothing
Dim NewMaster2 As String = Nothing
If NewAPIString1 = Nothing And NewAPIString2 = Nothing Or TTL < 1 Then
Dim str As String = CurlAuthNew(CR_URI_Master(0), "", Loc_AuthToken)
Dim NewAPI_0 As String() = WebsiteURL.Split(New String() {"watch/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim NewAPI_1 As String() = NewAPI_0(1).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim NewAPI As String = "https://cr-play-service.prd.crunchyrollsvc.com/v1/" + NewAPI_1(0) + "/web/edge/play"
Dim NewAPIData As String = CurlAuthNew(NewAPI, Loc_CR_Cookies, Loc_AuthToken)
'MsgBox(NewAPIData)
Dim bif_1 As String() = NewAPIData.Split(New String() {".bif?"}, System.StringSplitOptions.RemoveEmptyEntries) 'get the policy and beyond
Dim bif_2 As String() = bif_1(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) 'but we don't need beyond | Index 0 is enough
'
Dim bif_0 As String() = bif_1(0).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) 'again we don't need beyond the url
Dim bif_3 As String() = bif_0(bif_0.Count - 1).Split(New String() {"assets/"}, System.StringSplitOptions.RemoveEmptyEntries) 'we even don't need the asset itself
Dim NewMaster0 As String() = CR_URI_Master(0).Split(New String() {"assets/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim NewMaster1 As String() = NewMaster0(1).Split(New String() {"?Policy"}, System.StringSplitOptions.RemoveEmptyEntries)
NewMaster2 = bif_3(0) + "assets/" + NewMaster1(0) + "?" + bif_2(0)
NewAPIString1 = bif_3(0)
NewAPIString2 = bif_2(0)
TTL = 5
Else
Dim NewMaster0 As String() = CR_URI_Master(0).Split(New String() {"assets/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim NewMaster1 As String() = NewMaster0(1).Split(New String() {"?Policy"}, System.StringSplitOptions.RemoveEmptyEntries)
NewMaster2 = NewAPIString1 + "assets/" + NewMaster1(0) + "?" + NewAPIString2
TTL = TTL - 1
End If
'MsgBox(NewMaster2)
str = Curl(NewMaster2)
'For i As Integer = 0 To CR_URI_Master.Count - 1
' Dim Count As String = (i + 1).ToString
' Try
' str = Curl(CR_URI_Master(i))
' If CBool(InStr(str, "curl:")) = False Then
' Exit For
' End If
' Catch ex As Exception
' Me.Invoke(New Action(Function() As Object
' Anime_Add.StatusLabel.Text = "failed accessing master.m3u8 " + Count + "/" + CR_URI_Master.Count.ToString
' Me.Text = "failed accessing master.m3u8 " + Count + "/" + CR_URI_Master.Count.ToString
' Me.Invalidate()
' Return Nothing
' End Function))
' Debug.WriteLine("Error accessing master #" + i.ToString + " -- " + CR_URI_Master(i))
' Pause(5)
' End Try
'Next
@ -2489,7 +2472,16 @@ Public Class Main
'MsgBox(ffmpeg_url_3.Trim())
ffmpegInput = "-i " + Chr(34) + ffmpeg_url_3.Trim() + Chr(34)
Dim localm3u8 As String = CurlAuthNew(ffmpeg_url_3.Trim(), "", Loc_AuthToken)
Dim localfile As String = Application.StartupPath + "\" + GeräteID2() + ".m3u8"
Dim utf8WithoutBom As New System.Text.UTF8Encoding(False)
Using sink As New StreamWriter(localfile, False, utf8WithoutBom)
sink.WriteLine(localm3u8)
End Using
ffmpegInput = "-allowed_extensions ALL " + "-i " + Chr(34) + localfile + Chr(34)
End If
@ -2735,6 +2727,7 @@ Public Class Main
'MsgBox(URL_DL)
Me.Invoke(New Action(Function() As Object
ListItemAdd(Path.GetFileName(Pfad2.Replace(Chr(34), "")), L1Name, L2Name, ResoHTMLDisplay, SubType_Value, thumbnail3, ffmpegInput, Pfad2)
Return Nothing

View File

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

View File

@ -90,60 +90,6 @@ Namespace My.Resources
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die {&quot;sources&quot;:[{&quot;file&quot;:&quot; ähnelt.
'''</summary>
Friend ReadOnly Property AoD_files() As String
Get
Return ResourceManager.GetString("AoD_files", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &lt;h1 itemprop=&quot;name&quot;&gt; ähnelt.
'''</summary>
Friend ReadOnly Property AoD_HTML_Anime_Title() As String
Get
Return ResourceManager.GetString("AoD_HTML_Anime_Title", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &lt;h3 class=&quot;episodebox-title&quot; title=&quot; ähnelt.
'''</summary>
Friend ReadOnly Property AoD_HTML_Episode_Title() As String
Get
Return ResourceManager.GetString("AoD_HTML_Episode_Title", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &quot;image&quot;:&quot; ähnelt.
'''</summary>
Friend ReadOnly Property AoD_Image() As String
Get
Return ResourceManager.GetString("AoD_Image", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &quot;mediaid&quot;: ähnelt.
'''</summary>
Friend ReadOnly Property AoD_MediaID() As String
Get
Return ResourceManager.GetString("AoD_MediaID", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &quot;title&quot;:&quot; ähnelt.
'''</summary>
Friend ReadOnly Property AoD_Titel() As String
Get
Return ResourceManager.GetString("AoD_Titel", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die [Script Info]
'''; Template for error handling in the Crunchyrol Downloader by hama3254 https://github.com/hama3254/Crunchyroll-Downloader-v3.0
@ -187,78 +133,6 @@ Namespace My.Resources
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &lt;img id=&quot;footer_country_flag&quot; src=&quot;https://www.crunchyroll.com/i/country_flags/ ähnelt.
'''</summary>
Friend ReadOnly Property CC_String() As String
Get
Return ResourceManager.GetString("CC_String", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die display_episode_number&quot;:&quot; ähnelt.
'''</summary>
Friend ReadOnly Property CR_Episode_Nr() As String
Get
Return ResourceManager.GetString("CR_Episode_Nr", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &lt;meta property=&quot;og:url&quot; content=&quot; ähnelt.
'''</summary>
Friend ReadOnly Property CR_Head_Url_Split() As String
Get
Return ResourceManager.GetString("CR_Head_Url_Split", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &lt;h4 id=&quot;showmedia_about_name&quot; class=&quot;strong&quot;&gt; ähnelt.
'''</summary>
Friend ReadOnly Property CR_MediaName() As String
Get
Return ResourceManager.GetString("CR_MediaName", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &lt;/h4&gt; ähnelt.
'''</summary>
Friend ReadOnly Property CR_MediaName2() As String
Get
Return ResourceManager.GetString("CR_MediaName2", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &lt;/span&gt; ähnelt.
'''</summary>
Friend ReadOnly Property CR_MovieBT() As String
Get
Return ResourceManager.GetString("CR_MovieBT", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &lt;span itemprop=&quot;name&quot;&gt; ähnelt.
'''</summary>
Friend ReadOnly Property CR_MovieTop() As String
Get
Return ResourceManager.GetString("CR_MovieTop", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die seasonNumber&quot;:&quot; ähnelt.
'''</summary>
Friend ReadOnly Property CR_Season_Nr() As String
Get
Return ResourceManager.GetString("CR_Season_Nr", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
'''</summary>
@ -486,24 +360,6 @@ Namespace My.Resources
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &quot;,&quot;resolution&quot;:&quot;adaptive&quot; ähnelt.
'''</summary>
Friend ReadOnly Property hls_endString() As String
Get
Return ResourceManager.GetString("hls_endString", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &quot;format&quot;:&quot;adaptive_hls&quot;, ähnelt.
'''</summary>
Friend ReadOnly Property hls_Value() As String
Get
Return ResourceManager.GetString("hls_Value", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &lt;script&gt;
'''
@ -657,15 +513,6 @@ Namespace My.Resources
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &quot;error&quot;:false,&quot;code&quot;:&quot;ok&quot; ähnelt.
'''</summary>
Friend ReadOnly Property LoginSuccess() As String
Get
Return ResourceManager.GetString("LoginSuccess", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
'''</summary>
@ -1037,15 +884,5 @@ Namespace My.Resources
Return ResourceManager.GetString("thumbnailString", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die US cookies can&apos;t be used as long you are logged in.
'''I delete the curremt session with the unlock, if you want to be logged in with the US cookie you need to enter you data on the left. ähnelt.
'''</summary>
Friend ReadOnly Property US_ToolTip() As String
Get
Return ResourceManager.GetString("US_ToolTip", resourceCulture)
End Get
End Property
End Module
End Namespace

View File

@ -145,9 +145,6 @@
<data name="about_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\about_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="AoD_Titel" xml:space="preserve">
<value>"title":"</value>
</data>
<data name="Funimation_Subtitle_String2" xml:space="preserve">
<value>", "kind": "subtitle", "type": "Full", "language": "</value>
</data>
@ -219,12 +216,6 @@
<data name="main_pause_play" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\main-pause-play.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LoginSuccess" xml:space="preserve">
<value>"error":false,"code":"ok"</value>
</data>
<data name="AoD_Image" xml:space="preserve">
<value>"image":"</value>
</data>
<data name="Funimation_Subtitle_String" xml:space="preserve">
<value>", "kind": "subtitle", "type": "CC", "language": "</value>
</data>
@ -254,10 +245,6 @@ setInterval(function loadXMLDoc() {
<data name="Funimation_src_string" xml:space="preserve">
<value>"src":</value>
</data>
<data name="US_ToolTip" xml:space="preserve">
<value>US cookies can't be used as long you are logged in.
I delete the curremt session with the unlock, if you want to be logged in with the US cookie you need to enter you data on the left.</value>
</data>
<data name="ass_template" xml:space="preserve">
<value>[Script Info]
; Template for error handling in the Crunchyrol Downloader by hama3254 https://github.com/hama3254/Crunchyroll-Downloader-v3.0
@ -281,12 +268,6 @@ Style: Default,Arial,20,&amp;H00FFFFFF,&amp;H0000FFFF,&amp;H00000000,&amp;H00000
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,,some ideas on how templated karaoke could work in auto4/lua</value>
</data>
<data name="hls_endString" xml:space="preserve">
<value>","resolution":"adaptive"</value>
</data>
<data name="hls_Value" xml:space="preserve">
<value>"format":"adaptive_hls",</value>
</data>
<data name="main_settings" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\main-settings.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -341,9 +322,6 @@ Dialogue: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,,some ideas on how tem
<data name="main_button_download_hovert" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\main_button_download_hovert.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="CC_String" xml:space="preserve">
<value>&lt;img id="footer_country_flag" src="https://www.crunchyroll.com/i/country_flags/</value>
</data>
<data name="balken_console" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\balken_console.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -411,12 +389,6 @@ Dialogue: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,,some ideas on how tem
<data name="icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="AoD_files" xml:space="preserve">
<value>{"sources":[{"file":"</value>
</data>
<data name="CR_Head_Url_Split" xml:space="preserve">
<value>&lt;meta property="og:url" content="</value>
</data>
<data name="htmlTop" xml:space="preserve">
<value>&lt;!DOCTYPE html&gt;
&lt;head&gt;
@ -463,18 +435,6 @@ Dialogue: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,,some ideas on how tem
<data name="Funimation_subs_src" xml:space="preserve">
<value>{"src": "</value>
</data>
<data name="AoD_HTML_Anime_Title" xml:space="preserve">
<value>&lt;h1 itemprop="name"&gt;</value>
</data>
<data name="AoD_HTML_Episode_Title" xml:space="preserve">
<value>&lt;h3 class="episodebox-title" title="</value>
</data>
<data name="CR_MediaName" xml:space="preserve">
<value>&lt;h4 id="showmedia_about_name" class="strong"&gt;“</value>
</data>
<data name="CR_MediaName2" xml:space="preserve">
<value>”&lt;/h4&gt;</value>
</data>
<data name="main_add_invert_dark" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\main-add_invert_dark.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -493,21 +453,12 @@ Dialogue: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,,some ideas on how tem
<data name="main_mini_red" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\main-mini_red.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="CR_Episode_Nr" xml:space="preserve">
<value>display_episode_number":"</value>
</data>
<data name="CR_Season_Nr" xml:space="preserve">
<value>seasonNumber":"</value>
</data>
<data name="Funimation_Subtitle_String3" xml:space="preserve">
<value>", "kind": "subtitle", "type": "full", "language": "</value>
</data>
<data name="Funimation_Player_ID_2" xml:space="preserve">
<value>src="https://www.funimation.com/player/</value>
</data>
<data name="AoD_MediaID" xml:space="preserve">
<value>"mediaid":</value>
</data>
<data name="main_close_dark" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\main-close_dark.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -520,12 +471,6 @@ Dialogue: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,,some ideas on how tem
<data name="main_mini_dark_hover" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\main-mini_dark_hover.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="CR_MovieBT" xml:space="preserve">
<value>&lt;/span&gt;</value>
</data>
<data name="CR_MovieTop" xml:space="preserve">
<value>&lt;span itemprop="name"&gt;</value>
</data>
<data name="main_button_download_deactivate" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\main_button_download-deactivate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>