fix issue with the http observer

fix issue with the http observer
small filename and path fixes for CR beta
This commit is contained in:
hama3254 2021-08-07 23:49:09 +02:00
parent b57ea725a8
commit 35808777a1
26 changed files with 205 additions and 69 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ Crunchyroll Downloader/bin/x86/Debug/Crunchyroll-Downloader-v3.0.zip
*.mp4
*.log
*.key
CRD-addon/CRD-add-on-firefox-v0.6-2/.web-extension-id

Binary file not shown.

View File

@ -37,8 +37,8 @@ Partial Class Anime_Add
Me.comboBox4 = New MetroFramework.Controls.MetroComboBox()
Me.ComboBox1 = New MetroFramework.Controls.MetroComboBox()
Me.comboBox3 = New MetroFramework.Controls.MetroComboBox()
Me.PictureBox1 = New System.Windows.Forms.PictureBox()
Me.Add_Display = New MetroFramework.Controls.MetroLabel()
Me.PictureBox1 = New System.Windows.Forms.PictureBox()
Me.GroupBox3 = New System.Windows.Forms.GroupBox()
Me.ListBox1 = New System.Windows.Forms.ListBox()
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
@ -207,7 +207,7 @@ Partial Class Anime_Add
Me.textBox2.CustomButton.Visible = False
Me.textBox2.FontSize = MetroFramework.MetroTextBoxSize.Medium
Me.textBox2.ForeColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
Me.textBox2.Lines = New String() {"Name of the Anime"}
Me.textBox2.Lines = New String() {"Use Custom Name"}
Me.textBox2.Location = New System.Drawing.Point(18, 64)
Me.textBox2.MaxLength = 32767
Me.textBox2.Name = "textBox2"
@ -220,7 +220,7 @@ Partial Class Anime_Add
Me.textBox2.Size = New System.Drawing.Size(693, 29)
Me.textBox2.TabIndex = 5
Me.textBox2.TabStop = False
Me.textBox2.Text = "Name of the Anime"
Me.textBox2.Text = "Use Custom Name"
Me.textBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
Me.textBox2.UseSelectable = True
Me.textBox2.WaterMarkColor = System.Drawing.Color.FromArgb(CType(CType(109, Byte), Integer), CType(CType(109, Byte), Integer), CType(CType(109, Byte), Integer))
@ -286,18 +286,6 @@ Partial Class Anime_Add
Me.comboBox3.TabIndex = 1
Me.comboBox3.UseSelectable = True
'
'PictureBox1
'
Me.PictureBox1.BackColor = System.Drawing.Color.Transparent
Me.PictureBox1.Cursor = System.Windows.Forms.Cursors.Hand
Me.PictureBox1.Image = Global.Crunchyroll_Downloader.My.Resources.Resources.add_mass_cancel
Me.PictureBox1.Location = New System.Drawing.Point(159, 231)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(403, 36)
Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PictureBox1.TabIndex = 45
Me.PictureBox1.TabStop = False
'
'Add_Display
'
Me.Add_Display.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
@ -314,6 +302,18 @@ Partial Class Anime_Add
Me.Add_Display.Text = "..."
Me.Add_Display.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'PictureBox1
'
Me.PictureBox1.BackColor = System.Drawing.Color.Transparent
Me.PictureBox1.Cursor = System.Windows.Forms.Cursors.Hand
Me.PictureBox1.Image = Global.Crunchyroll_Downloader.My.Resources.Resources.add_mass_cancel
Me.PictureBox1.Location = New System.Drawing.Point(159, 231)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(403, 36)
Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PictureBox1.TabIndex = 45
Me.PictureBox1.TabStop = False
'
'GroupBox3
'
Me.GroupBox3.BackColor = System.Drawing.Color.Transparent
@ -383,9 +383,9 @@ Partial Class Anime_Add
Me.Controls.Add(Me.Btn_min)
Me.Controls.Add(Me.Btn_Close)
Me.Controls.Add(Me.pictureBox4)
Me.Controls.Add(Me.groupBox2)
Me.Controls.Add(Me.groupBox1)
Me.Controls.Add(Me.GroupBox3)
Me.Controls.Add(Me.groupBox2)
Me.Name = "Anime_Add"
Me.Padding = New System.Windows.Forms.Padding(10, 60, 20, 20)
Me.Text = "Add Video"

View File

@ -705,16 +705,25 @@ Public Class Anime_Add
For i As Integer = 0 To AoD_OmUList.Count - 1
Dim DropDownTitle As String() = AoD_OmUList(i).Split(New String() {My.Resources.AoD_Titel}, System.StringSplitOptions.RemoveEmptyEntries)
Dim DropDownTitle2 As String() = DropDownTitle(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
comboBox3.Items.Add(DropDownTitle2(0))
comboBox4.Items.Add(DropDownTitle2(0))
Dim Title As String = DropDownTitle2(0)
Title = Title.Replace("&", "&").Replace("&amp", "&").Replace("/u0026", "&").Replace("\u002F", "/").Replace("\u0026", "&")
Title = System.Text.RegularExpressions.Regex.Replace(Title, "[^\w\\-]", " ").Trim(" ")
Title = Main.RemoveExtraSpaces(Title)
comboBox3.Items.Add(Title)
comboBox4.Items.Add(Title)
Next
ElseIf ComboBox1.Text = "Dub" Then
For i As Integer = 0 To AoD_DubList.Count - 1
Dim DropDownTitle As String() = AoD_DubList(i).Split(New String() {My.Resources.AoD_Titel}, System.StringSplitOptions.RemoveEmptyEntries)
Dim DropDownTitle2 As String() = DropDownTitle(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
comboBox3.Items.Add(DropDownTitle2(0))
comboBox4.Items.Add(DropDownTitle2(0))
Dim Title As String = DropDownTitle2(0)
Title = Title.Replace("&", "&").Replace("&amp", "&").Replace("/u0026", "&").Replace("\u002F", "/").Replace("\u0026", "&")
Title = System.Text.RegularExpressions.Regex.Replace(Title, "[^\w\\-]", " ").Trim(" ")
Title = Main.RemoveExtraSpaces(Title)
comboBox3.Items.Add(Title)
comboBox4.Items.Add(Title)
Next
End If
@ -877,7 +886,7 @@ Public Class Anime_Add
Private Sub TextBox2_Click(sender As Object, e As EventArgs) Handles textBox2.Click
If textBox2.Text = "Name of the Anime" Then
If textBox2.Text = "Use Custom Name" Then
textBox2.Text = Nothing
End If
End Sub
@ -899,15 +908,23 @@ Public Class Anime_Add
For i As Integer = 0 To AoD_OmUList.Count - 1
Dim DropDownTitle As String() = AoD_OmUList(i).Split(New String() {My.Resources.AoD_Titel}, System.StringSplitOptions.RemoveEmptyEntries)
Dim DropDownTitle2 As String() = DropDownTitle(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
comboBox3.Items.Add(DropDownTitle2(0))
comboBox4.Items.Add(DropDownTitle2(0))
Dim Title As String = DropDownTitle2(0)
Title = Title.Replace("&", "&").Replace("&amp", "&").Replace("/u0026", "&").Replace("\u002F", "/").Replace("\u0026", "&")
Title = System.Text.RegularExpressions.Regex.Replace(Title, "[^\w\\-]", " ").Trim(" ")
Title = Main.RemoveExtraSpaces(Title)
comboBox3.Items.Add(Title)
comboBox4.Items.Add(Title)
Next
ElseIf AoD_DubList.Count > 0 Then
For i As Integer = 0 To AoD_DubList.Count - 1
Dim DropDownTitle As String() = AoD_DubList(i).Split(New String() {My.Resources.AoD_Titel}, System.StringSplitOptions.RemoveEmptyEntries)
Dim DropDownTitle2 As String() = DropDownTitle(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
comboBox3.Items.Add(DropDownTitle2(0))
comboBox4.Items.Add(DropDownTitle2(0))
Dim Title As String = DropDownTitle2(0)
Title = Title.Replace("&", "&").Replace("&amp", "&").Replace("/u0026", "&").Replace("\u002F", "/").Replace("\u0026", "&")
Title = System.Text.RegularExpressions.Regex.Replace(Title, "[^\w\\-]", " ").Trim(" ")
Title = Main.RemoveExtraSpaces(Title)
comboBox3.Items.Add(Title)
comboBox4.Items.Add(Title)
Next
End If
End Sub
@ -1139,7 +1156,7 @@ Public Class Anime_Add
Catch ex As Exception
End Try
AoDTitle = AoDTitle.Replace("&", "&").Replace("/u0026", "&").Replace("\u002F", "/").Replace("\u0026", "&")
AoDTitle = System.Text.RegularExpressions.Regex.Replace(AoDTitle, "[^\w\\-]", " ").Trim(" ")
AoDTitle = Main.RemoveExtraSpaces(AoDTitle)

View File

@ -53,13 +53,13 @@ Namespace My
GeckoPreferences.Default("plugin.state.flash") = 0
GeckoPreferences.Default("zoom.maxPercent") = 100
GeckoPreferences.Default("zoom.minPercent") = 100
'GeckoPreferences.Default("layers.geometry.d3d11.enabled") = False
'GeckoPreferences.Default("security.enterprise_roots.enabled") = True
'GeckoPreferences.Default("network.proxy.ssl") = InputBox("Set ssl proxy ip", "proxy")
'GeckoPreferences.Default("network.proxy.ssl_port") = CInt(InputBox("Set ssl proxy port", "proxy"))
'GeckoPreferences.Default("network.proxy.type") = 1
Return True
Catch ex As Exception
MsgBox("if you see this you should install the x86 version from the Visual C++ redistributable" + vbNewLine + "https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads" + vbNewLine + vbNewLine + ex.ToString)
Return False
End Try

View File

@ -72,7 +72,8 @@ Partial Class ErrorDialog
'PictureBox9
'
Me.PictureBox9.BackColor = System.Drawing.Color.Transparent
Me.PictureBox9.Cursor = System.Windows.Forms.Cursors.Hand
Me.PictureBox9.Cursor = System.Windows.Forms.Cursors.No
Me.PictureBox9.Enabled = False
Me.PictureBox9.Image = Global.Crunchyroll_Downloader.My.Resources.Resources.DialogNotFound_Submit
Me.PictureBox9.Location = New System.Drawing.Point(100, 146)
Me.PictureBox9.Name = "PictureBox9"
@ -101,7 +102,6 @@ Partial Class ErrorDialog
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
'Me.BackgroundImage = Global.Crunchyroll_Downloader.My.Resources.Resources.DialogNotFound_Background
Me.ClientSize = New System.Drawing.Size(380, 280)
Me.Controls.Add(Me.GroupBox3)
Me.Controls.Add(Me.pictureBox3)

View File

@ -9,6 +9,7 @@ Public Class ErrorDialog
Manager.Owner = Me
Me.StyleManager = Manager
pictureBox3.Image = Main.CloseImg
ComboBox1.Text = Nothing
Try
Me.Icon = My.Resources.icon
@ -207,5 +208,8 @@ Public Class ErrorDialog
PB.Image = Main.CloseImg
End Sub
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
PictureBox9.Enabled = True
PictureBox9.Cursor = Cursors.Hand
End Sub
End Class

View File

@ -36,7 +36,7 @@ Partial Class GeckoFX
Me.WebBrowser1.Name = "WebBrowser1"
Me.WebBrowser1.Size = New System.Drawing.Size(1280, 720)
Me.WebBrowser1.TabIndex = 0
Me.WebBrowser1.UseHttpActivityObserver = False
Me.WebBrowser1.UseHttpActivityObserver = True
'
'TextBox1
'

View File

@ -15,7 +15,7 @@ Public Class GeckoFX
Dim t As Thread
Public ScanTrue As Boolean = False
Public ScanTime As Integer = 0
Dim ExcludeUrl As String = ""
Private Sub GeckoWebBrowser1_DocumentCompleted(sender As Object, e As EventArgs) Handles WebBrowser1.DocumentCompleted
@ -119,7 +119,7 @@ Public Class GeckoFX
ElseIf CBool(InStr(WebBrowser1.Document.Body.OuterHtml, "season-dropdown content-menu block")) Then
Main.b = True
Anime_Add.textBox2.Text = "Name of the Anime"
Anime_Add.textBox2.Text = "Use Custom Name"
Main.WebbrowserURL = WebBrowser1.Url.ToString
Main.WebbrowserText = WebBrowser1.Document.Body.OuterHtml
Main.WebbrowserTitle = WebBrowser1.DocumentTitle
@ -129,7 +129,7 @@ Public Class GeckoFX
ElseIf CBool(InStr(WebBrowser1.Document.Body.OuterHtml, "wrapper container-shadow hover-classes")) Then
Main.b = True
Anime_Add.textBox2.Text = "Name of the Anime"
Anime_Add.textBox2.Text = "Use Custom Name"
Main.WebbrowserURL = WebBrowser1.Url.ToString
Main.WebbrowserText = WebBrowser1.Document.Body.OuterHtml
Main.WebbrowserTitle = WebBrowser1.DocumentTitle
@ -140,10 +140,12 @@ Public Class GeckoFX
Main.b = True
MsgBox(Main.No_Stream, MsgBoxStyle.OkOnly)
Anime_Add.StatusLabel.Text = "Status: idle"
Main.Text = "Crunchyroll Downloader"
End If
Catch ex As Exception
MsgBox(ex.ToString)
Anime_Add.StatusLabel.Text = "Status: idle"
Main.Text = "Crunchyroll Downloader"
End Try
ElseIf Main.c = False Then
If CBool(InStr(WebBrowser1.Document.Body.OuterHtml, "hardsub_lang")) Then
@ -185,7 +187,6 @@ Public Class GeckoFX
t.Priority = ThreadPriority.Normal
t.IsBackground = True
t.Start()
Else
Main.WebbrowserCookie = WebBrowser1.Document.Cookie
Main.Text = "Status: no video found"
@ -348,6 +349,7 @@ Public Class GeckoFX
Try
If e.KeyCode = Keys.Return Then
e.SuppressKeyPress = True
Debug.WriteLine("Start loading: " + Date.Now)
WebBrowser1.Navigate(TextBox1.Text)
End If
@ -455,7 +457,7 @@ Public Class GeckoFX
e.Cancel = True
'Debug.WriteLine(requesturl)
Exit Sub
ElseIf requesturl.Contains("ad_") Or requesturl.Contains("ads") Or requesturl.Contains(".swf") Or requesturl.Contains("unsupported") And Not requesturl = WebBrowser1.Url.ToString Then
ElseIf requesturl.Contains("ad_") Or requesturl.Contains("unsupported") Then 'requesturl.Contains("ad_") Or requesturl.Contains("ads") Or requesturl.Contains(".swf") Or And requesturl IsNot ExcludeUrl Then
e.Cancel = True
'Debug.WriteLine(requesturl)
Exit Sub
@ -465,7 +467,9 @@ Public Class GeckoFX
'Debug.WriteLine(requesturl)
End If
If CBool(InStr(requesturl, "https://beta-api.crunchyroll.com/")) And CBool(InStr(requesturl, "streams?")) Then
Debug.WriteLine(requesturl)
If Main.b = False Then
Main.GetBetaVideoProxy(requesturl, Main.WebbrowserURL)
Main.b = True
@ -530,6 +534,20 @@ Public Class GeckoFX
End If
ElseIf InStr(requesturl, ".mpd") Then
Main.mpdList.Add(requesturl)
ElseIf CBool(InStr(requesturl, "googlevideo.com")) And CBool(InStr(requesturl, "&range=")) = True Then
Dim DecodedUrl As String = UrlDecode(requesturl)
'MsgBox(DecodedUrl)
Dim VideoUrl() As String = DecodedUrl.Split(New String() {"&range="}, System.StringSplitOptions.RemoveEmptyEntries)
Dim VideoUrl2() As String = VideoUrl(1).Split(New String() {"&"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim NewUrl As String = VideoUrl(0) + "&" + VideoUrl2(1)
'Debug.WriteLine(NewUrl)
If Not Main.mpdList.Contains(NewUrl) Then
Main.mpdList.Add(NewUrl)
End If
ElseIf InStr(requesturl, ".txt") Then
Main.txtList.Add(requesturl)
ElseIf InStr(requesturl, ".vtt") Then
@ -595,9 +613,14 @@ Public Class GeckoFX
End If
End Sub
Private Sub WebBrowser1_ConsoleMessage(sender As Object, e As ConsoleMessageEventArgs) Handles WebBrowser1.ConsoleMessage
Debug.WriteLine(e.Message)
' MsgBox(e.Message)
'Private Sub WebBrowser1_ConsoleMessage(sender As Object, e As ConsoleMessageEventArgs) Handles WebBrowser1.ConsoleMessage
' Debug.WriteLine(e.Message)
' ' MsgBox(e.Message)
'End Sub
Private Sub WebBrowser1_Navigating(sender As Object, e As GeckoNavigatingEventArgs) Handles WebBrowser1.Navigating
ExcludeUrl = e.Uri.ToString
End Sub
End Class

View File

@ -1344,7 +1344,7 @@ Public Class Main
#End Region
If TextBox2_Text = Nothing Or TextBox2_Text = "Name of the Anime" Then
If TextBox2_Text = Nothing Or TextBox2_Text = "Use Custom Name" Then
Else
CR_FilenName = RemoveExtraSpaces(String.Join(" ", TextBox2_Text.Split(invalids, StringSplitOptions.RemoveEmptyEntries)).TrimEnd("."c)) 'System.Text.RegularExpressions.Regex.Replace(TextBox2_Text, "[^\w\\-]", " "))
@ -1889,7 +1889,7 @@ Public Class Main
Dim CR_series_title As String = Nothing
Dim CR_season_number As String = Nothing
Dim CR_episode As String = Nothing
Dim CR_season_title As String = Nothing
'Dim CR_season_title As String = Nothing
Dim CR_title As String = Nothing
Dim CR_audio_locale As String = Nothing
@ -1929,7 +1929,7 @@ Public Class Main
Dim data As List(Of JToken) = ser.Children().ToList
If TextBox2_Text = Nothing Or TextBox2_Text = "Name of the Anime" Then
If TextBox2_Text = Nothing Or TextBox2_Text = "Use Custom Name" Then
@ -1986,8 +1986,8 @@ Public Class Main
Select Case SubEntry.Name
Case "series_title"
CR_series_title = SubEntry.Value.ToString
Case "season_title"
CR_season_title = SubEntry.Value.ToString
'Case "season_title"
' CR_season_title = SubEntry.Value.ToString
Case "season_number"
CR_season_number = SubEntry.Value.ToString
Case "episode"
@ -2004,20 +2004,22 @@ Public Class Main
'My.Computer.Clipboard.SetText(ObjectJson)
'
If Season_Prefix = "[default season prefix]" Then
If CR_season_title = CR_series_title Then
If CR_episode = Nothing Then 'no episode number means most likey a movie
CR_season_number = Nothing
Else
CR_season_number = CR_series_title + " Season " + CR_season_number
End If
If Season_Prefix = "[default season prefix]" Then
If CR_episode = Nothing Then 'no episode number means most likey a movie
CR_season_number = Nothing
Else
CR_season_number = CR_season_title
CR_season_number = "Season " + CR_season_number
End If
Else
CR_season_number = Season_Prefix + CR_season_number
If CR_episode = Nothing Then 'no episode number means most likey a movie
CR_season_number = Nothing
Else
CR_season_number = Season_Prefix + CR_season_number
End If
End If
@ -2033,19 +2035,19 @@ Public Class Main
If CR_season_number = Nothing Then
CR_FilenName = CR_series_title + " " + CR_episode
Else
CR_FilenName = CR_season_number + " " + CR_episode
CR_FilenName = CR_series_title + " " + CR_season_number + " " + CR_episode
End If
ElseIf CR_NameMethode = 1 Then 'name
If CR_season_number = Nothing Then
CR_FilenName = CR_series_title + " " + CR_title
Else
CR_FilenName = CR_season_number + " " + CR_title
CR_FilenName = CR_series_title + " " + CR_season_number + " " + CR_title
End If
ElseIf CR_NameMethode = 2 Then ' nummer - name
If CR_season_number = Nothing Then
CR_FilenName = CR_series_title + " " + CR_episode + " " + CR_title
Else
CR_FilenName = CR_season_number + " " + CR_episode + " " + CR_title
CR_FilenName = CR_series_title + " " + CR_season_number + " " + CR_episode + " " + CR_title
End If
ElseIf CR_NameMethode = 3 Then ' name - nummer
If CR_season_number = Nothing Then
@ -2070,7 +2072,7 @@ Public Class Main
'My.Computer.FileSystem.WriteAllText("log.log", WebbrowserText, False)
Pfad2 = UseSubfolder(CR_series_title, CR_season_title, Pfad)
Pfad2 = UseSubfolder(CR_series_title, CR_season_number, Pfad)
If Not Directory.Exists(Path.GetDirectoryName(Pfad2)) Then
' Nein! Jetzt erstellen...
@ -2396,7 +2398,7 @@ Public Class Main
ListItemAdd(Path.GetFileName(Pfad_DL.Replace(Chr(34), "")), L1Name, L2Name, ResoHTMLDisplay, Subsprache3, SubValuesToDisplay(), thumbnail3, URL_DL, Pfad_DL)
Return Nothing
End Function))
liList.Add(My.Resources.htmlvorThumbnail + thumbnail3 + My.Resources.htmlnachTumbnail + CR_title + " <br> " + CR_season_title + " " + CR_episode + My.Resources.htmlvorAufloesung + ResoHTMLDisplay + My.Resources.htmlvorSoftSubs + vbNewLine + SubValuesToDisplay() + My.Resources.htmlvorHardSubs + Subsprache3 + My.Resources.htmlnachHardSubs + "<!-- " + L2Name + "-->")
liList.Add(My.Resources.htmlvorThumbnail + thumbnail3 + My.Resources.htmlnachTumbnail + CR_title + " <br> " + CR_season_number + " " + CR_episode + My.Resources.htmlvorAufloesung + ResoHTMLDisplay + My.Resources.htmlvorSoftSubs + vbNewLine + SubValuesToDisplay() + My.Resources.htmlvorHardSubs + Subsprache3 + My.Resources.htmlnachHardSubs + "<!-- " + L2Name + "-->")
'Form1.RichTextBox1.Text = My.Resources.htmlvorThumbnail + thumbnail3 + My.Resources.htmlnachTumbnail + CR_Anime_Titel + " <br> " + CR_Anime_Staffel + " " + CR_Anime_Folge + My.Resources.htmlvorAufloesung + ResoHTMLDisplay + My.Resources.htmlvorSoftSubs + vbNewLine + SubValuesToDisplay() + My.Resources.htmlvorHardSubs + Subsprache3 + My.Resources.htmlnachHardSubs + "<!-- " + L2Name + "-->"
#End Region
@ -2937,7 +2939,7 @@ Public Class Main
Return Nothing
End Function))
If TextBox2_Text = Nothing Or TextBox2_Text = "Name of the Anime" Then
If TextBox2_Text = Nothing Or TextBox2_Text = "Use Custom Name" Then
Else
Me.Invoke(New Action(Function()
@ -3960,7 +3962,7 @@ Public Class Main
Return Nothing
End Function))
If TextBox2_Text = Nothing Or TextBox2_Text = "Name of the Anime" Then
If TextBox2_Text = Nothing Or TextBox2_Text = "Use Custom Name" Then
Else
Me.Invoke(New Action(Function()

View File

@ -17,7 +17,7 @@ Public Class Einstellungen
Private Sub Einstellungen_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Label6.Text = "You have: v" + Application.ProductVersion.ToString + " Beta-U11"
Label6.Text = "You have: v" + Application.ProductVersion.ToString + " Beta-U12"
BackgroundWorker1.RunWorkerAsync()

View File

@ -80,7 +80,7 @@ Partial Class network_scan
Me.ComboBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.ComboBox1.FormattingEnabled = True
Me.ComboBox1.ItemHeight = 23
Me.ComboBox1.Items.AddRange(New Object() {"Video Stream", "Subtile"})
Me.ComboBox1.Items.AddRange(New Object() {"Video Stream", "Audio Stream", "Subtile"})
Me.ComboBox1.Location = New System.Drawing.Point(15, 20)
Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(650, 29)

View File

@ -12,6 +12,8 @@ Public Class network_scan
Dim Manager As MetroStyleManager = Main.Manager
Dim SubtitleFormat As String = Nothing
Dim VideoStreams As New List(Of String)
Dim AudioStreams As New List(Of String)
Private Sub network_scan_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ComboBox2.Enabled = False
@ -28,6 +30,66 @@ Public Class network_scan
pictureBox4.Image = My.Resources.main_button_download_deactivate
End Sub
Sub CheckVideoAudio(ByVal url As String)
Dim exepath As String = Application.StartupPath + "\ffmpeg.exe"
Dim startinfo As New System.Diagnostics.ProcessStartInfo
Dim sr As StreamReader
Dim cmd As String = "-headers " + My.Resources.ffmpeg_user_agend + " -i " + Chr(34) + url + Chr(34) 'start ffmpeg with command strFFCMD string
'MsgBox(cmd)
Dim ffmpegOutput As String = Nothing
Dim ffmpegOutputLine As String = Nothing
Dim ffmpegOutputLine2 As String = Nothing
Dim NetworkScanTime As String = Nothing
' all parameters required to run the process
startinfo.FileName = exepath
startinfo.Arguments = cmd
startinfo.UseShellExecute = False
startinfo.WindowStyle = ProcessWindowStyle.Hidden
startinfo.RedirectStandardError = True
startinfo.RedirectStandardOutput = True
startinfo.CreateNoWindow = True
Dim proc As New Process
proc.StartInfo = startinfo
proc.Start() ' start the process
sr = proc.StandardError 'standard error is used by ffmpeg
Do
ffmpegOutputLine = sr.ReadLine
ffmpegOutput = ffmpegOutput + vbNewLine + ffmpegOutputLine
Loop Until proc.HasExited 'And ffmpegOutputLine = Nothing Or ffmpegOutputLine = ""
Dim ffmpegOutput2() As String = ffmpegOutput.Split(New String() {vbNewLine}, System.StringSplitOptions.RemoveEmptyEntries)
For i As Integer = 0 To ffmpegOutput2.Count - 1
If InStr(ffmpegOutput2(i), ": Video:") Then
Dim ZeileReso() As String = ffmpegOutput2(i).Split(New String() {" ["}, System.StringSplitOptions.RemoveEmptyEntries)
Dim ZeileReso2() As String = ZeileReso(0).Split(New String() {"x"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim ZeileReso3() As String = ffmpegOutput2(i).Split(New String() {": Video:"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim ZeileReso4() As String = ZeileReso3(0).Split(New String() {"Stream #"}, System.StringSplitOptions.RemoveEmptyEntries)
If InStr(ZeileReso2(ZeileReso2.Count - 1), ", ") Then
Dim ZeileReso5() As String = ZeileReso2(ZeileReso2.Count - 1).Split(New String() {", "}, System.StringSplitOptions.RemoveEmptyEntries)
ComboBox3.Items.Add(ZeileReso5(0).Trim + ":--:" + ZeileReso4(1))
Else
ComboBox3.Items.Add(ZeileReso2(ZeileReso2.Count - 1).Trim + ":--:" + ZeileReso4(1))
End If
ElseIf InStr(ffmpegOutput2(i), ": Audio:") Then
Dim ZeileStream() As String = ffmpegOutput2(i).Split(New String() {": Audio:"}, System.StringSplitOptions.RemoveEmptyEntries)
ComboBox3.Items.Add("Audio:" + ZeileStream(1))
End If
Next
End Sub
Private Sub PictureBox4_MouseEnter(sender As Object, e As EventArgs) Handles pictureBox4.MouseEnter
If pictureBox4.Enabled = True Then
@ -174,6 +236,10 @@ Public Class network_scan
End If
ElseIf InStr(ffmpegOutput2(i), ": Audio:") Then
Dim ZeileStream() As String = ffmpegOutput2(i).Split(New String() {": Audio:"}, System.StringSplitOptions.RemoveEmptyEntries)
ComboBox3.Items.Add("Audio:" + ZeileStream(1))
ElseIf InStr(ffmpegOutput2(i), "Duration: N/A, bitrate: N/A") Then
@ -226,7 +292,30 @@ Public Class network_scan
FileName = Main.RemoveExtraSpaces(String.Join(" ", FileName.Split(Main.invalids, StringSplitOptions.RemoveEmptyEntries)).TrimEnd("."c)) 'System.Text.RegularExpressions.Regex.Replace(FileName, "[^\w\\-]", " "))
Dim FilePfad As String = Main.Pfad + "\" + FileName
Dim client0 As New WebClient
If InStr(ComboBox3.Text, "Audio:") Then
FilePfad = FilePfad + ".mka"
Dim m3u8Final As String = "-i " + Chr(34) + ComboBox2.Text + Chr(34) + " -c:a copy"
'MsgBox(m3u8Final)
Dim DisplayReso As String = "Audio"
Dim Pfad2 As String = Chr(34) + FilePfad + Chr(34)
Dim Title As String = FileName '+ ".mp4"
Dim L1Name_Split As String() = Main.WebbrowserURL.Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim L1Name As String = L1Name_Split(1)
Me.Invoke(New Action(Function()
Main.ListItemAdd(Main.Pfad, L1Name, Title, DisplayReso, "Unknown", "None", "", m3u8Final, Pfad2)
Main.liList.Add(My.Resources.htmlvorThumbnail + "" + My.Resources.htmlnachTumbnail + "<br>" + Title + My.Resources.htmlvorAufloesung + "[Auto]" + My.Resources.htmlvorSoftSubs + vbNewLine + "None" + My.Resources.htmlvorHardSubs + "null" + My.Resources.htmlnachHardSubs + "<!-- " + Title + "-->")
Return Nothing
End Function))
Else
Dim client0 As New WebClient
client0.Encoding = Encoding.UTF8
If Main.WebbrowserCookie = Nothing Then
Else
@ -325,7 +414,6 @@ Public Class network_scan
Main.liList.Add(My.Resources.htmlvorThumbnail + thumbnail4 + My.Resources.htmlnachTumbnail + "<br>" + Title + My.Resources.htmlvorAufloesung + "[Auto]" + My.Resources.htmlvorSoftSubs + vbNewLine + "None" + My.Resources.htmlvorHardSubs + "null" + My.Resources.htmlnachHardSubs + "<!-- " + Title + "-->")
Return Nothing
End Function))
ElseIf ComboBox1.SelectedItem.ToString = "Subtile" Then
Dim CheckFile As String = Nothing
Main.txtList.Remove(RequestURL)
@ -365,6 +453,7 @@ Public Class network_scan
End If
End If
End Sub
Private Sub ComboBox2_Click(sender As Object, e As EventArgs) Handles ComboBox2.Click