workaround missing file #882. #802

workaround missing file #882. #802
This commit is contained in:
hama3254 2023-10-08 12:50:50 +02:00
parent f85fb8b42a
commit cff2f6c926
7 changed files with 86 additions and 10 deletions

Binary file not shown.

View File

@ -174,6 +174,9 @@
<setting name="AudioOnlyReso" serializeAs="String">
<value>x480,</value>
</setting>
<setting name="FixCRStream" serializeAs="String">
<value>True</value>
</setting>
</Crunchyroll_Downloader.My.MySettings>
</userSettings>
</configuration>

View File

@ -14,7 +14,7 @@ Imports MetroFramework.Forms
Public Class CRD_List_Item
Inherits Controls.MetroUserControl
Dim LastUrl As String = Nothing
Dim ZeitGesamtInteger As Integer = 0
Dim ListOfStreams As New List(Of String)
Dim proc As Process
@ -881,7 +881,7 @@ Public Class CRD_List_Item
Dim di As New IO.DirectoryInfo(Folder)
For i As Integer = 0 To textLenght.Length - 1
Dim i2 As Integer = i
CheckThreadCount()
If Canceld = True Then
For www As Integer = 0 To Integer.MaxValue
@ -906,7 +906,16 @@ Public Class CRD_List_Item
Return "Canceld"
Exit Function
End If
If CBool(InStr(textLenght(i), ".ts")) Then
If CBool(InStr(textLenght(i2), ".ts")) Then
Me.Invoke(New Action(Function() As Object
LastUrl = textLenght(i2)
Return Nothing
End Function))
Dim File As String = Folder + String.Format("{0:00000}", Count) + ".ts"
Dim curi As String = GetFullUri(url, textLenght(i))
@ -923,10 +932,10 @@ Public Class CRD_List_Item
RaiseEvent UpdateUI(CInt(FragmentsFinised), di, PauseTime)
Count = Count + 1
ElseIf textLenght(i) = "#EXT-X-PLAYLIST-TYPE:VOD" Then
ElseIf textLenght(i2) = "#EXT-X-PLAYLIST-TYPE:VOD" Then
ElseIf CBool(InStr(textLenght(i), "URI=" + Chr(34))) Then
Dim KeyLine As String = textLenght(i)
ElseIf CBool(InStr(textLenght(i2), "URI=" + Chr(34))) Then
Dim KeyLine As String = textLenght(i2)
Dim KeyFileUri() As String = KeyLine.Split(New String() {"URI=" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
Dim KeyFileUri2() As String = KeyFileUri(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
@ -960,7 +969,45 @@ Public Class CRD_List_Item
End If
m3u8FileContent = m3u8FileContent + KeyLine + vbLf
ElseIf CBool(InStr(textLenght(i2), "#EXT-X-ENDLIST")) Then
' ElseIf textLenght(i) = Then 'And my.Settings.FixCRStream = True Then
Try
Dim StringCount As String = Count.ToString
Dim StringCount_1 As String = (Count + 1).ToString
Debug.WriteLine("old: " + LastUrl)
Dim NewUrl As String = Nothing
Me.Invoke(New Action(Function() As Object
NewUrl = LastUrl.Replace("-" + StringCount + "-", "-" + StringCount_1 + "-")
Return Nothing
End Function))
Debug.WriteLine("new: " + NewUrl)
Dim File As String = Folder + String.Format("{0:00000}", Count) + ".ts"
Dim curi As String = GetFullUri(url, NewUrl)
WC_TS = New WebClient
WC_TS.DownloadFile(New Uri(curi), File)
HybrideLog = HybrideLog + vbNewLine + Date.Now.ToString + ": " + File + " - " + curi
m3u8FileContent = m3u8FileContent + "#EXTINF:4.048," + vbLf 'dummy line
m3u8FileContent = m3u8FileContent + File + vbLf
Dim FragmentsFinised = Count * 100 / FragmentsInt
'Dim Update = New Thread(Sub() Me.TS_StatusAsync(CInt(FragmentsFinised), di, PauseTime))
'Update.Start()
RaiseEvent UpdateUI(CInt(FragmentsFinised), di, PauseTime)
Count = Count + 1
m3u8FileContent = m3u8FileContent + textLenght(i) + vbLf
Catch ex As Exception
HybrideLog = HybrideLog + vbNewLine + Date.Now.ToString + ": CR fix failed to access unlisted file #882"
m3u8FileContent = m3u8FileContent + textLenght(i) + vbLf
End Try
Else
m3u8FileContent = m3u8FileContent + textLenght(i) + vbLf
End If
@ -1273,10 +1320,18 @@ Public Class CRD_List_Item
Public Function DownloadFFMPEG(ByVal DLCommand As String, ByVal DL_Pfad As String, ByVal Filename As String) As String
'MsgBox(DLCommand)
Dim exepath As String = Application.StartupPath + "\ffmpeg.exe"
Dim startinfo As New System.Diagnostics.ProcessStartInfo
Dim cmd As String = "-user_agent " + My.Settings.User_Agend.Replace("User-Agent: ", "") + " -headers " + Chr(34) + "ACCEPT-ENCODING: *" + Chr(34) + " " + DLCommand + " " + DL_Pfad 'start ffmpeg with command strFFCMD string
'Dim cmd As String = "-headers " + My.Settings.User_Agend + " -headers " + Chr(34) + "ACCEPT-ENCODING: *" + Chr(34) + " " + DLCommand + " " + DL_Pfad 'start ffmpeg with command strFFCMD string
If CBool(InStr(DLCommand, ":\")) And CBool(InStr(DLCommand, "-i " + Chr(34) + "https://")) Then
Dim Replacement As String = "-user_agent " + My.Settings.User_Agend.Replace("User-Agent: ", "") + " -headers " + Chr(34) + "ACCEPT-ENCODING: *" + Chr(34) + " -i " + Chr(34) + "https://"
cmd = DLCommand.Replace("-i " + Chr(34) + "https://", Replacement) + " " + DL_Pfad
End If
LogText.Add(Date.Now.ToString + " " + cmd)
If Debug2 = True Then
MsgBox(cmd)

View File

@ -1250,6 +1250,8 @@ Public Class Main
For c As Integer = 0 To CR_Streams.Count - 1
Dim i As Integer = c
'Debug.WriteLine("1457: " + i.ToString + "/" + CR_Streams.Count.ToString + " " + CR_Streams.Item(i).subLang + " " + CR_Streams.Item(i).Format)
'https://www.crunchyroll.com/watch/GN7UD2K8N/dragon-ball-super-super-hero
Debug.WriteLine("Streams-1254: " + CR_Streams.Item(i).subLang)
If CR_Streams.Item(i).subLang = CR_HardSubLang Then
CR_URI_Master.Add(CR_Streams.Item(i).Url)
'MsgBox(CR_Streams.Item(i).Format + CR_Streams.Item(i).Url)
@ -1277,7 +1279,7 @@ Public Class Main
ResoBackString = Nothing
'MsgBox(CR_Streams.Count.ToString)
For i As Integer = 0 To CR_Streams.Count - 1
Debug.WriteLine("1571: " + CR_Streams.Item(i).subLang)
Debug.WriteLine("1280: " + CR_Streams.Item(i).subLang)
If CR_Streams.Item(i).subLang = CR_HardSubLang Then
CR_URI_Master.Add(CR_Streams.Item(i).Url)
@ -3369,7 +3371,8 @@ Public Class Main
If CBool(InStr(Address, "title-api.prd.funimationsvc.com")) Then
If FunimationJsonBrowser = "EpisodeJson" Then
Anime_Add.FillFunimationEpisodes(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) + ">", "")) '
Anime_Add.FillFunimationEpisodes(localHTML.Replace("<body>", "").Replace("</body>", "").Replace("<pre>", "").Replace("</pre>", "").Replace("</html>", "").Replace("<html><head></head><pre style=" + Chr(34) + "word-wrap: break-word;
-space: pre-wrap;" + Chr(34) + ">", "")) '
FunimationJsonBrowser = Nothing
WebbrowserURL = "https://funimation.com/js"
ElseIf FunimationJsonBrowser = "v1Json" Then

View File

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

View File

@ -666,6 +666,18 @@ Namespace My
Me("AudioOnlyReso") = value
End Set
End Property
<Global.System.Configuration.UserScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("True")> _
Public Property FixCRStream() As Boolean
Get
Return CType(Me("FixCRStream"),Boolean)
End Get
Set
Me("FixCRStream") = value
End Set
End Property
End Class
End Namespace

View File

@ -155,5 +155,8 @@
<Setting Name="AudioOnlyReso" Type="System.String" Scope="User">
<Value Profile="(Default)">x480,</Value>
</Setting>
<Setting Name="FixCRStream" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>