fix movie issues

fix issues with movie names
This commit is contained in:
hama3254 2022-05-04 18:04:52 +02:00
parent 9147ce543c
commit c49cbc0be3
11 changed files with 106 additions and 62 deletions

Binary file not shown.

View File

@ -1204,6 +1204,18 @@ Public Class Main
CR_Anime_Name = String.Join(" ", CR_Name_2(0).Split(invalids, StringSplitOptions.RemoveEmptyEntries)).TrimEnd("."c).Replace(Chr(34), "").Replace("\", "").Replace("/", "") 'System.Text.RegularExpressions.Regex.Replace(CR_Name_2(0), "[^\w\\-]", " ")
CR_Anime_Name = RemoveExtraSpaces(CR_Anime_Name)
End If
If CR_Anime_Titel = Nothing Then 'it's a movie??
Dim CR_Name_1 As String() = WebbrowserText.Split(New String() {My.Resources.CR_MovieTop}, System.StringSplitOptions.RemoveEmptyEntries)
Dim CR_Name_2 As String() = CR_Name_1(2).Split(New String() {My.Resources.CR_MovieBT}, System.StringSplitOptions.RemoveEmptyEntries) '(New [Char]() {"-"})
CR_Anime_Titel = String.Join(" ", CR_Name_2(0).Split(invalids, StringSplitOptions.RemoveEmptyEntries)).TrimEnd("."c).Replace(Chr(34), "").Replace("\", "").Replace("/", "") 'System.Text.RegularExpressions.Regex.Replace(CR_Name_2(0), "[^\w\\-]", " ")
CR_Anime_Titel = RemoveExtraSpaces(CR_Anime_Titel)
End If
If Season_Prefix = "[default season prefix]" Then
Else
If CR_Anime_Staffel_int = "0" Then
@ -1212,10 +1224,18 @@ Public Class Main
End If
End If
If Episode_Prefix = "[default episode prefix]" Then
CR_Anime_Folge = CR_Anime_Folge.Replace(CR_Anime_Folge_int, AddLeadingZeros(CR_Anime_Folge_int))
If CR_Anime_Folge_int = Nothing Then
Else
CR_Anime_Folge = CR_Anime_Folge.Replace(CR_Anime_Folge_int, AddLeadingZeros(CR_Anime_Folge_int))
End If
Else
CR_Anime_Folge = Episode_Prefix + AddLeadingZeros(CR_Anime_Folge_int)
If CR_Anime_Folge_int = Nothing Then
Else
CR_Anime_Folge = Episode_Prefix + AddLeadingZeros(CR_Anime_Folge_int)
End If
End If
If CR_Anime_Titel = Nothing Then
CR_FilenName = CR_Anime_Name
ElseIf CR_NameMethode = 0 Then
@ -3994,69 +4014,69 @@ Public Class Main
If Funimation_m3u8_final = Nothing And FunimationBackupm3u8 = Nothing Then
Me.Invoke(New Action(Function() As Object
Me.Text = "Status: Resolution not found!"
Anime_Add.StatusLabel.Text = "Status: Resolution not found!"
Me.Invalidate()
DialogTaskString = "Funimation_Resolution"
ResoNotFoundString = str1
ErrorDialog.ShowDialog()
Return Nothing
End Function))
ResoFunBackup = ResoBackString
For i As Integer = 0 To Streams.Length - 1
If CBool(InStr(Streams(i), ResoBackString)) Then
Dim Streams2() As String = Streams(i).Split(New String() {"https://"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim Streams3() As String = Streams2(1).Split(New String() {"#EXT-"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim StreamURL As String = "https://" + Streams3(0).Trim
Dim CheckClient As New WebClient
CheckClient.Encoding = Encoding.UTF8
If Not WebbrowserCookie = Nothing Then
CheckClient.Headers.Add(HttpRequestHeader.Cookie, WebbrowserCookie)
ElseIf Not SystemWebBrowserCookie = Nothing Then
CheckClient.Headers.Add(HttpRequestHeader.Cookie, SystemWebBrowserCookie)
End If
Dim m3u8String As String = CheckClient.DownloadString(StreamURL)
'MsgBox(textLenght(i))
Dim keyfileurl() As String = m3u8String.Split(New String() {"URI=" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
Dim keyfileurl2() As String = keyfileurl(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
Dim keyfileurl3 As String = keyfileurl2(0)
If CBool(InStr(keyfileurl2(0), "https://")) Then
Else
Dim c() As String = New Uri(StreamURL).Segments
Dim path As String = "https://" + New Uri(StreamURL).Host
For i3 As Integer = 0 To c.Count - 2
path = path + c(i3)
Next
keyfileurl3 = path + keyfileurl2(0) 'New Uri(textLenght(i)).LocalPath + keyfileurl2(0)
End If
Try
Dim CheckClient2 As New WebClient
CheckClient2.Encoding = System.Text.Encoding.UTF8
Dim testdl As String = CheckClient2.DownloadString(keyfileurl3)
Funimation_m3u8_final = StreamURL
Exit For
Catch ex As Exception
Debug.WriteLine(keyfileurl3 + vbNewLine + ex.ToString)
End Try
'Funimation_m3u8_final = textLenght(i)
'Exit For
Me.Invoke(New Action(Function() As Object
Me.Text = "Status: Resolution not found!"
Anime_Add.StatusLabel.Text = "Status: Resolution not found!"
Me.Invalidate()
DialogTaskString = "Funimation_Resolution"
ResoNotFoundString = str1
ErrorDialog.ShowDialog()
Return Nothing
End Function))
ResoFunBackup = ResoBackString
For i As Integer = 0 To Streams.Length - 1
If CBool(InStr(Streams(i), ResoBackString)) Then
Dim Streams2() As String = Streams(i).Split(New String() {"https://"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim Streams3() As String = Streams2(1).Split(New String() {"#EXT-"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim StreamURL As String = "https://" + Streams3(0).Trim
Dim CheckClient As New WebClient
CheckClient.Encoding = Encoding.UTF8
If Not WebbrowserCookie = Nothing Then
CheckClient.Headers.Add(HttpRequestHeader.Cookie, WebbrowserCookie)
ElseIf Not SystemWebBrowserCookie = Nothing Then
CheckClient.Headers.Add(HttpRequestHeader.Cookie, SystemWebBrowserCookie)
End If
Next
ElseIf Funimation_m3u8_final = Nothing Then
Funimation_m3u8_final = FunimationBackupm3u8
Else
Me.Invoke(New Action(Function() As Object
Me.Text = "Status: Resolution found!"
Anime_Add.StatusLabel.Text = "Status: Resolution found!"
Me.Invalidate()
Return Nothing
End Function))
End If
Debug.WriteLine("Funimation_m3u8_final: " + Funimation_m3u8_final)
Funimation_m3u8_final = Funimation_m3u8_final.Replace(Chr(34), "")
Dim m3u8String As String = CheckClient.DownloadString(StreamURL)
'MsgBox(textLenght(i))
Dim keyfileurl() As String = m3u8String.Split(New String() {"URI=" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
Dim keyfileurl2() As String = keyfileurl(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
Dim keyfileurl3 As String = keyfileurl2(0)
If CBool(InStr(keyfileurl2(0), "https://")) Then
Else
Dim c() As String = New Uri(StreamURL).Segments
Dim path As String = "https://" + New Uri(StreamURL).Host
For i3 As Integer = 0 To c.Count - 2
path = path + c(i3)
Next
keyfileurl3 = path + keyfileurl2(0) 'New Uri(textLenght(i)).LocalPath + keyfileurl2(0)
End If
Try
Dim CheckClient2 As New WebClient
CheckClient2.Encoding = System.Text.Encoding.UTF8
Dim testdl As String = CheckClient2.DownloadString(keyfileurl3)
Funimation_m3u8_final = StreamURL
Exit For
Catch ex As Exception
Debug.WriteLine(keyfileurl3 + vbNewLine + ex.ToString)
End Try
'Funimation_m3u8_final = textLenght(i)
'Exit For
End If
Next
ElseIf Funimation_m3u8_final = Nothing Then
Funimation_m3u8_final = FunimationBackupm3u8
Else
Me.Invoke(New Action(Function() As Object
Me.Text = "Status: Resolution found!"
Anime_Add.StatusLabel.Text = "Status: Resolution found!"
Me.Invalidate()
Return Nothing
End Function))
End If
Debug.WriteLine("Funimation_m3u8_final: " + Funimation_m3u8_final)
Funimation_m3u8_final = Funimation_m3u8_final.Replace(Chr(34), "")
Else
Me.Invoke(New Action(Function() As Object
Me.Text = "Status: Substitles only mode - skipped video"
Anime_Add.StatusLabel.Text = "Status: Substitles only mode - skipped video"
Me.Invalidate()

View File

@ -178,6 +178,24 @@ Namespace My.Resources
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>

View File

@ -513,4 +513,10 @@ 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>
</root>