-HybridMode fix for relative paths in the m3u8
-subtitle download fixed
-funimation error handling for unavailable resolution (mostly for http errors)
This commit is contained in:
hama3254 2020-10-07 22:40:58 +02:00
parent 643f6c905f
commit 22745b152a
17 changed files with 363 additions and 217 deletions

Binary file not shown.

View File

@ -27,6 +27,7 @@ Public Class CRD_List_Item
Dim HistoryFilename As String
Dim Retry As Boolean = False
Dim HybridMode As Boolean = False
Dim HybridModePath As String = Nothing
Dim HybridRunning As Boolean = False
Dim TargetReso As Integer = 1080
#Region "Remove from list"
@ -159,42 +160,54 @@ Public Class CRD_List_Item
End Sub
Private Sub bt_pause_Click(sender As Object, e As EventArgs) Handles bt_pause.Click
If proc.HasExited = True Then
If ProgressBar1.Value < 100 Then
MsgBox("The download process seems to have crashed", MsgBoxStyle.Exclamation)
Label_percent.Text = "Press the play button again to retry."
ProgressBar1.Value = 100
Retry = True
If HybridRunning = True Then
If StatusRunning = True Then
StatusRunning = False
ElseIf Retry = True Then
If Main.RunningDownloads < Main.MaxDL Then
bt_pause.BackgroundImage = My.Resources.main_pause_play
Else
If MessageBox.Show("You have currtenly on your set Download limit." + vbNewLine + " You can Press OK to ignore it.", "Download maximum reached", MessageBoxButtons.OKCancel) = DialogResult.Cancel Then
Exit Sub
End If
End If
If My.Computer.FileSystem.FileExists(HistoryDL_Pfad.Replace(Chr(34), "")) Then 'Pfad = Kompeltter Pfad mit Dateinamen + ENdung
Try
My.Computer.FileSystem.DeleteFile(HistoryDL_Pfad.Replace(Chr(34), ""))
Catch ex As Exception
End Try
End If
DownloadFFMPEG(HistoryDL_URL, HistoryDL_Pfad, HistoryFilename)
Else
StatusRunning = True
Label_website.Text = Label_website_Text
bt_pause.BackgroundImage = My.Resources.main_pause
End If
Exit Sub
End If
If StatusRunning = True Then
StatusRunning = False
bt_pause.BackgroundImage = My.Resources.main_pause_play
SuspendProcess(proc)
Else
StatusRunning = True
bt_pause.BackgroundImage = My.Resources.main_pause
ResumeProcess(proc)
If proc.HasExited = True Then
If ProgressBar1.Value < 100 Then
MsgBox("The download process seems to have crashed", MsgBoxStyle.Exclamation)
Label_percent.Text = "Press the play button again to retry."
ProgressBar1.Value = 100
Retry = True
StatusRunning = False
ElseIf Retry = True Then
If Main.RunningDownloads < Main.MaxDL Then
Else
If MessageBox.Show("You have currtenly on your set Download limit." + vbNewLine + " You can Press OK to ignore it.", "Download maximum reached", MessageBoxButtons.OKCancel) = DialogResult.Cancel Then
Exit Sub
End If
End If
If My.Computer.FileSystem.FileExists(HistoryDL_Pfad.Replace(Chr(34), "")) Then 'Pfad = Kompeltter Pfad mit Dateinamen + ENdung
Try
My.Computer.FileSystem.DeleteFile(HistoryDL_Pfad.Replace(Chr(34), ""))
Catch ex As Exception
End Try
End If
DownloadFFMPEG(HistoryDL_URL, HistoryDL_Pfad, HistoryFilename)
StatusRunning = True
Label_website.Text = Label_website_Text
End If
Exit Sub
End If
If StatusRunning = True Then
StatusRunning = False
bt_pause.BackgroundImage = My.Resources.main_pause_play
SuspendProcess(proc)
Else
StatusRunning = True
bt_pause.BackgroundImage = My.Resources.main_pause
ResumeProcess(proc)
End If
End If
End Sub
Public Sub SetToolTip(ByVal Text As String)
ToolTip1.SetToolTip(Me, Text)
@ -352,6 +365,8 @@ Public Class CRD_List_Item
Dim ts_dl As String = Nothing
Dim Folder As String = einstellungen.GeräteID()
Dim Pfad2 As String = Path.GetDirectoryName(DL_Pfad.Replace(Chr(34), "")) + "\" + Folder + "\"
HybridModePath = Pfad2
'MsgBox(HybridModePath)
If Debug2 = True Then
MsgBox(Pfad2)
End If
@ -379,8 +394,22 @@ Public Class CRD_List_Item
PauseTime = PauseTime + 5
ElseIf ThreadList.Count > 7 Then
Thread.Sleep(125)
ElseIf Canceld = True Then
For www As Integer = 0 To Integer.MaxValue
If ThreadList.Count > 0 Then
Thread.Sleep(250)
Else
Try
System.IO.Directory.Delete(HybridModePath, True)
Catch ex As Exception
End Try
Exit For
End If
Next
Return Nothing
Exit Function
Else
'Thread.Sleep(250)
Exit For
End If
Next
@ -404,23 +433,42 @@ Public Class CRD_List_Item
For i3 As Integer = 0 To c.Count - 2
path = path + c(i3)
Next
curi = path
curi = path + textLenght(i)
End If
Dim Evaluator = New Thread(Sub() Me.tsDownloadAsync(curi, Pfad2 + nummer4D + ".ts"))
Evaluator.Start()
ThreadList.Add(Evaluator)
m3u8FFmpeg = m3u8FFmpeg + Pfad2 + nummer4D + ".ts" + vbLf
Dim FragmentsFinised = (ThreadList.Count + nummerint) / FragmentsInt * 100
tsStatusAsync(FragmentsFinised, di, Filename, PauseTime)
Evaluator.Start()
ThreadList.Add(Evaluator)
m3u8FFmpeg = m3u8FFmpeg + Pfad2 + nummer4D + ".ts" + vbLf
Dim FragmentsFinised = (ThreadList.Count + nummerint) / FragmentsInt * 100
tsStatusAsync(FragmentsFinised, di, Filename, PauseTime)
ElseIf textLenght(i) = "#EXT-X-KEY" Then
m3u8FFmpeg = m3u8FFmpeg + textLenght(i) + vbLf
ElseIf textLenght(i) = "#EXT-X-PLAYLIST-TYPE:VOD" Then
ElseIf textLenght(i) = "#EXT-X-PLAYLIST-TYPE:VOD" Then
ElseIf InStr(textLenght(i), "URI=" + Chr(34)) Then
Dim KeyLine As String = textLenght(i)
If InStr(KeyLine, "https://") Then
'ElseIf InStr(KeyLine, "../") Then
' Dim countDot() As String = KeyLine.Split(New String() {"./"}, System.StringSplitOptions.RemoveEmptyEntries)
' Dim c() As String = New Uri(m3u8_url_3).Segments
' Dim path As String = "https://" + New Uri(m3u8_url_3).Host
' For i3 As Integer = 0 To c.Count - (2 + countDot.Count - 1)
' path = path + c(i3)
' Next
' KeyLine = path + countDot(countDot.Count - 1)
Else
m3u8FFmpeg = m3u8FFmpeg + textLenght(i) + vbLf
Dim c() As String = New Uri(m3u8_url_3).Segments
Dim path As String = "https://" + New Uri(m3u8_url_3).Host
For i3 As Integer = 0 To c.Count - 2
path = path + c(i3)
Next
KeyLine = KeyLine.Replace("URI=" + Chr(34), "URI=" + Chr(34) + path) 'path + textLenght(i)
Debug.WriteLine(vbNewLine + KeyLine)
End If
m3u8FFmpeg = m3u8FFmpeg + KeyLine + vbLf
Else
m3u8FFmpeg = m3u8FFmpeg + textLenght(i) + vbLf
End If
Next
Dim utf8WithoutBom As New System.Text.UTF8Encoding(False)
@ -607,6 +655,9 @@ Public Class CRD_List_Item
Label_percent.Text = "Finished - " + Done(0) + "MB"
Return Nothing
End Function))
If HybridMode = True Then
System.IO.Directory.Delete(HybridModePath, True)
End If
End If
@ -651,17 +702,25 @@ Public Class CRD_List_Item
#End Region
Private Sub bt_del_Click(sender As Object, e As EventArgs) Handles bt_del.Click
If proc.HasExited Then
If MessageBox.Show("The Download is not running anymore, press ok to remove it from the list.", "Remove from list!", MessageBoxButtons.OKCancel) = DialogResult.Cancel Then
Exit Sub
End If
ToDispose = True
Else
If HybridRunning = True Then
If MessageBox.Show("Are you sure you want to cancel the Download?", "Cancel Download!", MessageBoxButtons.YesNo) = DialogResult.No Then
Exit Sub
End If
Canceld = True
KillRunningTask()
'KillRunningTask()
Else
If proc.HasExited Then
If MessageBox.Show("The Download is not running anymore, press ok to remove it from the list.", "Remove from list!", MessageBoxButtons.OKCancel) = DialogResult.Cancel Then
Exit Sub
End If
ToDispose = True
Else
If MessageBox.Show("Are you sure you want to cancel the Download?", "Cancel Download!", MessageBoxButtons.YesNo) = DialogResult.No Then
Exit Sub
End If
Canceld = True
KillRunningTask()
End If
End If
End Sub

View File

@ -15,7 +15,7 @@ Public Class GeckoFX
Dim t As Thread
Dim ScanTrue As Boolean = False
Private Sub GeckoWebBrowser1_DocumentCompleted(sender As Object, e As EventArgs) Handles WebBrowser1.DocumentCompleted
'MsgBox("loaded!")
If ScanTrue = False Then
Button2.Enabled = True
End If
@ -25,29 +25,32 @@ Public Class GeckoFX
Main.Pause(4)
Main.LoginOnly = "US_UnBlock"
Else
Try
Dim cookieGrapp As String = WebBrowser1.Document.Body.OuterHtml '.Replace(vbTab, "").Replace(" ", "")
If Main.Debug2 = True Then
MsgBox(cookieGrapp)
End If
Dim cookieGrapp2() As String = cookieGrapp.Split(New String() {"<a class=" + Chr(34) + "cookie" + Chr(34) + ">"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim cookieGrapp3() As String = cookieGrapp2(1).Split(New String() {"</a>"}, System.StringSplitOptions.RemoveEmptyEntries)
keks = cookieGrapp3(0)
If Main.Debug2 = True Then
MsgBox(keks)
End If
Dim cookieGrapp As String = WebBrowser1.Document.Body.OuterHtml '.Replace(vbTab, "").Replace(" ", "")
If Main.Debug2 = True Then
MsgBox(cookieGrapp)
End If
Dim cookieGrapp2() As String = cookieGrapp.Split(New String() {"<a class=" + Chr(34) + "cookie" + Chr(34) + ">"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim cookieGrapp3() As String = cookieGrapp2(1).Split(New String() {"</a>"}, System.StringSplitOptions.RemoveEmptyEntries)
keks = cookieGrapp3(0)
If Main.Debug2 = True Then
MsgBox(keks)
End If
WebBrowser1.Navigate("https://www.crunchyroll.com/logout")
Main.Pause(5)
WebBrowser1.Navigate("javascript:document.cookie =" + Chr(34) + "session_id=" + keks + "; expires=Thu, 04 Jan 2022 00:00:00 UTC; path=/;" + Chr(34) + ";")
Main.Pause(1)
WebBrowser1.Navigate("javascript:document.cookie =" + Chr(34) + "sess_id=" + keks + "; expires=Thu, 04 Jan 2022 00:00:00 UTC; path=/;" + Chr(34) + ";")
Main.Pause(1)
If Main.LoginDialog = True Then
'Login.ShowDialog()
Else
WebBrowser1.Navigate("https://www.crunchyroll.com/")
End If
WebBrowser1.Navigate("https://www.crunchyroll.com/logout")
Main.Pause(5)
WebBrowser1.Navigate("javascript:document.cookie =" + Chr(34) + "session_id=" + keks + "; expires=Thu, 04 Jan 2022 00:00:00 UTC; path=/;" + Chr(34) + ";")
Main.Pause(1)
WebBrowser1.Navigate("javascript:document.cookie =" + Chr(34) + "sess_id=" + keks + "; expires=Thu, 04 Jan 2022 00:00:00 UTC; path=/;" + Chr(34) + ";")
Main.Pause(1)
If Main.LoginDialog = True Then
'Login.ShowDialog()
Else
WebBrowser1.Navigate("https://www.crunchyroll.com/")
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End If
@ -149,9 +152,13 @@ Public Class GeckoFX
End If
If Main.UserBowser = False Then
Main.WebbrowserURL = WebBrowser1.Url.ToString
Main.WebbrowserText = WebBrowser1.Document.Body.OuterHtml
Main.WebbrowserTitle = WebBrowser1.DocumentTitle
Try
Main.WebbrowserURL = WebBrowser1.Url.ToString
Main.WebbrowserText = WebBrowser1.Document.Body.OuterHtml
Main.WebbrowserTitle = WebBrowser1.DocumentTitle
Catch ex As Exception
End Try
Me.Close()
End If
'ElseIf CBool(InStr(WebBrowser1.Url.ToString, "https://www.anime-on-demand.de/anime/")) Then

View File

@ -50,7 +50,7 @@ Partial Class Main
Me.Btn_add.BackColor = System.Drawing.Color.Transparent
Me.Btn_add.Cursor = System.Windows.Forms.Cursors.Hand
Me.Btn_add.Image = Global.Crunchyroll_Downloader.My.Resources.Resources.main_add
Me.Btn_add.Location = New System.Drawing.Point(12, 5)
Me.Btn_add.Location = New System.Drawing.Point(5, 5)
Me.Btn_add.Name = "Btn_add"
Me.Btn_add.Size = New System.Drawing.Size(100, 48)
Me.Btn_add.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage
@ -74,7 +74,7 @@ Partial Class Main
Me.Btn_Settings.BackColor = System.Drawing.Color.Transparent
Me.Btn_Settings.Cursor = System.Windows.Forms.Cursors.Hand
Me.Btn_Settings.Image = Global.Crunchyroll_Downloader.My.Resources.Resources.main_settings
Me.Btn_Settings.Location = New System.Drawing.Point(656, 10)
Me.Btn_Settings.Location = New System.Drawing.Point(676, 10)
Me.Btn_Settings.Name = "Btn_Settings"
Me.Btn_Settings.Size = New System.Drawing.Size(100, 40)
Me.Btn_Settings.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage
@ -86,7 +86,7 @@ Partial Class Main
Me.Btn_Browser.BackColor = System.Drawing.Color.Transparent
Me.Btn_Browser.Cursor = System.Windows.Forms.Cursors.Hand
Me.Btn_Browser.Image = Global.Crunchyroll_Downloader.My.Resources.Resources.main_browser
Me.Btn_Browser.Location = New System.Drawing.Point(145, 10)
Me.Btn_Browser.Location = New System.Drawing.Point(110, 10)
Me.Btn_Browser.Name = "Btn_Browser"
Me.Btn_Browser.Size = New System.Drawing.Size(100, 40)
Me.Btn_Browser.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage
@ -98,9 +98,9 @@ Partial Class Main
Me.StatusMainForm.BackColor = System.Drawing.Color.Transparent
Me.StatusMainForm.Font = New System.Drawing.Font("Consolas", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.StatusMainForm.ForeColor = System.Drawing.SystemColors.WindowFrame
Me.StatusMainForm.Location = New System.Drawing.Point(251, 17)
Me.StatusMainForm.Location = New System.Drawing.Point(212, 17)
Me.StatusMainForm.Name = "StatusMainForm"
Me.StatusMainForm.Size = New System.Drawing.Size(370, 24)
Me.StatusMainForm.Size = New System.Drawing.Size(416, 24)
Me.StatusMainForm.TabIndex = 66
Me.StatusMainForm.Text = "Crunchyroll Downloader"
Me.StatusMainForm.TextAlign = System.Drawing.ContentAlignment.TopCenter

View File

@ -51,6 +51,7 @@ Public Class Main
Public SubSprache As String
Public SubFolder As Integer
Public SoftSubs As New List(Of String)
Public TempSoftSubs As New List(Of String)
Public AbourtList As New List(Of String)
Public watingList As New List(Of String)
Dim SoftSubsString As String
@ -702,72 +703,98 @@ Public Class Main
#End Region
#Region "Subs"
'MsgBox(TempSoftSubs.Count.ToString)
Dim SoftSubs2 As New List(Of String)
If SoftSubs.Count > 0 Then
For i As Integer = 0 To SoftSubs.Count - 1
Dim ii As Integer = i
If CBool(InStr(WebbrowserText, Chr(34) + "language" + Chr(34) + ":" + Chr(34) + SoftSubs(i) + Chr(34) + ",")) Then
SoftSubs2.Add(SoftSubs(i))
Else
Me.Invoke(New Action(Function()
einstellungen.StatusLabel.Text = "Status: language " + HardSubValuesToDisplay(Chr(34) + SoftSubs(ii) + Chr(34)) + " not found."
Pause(10)
Return Nothing
End Function))
End If
Next
ElseIf TempSoftSubs.Count > 0 Then
For i As Integer = 0 To TempSoftSubs.Count - 1
Dim ii As Integer = i
If CBool(InStr(WebbrowserText, Chr(34) + "language" + Chr(34) + ":" + Chr(34) + TempSoftSubs(i) + Chr(34) + ",")) Then
SoftSubs2.Add(TempSoftSubs(i))
Else
Me.Invoke(New Action(Function()
einstellungen.StatusLabel.Text = "Status: language " + HardSubValuesToDisplay(Chr(34) + TempSoftSubs(ii) + Chr(34)) + " not found."
Pause(10)
Return Nothing
End Function))
'MsgBox("Softsubtitle for " + SoftSubs(i) + " is not avalible.", MsgBoxStyle.Information)
End If
Next
End If
If SubSprache = "None" Then
If CBool(InStr(WebbrowserText, Chr(34) + "hardsub_lang" + Chr(34) + ":null")) Then
SubSprache2 = "null"
Else
Me.Invoke(New Action(Function()
ResoNotFoundString = WebbrowserText
DialogTaskString = "Language"
Reso.ShowDialog()
Return Nothing
End Function))
If UserCloseDialog = True Then
Throw New System.Exception(Chr(34) + "UserAbort" + Chr(34))
Else
If ResoBackString = Nothing Then
Else
SubSprache2 = ResoBackString
End If
End If
'Throw New System.Exception("Could not find the sub language")
End If
Else
If CBool(InStr(WebbrowserText, Chr(34) + "hardsub_lang" + Chr(34) + ":" + Chr(34) + SubSprache + Chr(34) + ",")) Then
SubSprache2 = Chr(34) + SubSprache + Chr(34)
ElseIf CBool(InStr(WebbrowserText, Chr(34) + "language" + Chr(34) + ":" + Chr(34) + SubSprache + Chr(34) + ",")) Then
If MessageBox.Show("It look like only Softsubtitle are avalibe." + vbNewLine + "Are you want to use Softsubtitle this time instead?", "No Hardsubtitle", MessageBoxButtons.YesNo) = DialogResult.Yes Then
SubSprache2 = "null"
SoftSubs2.Add(SubSprache)
Else
Throw New System.Exception("Could not find the sub language")
End If
Else
Me.Invoke(New Action(Function()
ResoNotFoundString = WebbrowserText
DialogTaskString = "Language"
Reso.ShowDialog()
Return Nothing
End Function))
If UserCloseDialog = True Then
Throw New System.Exception(Chr(34) + "UserAbort" + Chr(34))
Else
If ResoBackString = Nothing Then
Else
SubSprache2 = ResoBackString
End If
End If
End If
End If
#Region "copy paste trash"
'If SubSprache = "None" Then
' If CBool(InStr(WebbrowserText, Chr(34) + "hardsub_lang" + Chr(34) + ":null")) Then
' SubSprache2 = "null"
' Else
' Me.Invoke(New Action(Function()
' ResoNotFoundString = WebbrowserText
' DialogTaskString = "Language"
' Reso.ShowDialog()
' Return Nothing
' End Function))
' If UserCloseDialog = True Then
' Throw New System.Exception(Chr(34) + "UserAbort" + Chr(34))
' Else
' If ResoBackString = Nothing Then
' Else
' SubSprache2 = ResoBackString
' End If
' End If
' 'Throw New System.Exception("Could not find the sub language")
' End If
'Else
' If CBool(InStr(WebbrowserText, Chr(34) + "hardsub_lang" + Chr(34) + ":" + Chr(34) + SubSprache + Chr(34) + ",")) Then
' SubSprache2 = Chr(34) + SubSprache + Chr(34)
' ElseIf CBool(InStr(WebbrowserText, Chr(34) + "language" + Chr(34) + ":" + Chr(34) + SubSprache + Chr(34) + ",")) Then
' If MessageBox.Show("It look like only Softsubtitle are avalibe." + vbNewLine + "Are you want to use Softsubtitle this time instead?", "No Hardsubtitle", MessageBoxButtons.YesNo) = DialogResult.Yes Then
' SubSprache2 = "null"
' SoftSubs2.Add(SubSprache)
' Else
' Throw New System.Exception("Could not find the sub language")
' End If
' Else
' Me.Invoke(New Action(Function()
' ResoNotFoundString = WebbrowserText
' DialogTaskString = "Language"
' Reso.ShowDialog()
' Return Nothing
' End Function))
' If UserCloseDialog = True Then
' Throw New System.Exception(Chr(34) + "UserAbort" + Chr(34))
' Else
' If ResoBackString = Nothing Then
' Else
' SubSprache2 = ResoBackString
' End If
' End If
' End If
'End If
#End Region
#End Region
If Grapp_Abord = True Then
Grapp_RDY = True
Grapp_Abord = False
@ -781,7 +808,13 @@ Public Class Main
If SoftSubs2.Count > 0 Then
For i As Integer = 0 To SoftSubs2.Count - 1
LabelUpdate = "Status: downloading subtitle file"
Dim ii As Integer = i
Me.Invoke(New Action(Function()
einstellungen.StatusLabel.Text = "Status: downloading - " + HardSubValuesToDisplay(Chr(34) + SoftSubs2(ii) + Chr(34))
Pause(1)
Return Nothing
End Function))
LabelEpisode = SoftSubs2(i)
Dim SoftSub As String() = WebbrowserText.Split(New String() {Chr(34) + "language" + Chr(34) + ":" + Chr(34) + SoftSubs2(i) + Chr(34) + "," + Chr(34) + "url" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
Dim SoftSub_2 As String() = SoftSub(1).Split(New [Char]() {Chr(34)})
@ -801,12 +834,22 @@ Public Class Main
File.WriteAllText(Pfad4, str0, Encoding.UTF8)
Pause(1)
Next
Else
Me.Invoke(New Action(Function()
einstellungen.StatusLabel.Text = "Status: No language selected"
Pause(10)
Return Nothing
End Function))
End If
#End Region
DlSoftSubsRDY = True
Me.Invoke(New Action(Function()
einstellungen.StatusLabel.Text = "Status: idle"
Return Nothing
End Function))
'Catch ex As Exception
'End Try
@ -868,25 +911,18 @@ Public Class Main
End If
Catch ex As Exception
Anime_Add.comboBox4.Items.Clear()
Anime_Add.comboBox3.Items.Clear()
' MsgBox(Error_Mass_DL, MsgBoxStyle.Information)
'MsgBox(ex.ToString)
einstellungen.ComboBox2.Items.Clear()
einstellungen.comboBox3.Items.Clear()
einstellungen.comboBox4.Items.Clear()
einstellungen.MultiDLSoftSubs.Enabled = False
Aktuell = 0.ToString
Gesamt = 0.ToString
Anime_Add.groupBox1.Visible = True
Anime_Add.groupBox2.Visible = False
Anime_Add.GroupBox3.Visible = False
Anime_Add.Mass_DL_Cancel = False
Anime_Add.pictureBox4.Image = My.Resources.main_button_download_default
End Try
Pause(5)
Anime_Add.groupBox1.Visible = True
Anime_Add.groupBox2.Visible = False
Anime_Add.GroupBox3.Visible = False
Anime_Add.Mass_DL_Cancel = False
Anime_Add.pictureBox4.Image = My.Resources.main_button_download_default
einstellungen.ComboBox2.Items.Clear()
einstellungen.comboBox3.Items.Clear()
einstellungen.comboBox4.Items.Clear()
einstellungen.MultiDLSoftSubs.Enabled = False
End Sub
#End Region
@ -1022,10 +1058,10 @@ Public Class Main
Return "Italiano (Italian)"
ElseIf HardSub = Chr(34) + "esES" + Chr(34) Then
Return "Español (España)"
Else
Return CB_SuB_Nothing
End If
Return CB_SuB_Nothing
Catch ex As Exception
Return Nothing
End Try
@ -2090,46 +2126,49 @@ Public Class Main
'MsgBox(Funimation_m3u8_Main)
For i As Integer = 0 To textLenght.Length - 1
If InStr(textLenght(i), "https") Then
If InStr(textLenght(i - 1), "x" + Resu.ToString) Then
Try
If InStr(textLenght(i), "https") Then
If InStr(textLenght(i - 1), "x" + Resu.ToString) Then
Dim CheckClient As New WebClient
CheckClient.Encoding = Encoding.UTF8
If WebbrowserCookie = Nothing Then
Else
CheckClient.Headers.Add(HttpRequestHeader.Cookie, WebbrowserCookie)
End If
Dim m3u8String As String = CheckClient.DownloadString(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 InStr(keyfileurl2(0), "https://") Then
Else
Dim c() As String = New Uri(textLenght(i)).Segments
Dim path As String = "https://" + New Uri(textLenght(i)).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
'MsgBox(keyfileurl3)
Try
Dim CheckClient2 As New WebClient
CheckClient2.Encoding = System.Text.Encoding.UTF8
Dim testdl As String = CheckClient2.DownloadString(keyfileurl3)
Funimation_m3u8_final = textLenght(i)
Exit For
Catch ex As Exception
Debug.WriteLine(keyfileurl3 + vbNewLine + vbNewLine + ex.ToString)
End Try
Dim CheckClient As New WebClient
CheckClient.Encoding = Encoding.UTF8
If WebbrowserCookie = Nothing Then
Else
CheckClient.Headers.Add(HttpRequestHeader.Cookie, WebbrowserCookie)
End If
Dim m3u8String As String = CheckClient.DownloadString(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 InStr(keyfileurl2(0), "https://") Then
Else
Dim c() As String = New Uri(textLenght(i)).Segments
Dim path As String = "https://" + New Uri(textLenght(i)).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
'MsgBox(keyfileurl3)
Try
Dim CheckClient2 As New WebClient
CheckClient2.Encoding = System.Text.Encoding.UTF8
Dim testdl As String = CheckClient2.DownloadString(keyfileurl3)
Funimation_m3u8_final = textLenght(i)
Exit For
Catch ex As Exception
Debug.WriteLine(keyfileurl3 + vbNewLine + vbNewLine + ex.ToString)
End Try
End If
End If
Catch ex As Exception
End Try
Next
@ -2585,8 +2624,9 @@ Public Class Main
Dim URLSplit() As String = DecodedHTML.Split(New String() {"javascript:"}, System.StringSplitOptions.RemoveEmptyEntries)
If Application.OpenForms().OfType(Of Anime_Add).Any = True Then
For i As Integer = 0 To URLSplit.Count - 1
Dim ii As Integer = i
Me.Invoke(New Action(Function()
Anime_Add.ListBox1.Items.Add(URLSplit(i))
Anime_Add.ListBox1.Items.Add(URLSplit(ii))
Return Nothing
End Function))
Next

View File

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

View File

@ -434,9 +434,9 @@ Partial Class einstellungen
Me.StatusLabel.BackColor = System.Drawing.Color.Transparent
Me.StatusLabel.Font = New System.Drawing.Font("Arial", 12.0!)
Me.StatusLabel.ForeColor = System.Drawing.SystemColors.InactiveCaptionText
Me.StatusLabel.Location = New System.Drawing.Point(8, 71)
Me.StatusLabel.Location = New System.Drawing.Point(11, 65)
Me.StatusLabel.Name = "StatusLabel"
Me.StatusLabel.Size = New System.Drawing.Size(423, 15)
Me.StatusLabel.Size = New System.Drawing.Size(423, 29)
Me.StatusLabel.TabIndex = 38
Me.StatusLabel.Text = "Status: idle"
Me.StatusLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
@ -1145,15 +1145,6 @@ Partial Class einstellungen
Friend WithEvents TabControl1 As TabControl
Private WithEvents PictureBox2 As PictureBox
Friend WithEvents SoftSubs As GroupBox
Friend WithEvents CBesES As CheckBox
Friend WithEvents CBitIT As CheckBox
Friend WithEvents CBruRU As CheckBox
Friend WithEvents CBarME As CheckBox
Friend WithEvents CBfrFR As CheckBox
Friend WithEvents CBesLA As CheckBox
Friend WithEvents CBptBR As CheckBox
Friend WithEvents CBdeDE As CheckBox
Friend WithEvents CBenUS As CheckBox
Friend WithEvents GB_SubLanguage As GroupBox
Friend WithEvents ComboBox1 As ComboBox
Friend WithEvents TabPage6 As TabPage
@ -1167,4 +1158,13 @@ Partial Class einstellungen
Friend WithEvents GroupBox7 As GroupBox
Friend WithEvents CheckBox10 As CheckBox
Friend WithEvents FunimationHardsub As CheckBox
Public WithEvents CBesES As CheckBox
Public WithEvents CBitIT As CheckBox
Public WithEvents CBruRU As CheckBox
Public WithEvents CBarME As CheckBox
Public WithEvents CBfrFR As CheckBox
Public WithEvents CBesLA As CheckBox
Public WithEvents CBptBR As CheckBox
Public WithEvents CBdeDE As CheckBox
Public WithEvents CBenUS As CheckBox
End Class

View File

@ -126,7 +126,4 @@
<metadata name="MenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>346, 17</value>
</metadata>
<metadata name="MenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>346, 17</value>
</metadata>
</root>

View File

@ -6,6 +6,7 @@ Imports System.Text
Imports System.Threading
Public Class einstellungen
Private Sub einstellungen_Load(sender As Object, e As EventArgs) Handles MyBase.Load
For i As Integer = 0 To Main.SoftSubs.Count - 1
@ -401,9 +402,7 @@ Public Class einstellungen
End Sub
Private Sub ComboBox1_DrawItem(sender As Object, e As DrawItemEventArgs) Handles ComboBox1.DrawItem
Private Sub ComboBox1_DrawItem(sender As Object, e As DrawItemEventArgs) Handles ComboBox1.DrawItem, ComboBox2.DrawItem, comboBox3.DrawItem, comboBox4.DrawItem
sender.BackColor = Color.White
If e.Index >= 0 Then
Using st As New StringFormat With {.Alignment = StringAlignment.Center}
@ -437,7 +436,7 @@ Public Class einstellungen
If MessageBox.Show("Resolution '[Auto]' and merge the subtitle with the video file will download all resolutions!" + vbNewLine + "Press 'Yes' to enable it anyway", "Prepare for unforeseen consequences.", MessageBoxButtons.YesNo) = DialogResult.Yes Then
Else
MergeMP4.Checked = False
AAuto.Checked = False
End If
End If
End If
@ -456,13 +455,57 @@ Public Class einstellungen
End Sub
Private Sub PictureBox5_Click(sender As Object, e As EventArgs) Handles PictureBox5.Click
If CBool(InStr(TextBox2.Text, "crunchyroll.com")) Then
GeckoFX.WebBrowser1.Navigate(TextBox2.Text)
StatusLabel.Text = "Status: looking for subtitles"
Main.d = False
Main.b = False
End If
If Main.SoftSubs.Count > 0 Then
If CBool(InStr(TextBox2.Text, "crunchyroll.com")) Then
GeckoFX.WebBrowser1.Navigate(TextBox2.Text)
StatusLabel.Text = "Status: looking for subtitles"
Main.d = False
Main.b = False
End If
Else
Main.TempSoftSubs.Clear()
If CBdeDE.Checked = True Then
Main.TempSoftSubs.Add("deDE")
End If
If CBenUS.Checked = True Then
Main.TempSoftSubs.Add("enUS")
End If
If CBptBR.Checked = True Then
Main.TempSoftSubs.Add("ptBR")
End If
If CBesLA.Checked = True Then
Main.TempSoftSubs.Add("esLA")
End If
If CBfrFR.Checked = True Then
Main.TempSoftSubs.Add("frFR")
End If
If CBarME.Checked = True Then
Main.TempSoftSubs.Add("arME")
End If
If CBruRU.Checked = True Then
Main.TempSoftSubs.Add("ruRU")
End If
If CBitIT.Checked = True Then
Main.TempSoftSubs.Add("itIT")
End If
If CBesES.Checked = True Then
Main.TempSoftSubs.Add("esES")
End If
If Main.TempSoftSubs.Count > 0 Then
If CBool(InStr(TextBox2.Text, "crunchyroll.com")) Then
GeckoFX.WebBrowser1.Navigate(TextBox2.Text)
StatusLabel.Text = "Status: looking for subtitles"
Main.d = False
Main.b = False
End If
Else
StatusLabel.Text = "Status: No language selected"
Main.Pause(3)
StatusLabel.Text = "Status: idle"
End If
End If
End Sub
Private Sub PictureBox3_Click(sender As Object, e As EventArgs) Handles PictureBox3.Click
@ -480,7 +523,7 @@ Public Class einstellungen
PictureBox5.Image = My.Resources.softsubs_download_hover
End Sub
Private Sub PictureBox5_MouseLeave(sender As Object, e As EventArgs) Handles PictureBox5.Leave
Private Sub PictureBox5_MouseLeave(sender As Object, e As EventArgs) Handles PictureBox5.MouseLeave
PictureBox5.Image = My.Resources.softsubs_download
End Sub