improvement CR stream selector

improvement CR stream selector #661
This commit is contained in:
hama3254 2023-01-13 14:05:30 +01:00
parent 848879aee5
commit ab042c6eee
4 changed files with 64 additions and 54 deletions

Binary file not shown.

View File

@ -61,7 +61,7 @@ Public Class CR_Beta_Stream
'ByVal audioLanguage As String,
Public Sub New(ByVal subLang As String, ByVal Format As String, ByVal Url As String)
Me.subLang = subLang
Me.Url = Url
Me.Url = Url.Replace("&", "&").Replace("/u0026", "&").Replace("\u002F", "/").Replace("\u0026", "&")
Me.Format = Format
End Sub
'Me.audioLanguage,

View File

@ -1446,26 +1446,27 @@ Public Class Main
End Select
Next
Dim CR_URI_Master As String = Nothing
Dim CR_URI_Master As New List(Of String)
Dim RawStream As String = ""
Dim RawStream As New List(Of String)
For i As Integer = 0 To CR_Streams.Count - 1
Debug.WriteLine(CR_Streams.Item(i).subLang)
If CR_Streams.Item(i).subLang = CR_HardSubLang Then
CR_URI_Master = CR_Streams.Item(i).Url
CR_URI_Master.Add(CR_Streams.Item(i).Url)
ElseIf CR_Streams.Item(i).subLang = "" And CR_audio_locale IsNot "ja-JP" And DubMode = True Then 'nothing/raw
RawStream = CR_Streams.Item(i).Url
RawStream.Add(CR_Streams.Item(i).Url)
End If
Next
If CR_URI_Master = Nothing And RawStream IsNot "" Then
CR_URI_Master = RawStream
If CR_URI_Master.Count = 0 And RawStream.Count > 0 Then
CR_URI_Master.Clear()
CR_URI_Master.AddRange(RawStream)
ElseIf CR_URI_Master = Nothing Then
ElseIf CR_URI_Master.Count = 0 Then
Me.Invoke(New Action(Function() As Object
ResoNotFoundString = VideoJson
DialogTaskString = "Language_CR_Beta"
@ -1482,16 +1483,15 @@ Public Class Main
For i As Integer = 0 To CR_Streams.Count - 1
Debug.WriteLine(CR_Streams.Item(i).subLang)
If CR_Streams.Item(i).subLang = CR_HardSubLang Then
CR_URI_Master = CR_Streams.Item(i).Url
CR_URI_Master.Add(CR_Streams.Item(i).Url)
End If
Next
End If
End If
CR_URI_Master = CR_URI_Master.Replace("&", "&").Replace("/u0026", "&").Replace("\u002F", "/").Replace("\u0026", "&")
If CBool(InStr(CR_URI_Master, "master.m3u8")) 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"
@ -1664,7 +1664,7 @@ Public Class Main
If Reso = 42 And HybridMode = False Then
ffmpegInput = "-i " + Chr(34) + CR_URI_Master + Chr(34)
ffmpegInput = "-i " + Chr(34) + CR_URI_Master(0) + Chr(34)
ElseIf SubsOnly = True Then
ffmpegInput = "-i [Subtitles only]"
@ -1672,9 +1672,22 @@ Public Class Main
Dim str As String = Nothing
str = Curl(CR_URI_Master)
If CBool(InStr(str, "x" + Reso.ToString + ",")) Then
For i As Integer = 0 To CR_URI_Master.Count - 1
str = Curl(CR_URI_Master(i))
If CBool(InStr(str, "curl:")) = False Then
Exit For
End If
Next
If CBool(InStr(str, "curl:")) = True Then
MsgBox("Unable to get master.m3u8" + vbNewLine + str, MsgBoxStyle.Critical)
ElseIf CBool(InStr(str, "x" + Reso.ToString + ",")) Then
ResoUsed = "x" + Reso.ToString
Else
If CBool(InStr(str, ResoSave + ",")) Then

View File

@ -204,7 +204,6 @@ Public Class Einstellungen
AAuto.Checked = True
End If
Try
CB_CR_Harsubs.Items.Clear()
For i As Integer = 0 To Main.SubSpracheEnum.Count - 1
@ -217,9 +216,7 @@ Public Class Einstellungen
End If
Next
Catch ex As Exception
MsgBox(ex.ToString)
End Try
DD_Season_Prefix.Text = Main.Season_Prefix