fix hybrid mode key error handling
fix network scan logfile out of memory
This commit is contained in:
hama3254 2020-12-21 12:18:18 +01:00
parent 0dbc0deccc
commit 8ea6abe0e9
13 changed files with 333 additions and 236 deletions

Binary file not shown.

View File

@ -171,105 +171,105 @@ Public Class Anime_Add
End If
If StatusLabel.Text = "Status: waiting for episode selection" Then
If MessageBox.Show("Are you sure you want cancel the advanced download?", "confirm?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
StatusLabel.Text = "Status: idle"
Else
Exit Sub
pictureBox4.Enabled = True
End If
'ElseIf LabelUpdate = "Status: looking for video file" Then
' Exit Sub
' pictureBox4.Enabled = True
Else
If Main.RunningDownloads >= Main.MaxDL Then
ListBox1.Items.Add(textBox1.Text)
textBox1.ForeColor = Color.FromArgb(9248044)
Pause(1)
textBox1.ForeColor = Color.Black
textBox1.Text = "URL"
Else
If Main.Grapp_RDY = True Then
GeckoFX.WebBrowser1.Navigate(textBox1.Text)
StatusLabel.Text = "Status: loading ..."
Main.b = False
End If
End If
End If
ElseIf CBool(InStr(textBox1.Text, "anime-on-demand.de")) Then
Main.b = False
AoD_DubList.Clear()
AoD_OmUList.Clear()
Dim FileLocation As DirectoryInfo = New DirectoryInfo(Application.StartupPath)
Dim CurrentFile As String = Nothing
For Each File In FileLocation.GetFiles()
If InStr(File.FullName, "gecko-network.txt") Then
CurrentFile = File.FullName
Exit For
End If
Next
If CurrentFile = Nothing Then
Else
Dim logFileStream As FileStream = New FileStream(CurrentFile, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite)
Dim logFileReader As StreamReader = New StreamReader(logFileStream)
logFileStream.SetLength(0)
logFileReader.Close()
logFileStream.Close()
End If
Main.LogBrowserData = True
GeckoPreferences.Default("logging.config.LOG_FILE") = "gecko-network.txt"
GeckoPreferences.Default("logging.nsHttp") = 3
GeckoFX.WebBrowser1.Navigate(textBox1.Text)
Do Until Main.b = True
Main.Text = "Status: loading ..."
Main.Invalidate()
StatusLabel.Text = "Status: loading ..."
Pause(1)
Loop
Main.LogBrowserData = False
GeckoPreferences.Default("logging.config.LOG_FILE") = "gecko-network.txt"
GeckoPreferences.Default("logging.nsHttp") = 0
Dim AoD_Cookie As String = Nothing
Dim AoDhttpLog As DirectoryInfo = New DirectoryInfo(Application.StartupPath)
Dim AoDhttpLogFile As String = Nothing
For Each File In AoDhttpLog.GetFiles()
If InStr(File.FullName, "gecko-network.txt") Then
AoDhttpLogFile = File.FullName
Exit For
End If
Next
Dim AoDlogFileStream As FileStream = New FileStream(AoDhttpLogFile, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite)
Dim AoDlogFileReader As StreamReader = New StreamReader(AoDlogFileStream)
Dim line As String = Nothing
Dim HTMLString As String = Nothing
line = AoDlogFileReader.ReadLine
While (line IsNot Nothing)
line = AoDlogFileReader.ReadLine
If CBool(InStr(line, "Cookie: ")) And CBool(InStr(line, "remember_user_token=")) Then
AoD_Cookie = "Cookie: " + line.Split(New String() {"Cookie: "}, System.StringSplitOptions.RemoveEmptyEntries)(1)
Exit While
End If
End While
AoDlogFileReader.Close()
AoDlogFileStream.Close()
If AoD_Cookie = Nothing Then
MsgBox(Main.LoginReminder)
Main.Text = "Crunchyroll Downloader"
Main.Invalidate()
If MessageBox.Show("Are you sure you want cancel the advanced download?", "confirm?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
StatusLabel.Text = "Status: idle"
Else
Exit Sub
pictureBox4.Enabled = True
End If
'MsgBox(AoD_Cookie)
'Main.WebbrowserCookie = AoD_Cookie
If CBool(InStr(Main.WebbrowserText, "/OmU/1080/hlsfirst/")) Then
Dim OmUStreamSplit() As String = Main.WebbrowserText.Split(New String() {"/OmU/1080/hlsfirst/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim OmUStreamSplitToken() As String = OmUStreamSplit(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
Dim OmUStreamSplitEpisodeIndex() As String = OmUStreamSplit(0).Split(New String() {"/videomaterialurl/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim OmUStreamSplitEpisodeIndex2() As String = OmUStreamSplitEpisodeIndex(1).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim m3u8Strings As String = Nothing
'ElseIf LabelUpdate = "Status: looking for video file" Then
' Exit Sub
' pictureBox4.Enabled = True
Else
If Main.RunningDownloads >= Main.MaxDL Then
ListBox1.Items.Add(textBox1.Text)
textBox1.ForeColor = Color.FromArgb(9248044)
Pause(1)
textBox1.ForeColor = Color.Black
textBox1.Text = "URL"
Else
If Main.Grapp_RDY = True Then
GeckoFX.WebBrowser1.Navigate(textBox1.Text)
StatusLabel.Text = "Status: loading ..."
Main.b = False
End If
End If
End If
ElseIf CBool(InStr(textBox1.Text, "anime-on-demand.de")) Then
Main.b = False
AoD_DubList.Clear()
AoD_OmUList.Clear()
Dim FileLocation As DirectoryInfo = New DirectoryInfo(Application.StartupPath)
Dim CurrentFile As String = Nothing
For Each File In FileLocation.GetFiles()
If InStr(File.FullName, "gecko-network.txt") Then
CurrentFile = File.FullName
Exit For
End If
Next
If CurrentFile = Nothing Then
Else
Dim logFileStream As FileStream = New FileStream(CurrentFile, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite)
Dim logFileReader As StreamReader = New StreamReader(logFileStream)
logFileStream.SetLength(0)
logFileReader.Close()
logFileStream.Close()
End If
Main.LogBrowserData = True
GeckoPreferences.Default("logging.config.LOG_FILE") = "gecko-network.txt"
GeckoPreferences.Default("logging.nsHttp") = 3
GeckoFX.WebBrowser1.Navigate(textBox1.Text)
Do Until Main.b = True
Main.Text = "Status: loading ..."
Main.Invalidate()
StatusLabel.Text = "Status: loading ..."
Pause(1)
Loop
Main.LogBrowserData = False
GeckoPreferences.Default("logging.config.LOG_FILE") = "gecko-network.txt"
GeckoPreferences.Default("logging.nsHttp") = 0
Dim AoD_Cookie As String = Nothing
Dim AoDhttpLog As DirectoryInfo = New DirectoryInfo(Application.StartupPath)
Dim AoDhttpLogFile As String = Nothing
For Each File In AoDhttpLog.GetFiles()
If InStr(File.FullName, "gecko-network.txt") Then
AoDhttpLogFile = File.FullName
Exit For
End If
Next
Dim AoDlogFileStream As FileStream = New FileStream(AoDhttpLogFile, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite)
Dim AoDlogFileReader As StreamReader = New StreamReader(AoDlogFileStream)
Dim line As String = Nothing
Dim HTMLString As String = Nothing
line = AoDlogFileReader.ReadLine
While (line IsNot Nothing)
line = AoDlogFileReader.ReadLine
If CBool(InStr(line, "Cookie: ")) And CBool(InStr(line, "remember_user_token=")) Then
AoD_Cookie = "Cookie: " + line.Split(New String() {"Cookie: "}, System.StringSplitOptions.RemoveEmptyEntries)(1)
Exit While
End If
End While
AoDlogFileReader.Close()
AoDlogFileStream.Close()
If AoD_Cookie = Nothing Then
MsgBox(Main.LoginReminder)
Main.Text = "Crunchyroll Downloader"
Main.Invalidate()
StatusLabel.Text = "Status: idle"
Exit Sub
End If
'MsgBox(AoD_Cookie)
'Main.WebbrowserCookie = AoD_Cookie
If CBool(InStr(Main.WebbrowserText, "/OmU/1080/hlsfirst/")) Then
Dim OmUStreamSplit() As String = Main.WebbrowserText.Split(New String() {"/OmU/1080/hlsfirst/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim OmUStreamSplitToken() As String = OmUStreamSplit(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
Dim OmUStreamSplitEpisodeIndex() As String = OmUStreamSplit(0).Split(New String() {"/videomaterialurl/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim OmUStreamSplitEpisodeIndex2() As String = OmUStreamSplitEpisodeIndex(1).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim m3u8Strings As String = Nothing
'I/nsHttp Cookie:
Try
@ -285,27 +285,27 @@ Public Class Anime_Add
'("Sub: " + m3u8Strings)
End Using
Catch ex As Exception
MsgBox(ex.ToString + vbNewLine + "https://www.anime-on-demand.de/videomaterialurl/" + OmUStreamSplitEpisodeIndex2(0) + "/OmU/1080/hlsfirst/" + OmUStreamSplitToken(0))
End Try
If m3u8Strings = Nothing Then
Else
Dim OmUStreams() As String = m3u8Strings.Split(New String() {My.Resources.AoD_files}, System.StringSplitOptions.RemoveEmptyEntries)
For i As Integer = 1 To OmUStreams.Count - 1
AoD_OmUList.Add(OmUStreams(i))
Next
End If
MsgBox(ex.ToString + vbNewLine + "https://www.anime-on-demand.de/videomaterialurl/" + OmUStreamSplitEpisodeIndex2(0) + "/OmU/1080/hlsfirst/" + OmUStreamSplitToken(0))
End Try
If m3u8Strings = Nothing Then
Else
Dim OmUStreams() As String = m3u8Strings.Split(New String() {My.Resources.AoD_files}, System.StringSplitOptions.RemoveEmptyEntries)
For i As Integer = 1 To OmUStreams.Count - 1
AoD_OmUList.Add(OmUStreams(i))
Next
End If
If CBool(InStr(Main.WebbrowserText, "/Dub/1080/hlsfirst/")) Then
Dim DubStreamSplit() As String = Main.WebbrowserText.Split(New String() {"/Dub/1080/hlsfirst/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim DubStreamSplitToken() As String = DubStreamSplit(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
Dim DubStreamSplitEpisodeIndex() As String = DubStreamSplit(0).Split(New String() {"/videomaterialurl/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim DubStreamSplitEpisodeIndex2() As String = DubStreamSplitEpisodeIndex(1).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim m3u8Strings As String = Nothing
'I/nsHttp Cookie:
Try
End If
If CBool(InStr(Main.WebbrowserText, "/Dub/1080/hlsfirst/")) Then
Dim DubStreamSplit() As String = Main.WebbrowserText.Split(New String() {"/Dub/1080/hlsfirst/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim DubStreamSplitToken() As String = DubStreamSplit(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
Dim DubStreamSplitEpisodeIndex() As String = DubStreamSplit(0).Split(New String() {"/videomaterialurl/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim DubStreamSplitEpisodeIndex2() As String = DubStreamSplitEpisodeIndex(1).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim m3u8Strings As String = Nothing
'I/nsHttp Cookie:
Try
Using client As New WebClient()
client.Encoding = System.Text.Encoding.UTF8
client.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), ""))
@ -318,20 +318,20 @@ Public Class Anime_Add
'MsgBox("Dub: " + m3u8Strings)
End Using
Catch ex As Exception
MsgBox(ex.ToString + vbNewLine + "https://www.anime-on-demand.de/videomaterialurl/" + DubStreamSplitEpisodeIndex2(0) + "/Dub/1080/hlsfirst/" + DubStreamSplitToken(0))
End Try
If m3u8Strings = Nothing Then
Else
Dim DubStreams() As String = m3u8Strings.Split(New String() {My.Resources.AoD_files}, System.StringSplitOptions.RemoveEmptyEntries)
For i As Integer = 1 To DubStreams.Count - 1
AoD_DubList.Add(DubStreams(i))
Next
End If
MsgBox(ex.ToString + vbNewLine + "https://www.anime-on-demand.de/videomaterialurl/" + DubStreamSplitEpisodeIndex2(0) + "/Dub/1080/hlsfirst/" + DubStreamSplitToken(0))
End Try
If m3u8Strings = Nothing Then
Else
Dim DubStreams() As String = m3u8Strings.Split(New String() {My.Resources.AoD_files}, System.StringSplitOptions.RemoveEmptyEntries)
For i As Integer = 1 To DubStreams.Count - 1
AoD_DubList.Add(DubStreams(i))
Next
End If
AoD_Mode = True
End If
AoD_Mode = True
If AoD_DubList.Count And AoD_OmUList.Count > 0 Then
ComboBox1.Items.Clear()
GroupBox3.Visible = False
@ -355,28 +355,42 @@ Public Class Anime_Add
End If
ElseIf CBool(InStr(textBox1.Text, "Test=true")) Then
GeckoFX.WebBrowser1.Navigate(textBox1.Text)
Else 'If CBool(InStr(textBox1.Text, "vrv.co")) Then
If MessageBox.Show("This in NOT a Crunchyroll URL, try anyway?", "confirm?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
GeckoFX.WebBrowser1.Navigate(textBox1.Text)
Else 'If CBool(InStr(textBox1.Text, "vrv.co")) Then
If MessageBox.Show("This in NOT a Crunchyroll URL, try anyway?", "confirm?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
Dim FileLocation As DirectoryInfo = New DirectoryInfo(Application.StartupPath)
Dim CurrentFile As String = Nothing
For Each File In FileLocation.GetFiles()
If InStr(File.FullName, "gecko-network.txt") Then
CurrentFile = File.FullName
Try
File.Delete()
Catch ex As Exception
End Try
End If
Next
Main.LogBrowserData = True
GeckoPreferences.Default("logging.config.LOG_FILE") = "gecko-network.txt"
GeckoPreferences.Default("logging.nsHttp") = 3
For Each File In FileLocation.GetFiles()
If InStr(File.FullName, "gecko-network.txt") Then
Main.GeckoLogFile = File.FullName
Exit For
End If
Next
If CurrentFile = Nothing Then
If Main.GeckoLogFile = Nothing Then
StatusLabel.Text = "Status: error reading network traffic"
Exit Sub
Else
Dim logFileStream As FileStream = New FileStream(CurrentFile, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite)
'MsgBox(Main.GeckoLogFile)
Dim logFileStream As FileStream = New FileStream(Main.GeckoLogFile, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite)
Dim logFileReader As StreamReader = New StreamReader(logFileStream)
logFileStream.SetLength(0)
logFileReader.Close()
logFileStream.Close()
End If
Main.LogBrowserData = True
GeckoPreferences.Default("logging.config.LOG_FILE") = "gecko-network.txt"
GeckoPreferences.Default("logging.nsHttp") = 3
GeckoFX.WebBrowser1.Navigate(textBox1.Text)
StatusLabel.Text = "Status: looking for non CR video file"
Main.b = False

View File

@ -235,7 +235,8 @@ Public Class CRD_List_Item
ElseIf Result = DialogResult.Retry Then
If FailedSegments.Count > 0 Then
For i As Integer = 0 To FailedSegments.Count - 1
Dim Evaluator = New Thread(Sub() Me.TS_DownloadAsync(FailedSegments.Item(i).url, FailedSegments.Item(i).path))
Dim ii As Integer = i
Dim Evaluator = New Thread(Sub() Me.TS_DownloadAsync(FailedSegments.Item(ii).url, FailedSegments.Item(ii).path))
FailedSegments.RemoveAt(i)
Evaluator.Start()
ThreadList.Add(Evaluator)
@ -734,33 +735,31 @@ Public Class CRD_List_Item
Dim retry As Boolean = True
Dim retryCount As Integer = 3
While retry
Try
KeyClient.DownloadFile(KeyFile2(0), Application.StartupPath + "\" + KeyFile3)
retry = False
Catch ex As Exception
If retryCount > 0 Then
retryCount = retryCount - 1
Me.Invoke(New Action(Function()
Label_percent.Text = "Access Error - retrying"
Return Nothing
End Function))
Try
KeyClient.DownloadFile(KeyFile2(0), Application.StartupPath + "\" + KeyFile3)
retry = False
Catch ex As Exception
If retryCount > 0 Then
retryCount = retryCount - 1
Me.Invoke(New Action(Function()
Label_percent.Text = "Access Error - retrying"
Return Nothing
End Function))
Else
'retry = False
Me.Invoke(New Action(Function()
Label_percent.Text = "Access Error - download canceled"
Return Nothing
End Function))
Return Nothing
Exit Function
Else
Me.Invoke(New Action(Function()
Label_percent.Text = "Access Error - download canceled"
Return Nothing
End Function))
Return Nothing
Exit Function
'Dim utf8WithoutBom2 As New System.Text.UTF8Encoding(False)
'Using sink As New StreamWriter(SubsFile, False, utf8WithoutBom2)
' sink.WriteLine(My.Resources.ass_template)
'End Using
'Retry = False
End If
End Try
End If
End Try
End While
LoadedKeys.Add(KeyFile2(0))
End If
If KeyFile2.Count > 1 Then

View File

@ -119,7 +119,7 @@ Public Class GeckoFX
If Main.d = False Then
Main.d = True
Main.SeasonDropdownGrappSubs()
einstellungen.StatusLabel.Text = "Status: Multi Download detected!"
Einstellungen.StatusLabel.Text = "Status: Multi Download detected!"
Else
Main.SeasonDropdownGrapp()
End If
@ -132,7 +132,7 @@ Public Class GeckoFX
If Main.d = False Then
Main.d = True
Main.MassGrappSubs()
einstellungen.StatusLabel.Text = "Status: Multi Download detected!"
Einstellungen.StatusLabel.Text = "Status: Multi Download detected!"
Else
Main.MassGrapp()
@ -206,75 +206,129 @@ Public Class GeckoFX
End If
Else
If Main.b = False Then
Main.WebbrowserURL = WebBrowser1.Url.ToString
Main.WebbrowserText = WebBrowser1.Document.Body.OuterHtml
Main.WebbrowserTitle = WebBrowser1.DocumentTitle
If Main.b = False Then
Main.b = True
Main.UserBowser = True
For i As Integer = 20 To 0 Step -1
Pause(1)
Anime_Add.StatusLabel.Text = "Status: scanning network traffic " + Math.Abs(i).ToString
Next
Anime_Add.StatusLabel.Text = "Status: "
Dim FileLocation As DirectoryInfo = New DirectoryInfo(Application.StartupPath)
Dim CurrentFile As String = Nothing
For Each File In FileLocation.GetFiles()
If InStr(File.FullName, "gecko-network.txt") Then
CurrentFile = File.FullName
Exit For
End If
Next
Dim logFileStream As FileStream = New FileStream(CurrentFile, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite)
Main.WebbrowserURL = WebBrowser1.Url.ToString
Main.WebbrowserText = WebBrowser1.Document.Body.OuterHtml
Main.WebbrowserTitle = WebBrowser1.DocumentTitle
Main.LogBrowserData = False
GeckoPreferences.Default("logging.config.LOG_FILE") = "gecko-network.txt"
GeckoPreferences.Default("logging.nsHttp") = 0
Dim SubtitleName As String = Main.WebbrowserTitle.Replace(" - Watch on VRV", "").Replace("Free Streaming", "").Replace("Tubi", "")
SubtitleName = Main.RemoveExtraSpaces(System.Text.RegularExpressions.Regex.Replace(SubtitleName, "[^\w\\-]", " "))
Dim SubtitlePfad As String = Main.Pfad + "\" + SubtitleName
Dim logFileStream As FileStream = New FileStream(Main.GeckoLogFile, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite)
Dim logFileReader As StreamReader = New StreamReader(logFileStream)
Dim line As String = Nothing
Dim HTMLString As String = Nothing
line = logFileReader.ReadLine
Dim Requests As New List(Of String)
Dim LogText As String = Nothing
Dim line As String = logFileReader.ReadLine
While (line IsNot Nothing)
line = logFileReader.ReadLine
If InStr(line, ".m3u8") Then 'm3u8?
If HTMLString = Nothing Then
HTMLString = line
Else
HTMLString = HTMLString + vbNewLine + line
End If
For i As Integer = 0 To 10
line = logFileReader.ReadLine
If InStr(line, " Host: ") Then
HTMLString = HTMLString + vbNewLine + line
End If
Next
If InStr(line, "I/nsHttp http request [") Then
For i As Integer = 0 To 25
line = logFileReader.ReadLine
If InStr(line, "I/nsHttp ]") Then
Exit For
Else
LogText = LogText + line + vbNewLine
End If
Next
Requests.Add(LogText)
LogText = Nothing
End If
End While
logFileReader.Close()
logFileStream.Close()
'MsgBox(HTMLString)
If InStr(HTMLString, ".m3u8") Then 'm3u8?
Anime_Add.StatusLabel.Text = "Status: m3u8 found, trying to start the download"
Main.LogBrowserData = False
GeckoPreferences.Default("logging.config.LOG_FILE") = "gecko-network.txt"
GeckoPreferences.Default("logging.nsHttp") = 0
Dim URL As String = Nothing
Dim HTMLSplit() As String = HTMLString.Split(New String() {vbNewLine}, System.StringSplitOptions.RemoveEmptyEntries)
For i As Integer = 0 To HTMLSplit.Count - 1
If InStr(HTMLSplit(i), ".m3u8") Then 'm3u8?
Dim URLPart2() As String = HTMLSplit(i).Split(New String() {" GET "}, System.StringSplitOptions.RemoveEmptyEntries)
Dim URLPart2Split2() As String = URLPart2(1).Split(New String() {" HTTP/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim URLPart1() As String = HTMLSplit(i + 1).Split(New String() {" Host: "}, System.StringSplitOptions.RemoveEmptyEntries)
Main.NonCR_URL = "https://" + URLPart1(1) + URLPart2Split2(0)
'MsgBox(Main.NonCR_URL)
'RichTextBox1.Text = RichTextBox1.Text + vbNewLine + URL_Final
t = New Thread(AddressOf Main.Grapp_non_CR)
t.Priority = ThreadPriority.Normal
t.IsBackground = True
t.Start()
Main.UserBowser = False
Exit For
Me.Close()
logFileReader.Dispose()
logFileStream.Dispose()
'Dim Requests() As String = LogText.Split(New String() {"I/nsHttp http request ["}, System.StringSplitOptions.RemoveEmptyEntries)
Dim client0 As New WebClient
client0.Encoding = Encoding.UTF8
If WebBrowser1.Document.Cookie = Nothing Then
Else
client0.Headers.Add(HttpRequestHeader.Cookie, WebBrowser1.Document.Cookie)
End If
For i As Integer = 1 To Requests.Count - 1
'Dim Requests2() As String = Requests.Item(i).Split(New String() {"I/nsHttp ]"}, System.StringSplitOptions.RemoveEmptyEntries)
If InStr(Requests.Item(i), " GET ") Then
Dim URLPath() As String = Requests.Item(i).Split(New String() {" GET "}, System.StringSplitOptions.RemoveEmptyEntries)
Dim URLPath2() As String = URLPath(1).Split(New String() {" HTTP/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim URLHost1() As String = Requests.Item(i).Split(New String() {" Host: "}, System.StringSplitOptions.RemoveEmptyEntries)
Dim URLHost2() As String = URLHost1(1).Split(New String() {vbNewLine}, System.StringSplitOptions.RemoveEmptyEntries)
Dim RequestURL As String = "https://" + URLHost2(0) + URLPath2(0)
If InStr(RequestURL, ".m3u8") Then
Dim str0 As String = client0.DownloadString(RequestURL)
If InStr(str0, "#EXTM3U") Then
Main.m3u8List.Add(RequestURL)
End If
ElseIf InStr(RequestURL, ".mpd") Then
Main.mpdList.Add(RequestURL)
ElseIf InStr(RequestURL, ".txt") Then
Main.txtList.Add(RequestURL)
client0.DownloadFileAsync(New Uri(RequestURL), SubtitlePfad + ".txt")
ElseIf InStr(RequestURL, ".vtt") Then
Main.txtList.Add(RequestURL)
client0.DownloadFileAsync(New Uri(RequestURL), SubtitlePfad + ".vtt")
ElseIf InStr(RequestURL, ".srt") Then
Main.txtList.Add(RequestURL)
client0.DownloadFileAsync(New Uri(RequestURL), SubtitlePfad + ".srt")
ElseIf InStr(RequestURL, ".ass") Then
Main.txtList.Add(RequestURL)
client0.DownloadFileAsync(New Uri(RequestURL), SubtitlePfad + ".ass")
ElseIf InStr(RequestURL, ".ssa") Then
Main.txtList.Add(RequestURL)
client0.DownloadFileAsync(New Uri(RequestURL), SubtitlePfad + ".ssa")
ElseIf InStr(RequestURL, ".dfxp") Then
Main.txtList.Add(RequestURL)
client0.DownloadFileAsync(New Uri(RequestURL), SubtitlePfad + ".dfxp")
End If
Next
End If
Next
If Main.m3u8List.Count > 0 Then
Main.NonCR_URL = Main.m3u8List.Item(0)
Main.FFMPEG_Reso(Main.NonCR_URL)
t = New Thread(AddressOf Main.Grapp_non_CR)
t.Priority = ThreadPriority.Normal
t.IsBackground = True
t.Start()
ElseIf Main.mpdList.Count > 0 Then
Main.NonCR_URL = Main.mpdList.Item(0)
Main.FFMPEG_Reso(Main.NonCR_URL)
t = New Thread(AddressOf Main.Grapp_non_CR)
t.Priority = ThreadPriority.Normal
t.IsBackground = True
t.Start()
Else
Anime_Add.StatusLabel.Text = "Status: no m3u8 found, analyzing HTML content"
WebBrowser1.Navigate("view-source:" + Main.WebbrowserURL)
@ -338,13 +392,14 @@ Public Class GeckoFX
End If
End If
End If
End If
If Main.UserBowser = False Then
If Main.b = True Then
Anime_Add.StatusLabel.Text = "Status: idle"
Me.Close()
End If
End If
End If
'End If
End Sub
Private Sub GeckoFX_Load(sender As Object, e As EventArgs) Handles MyBase.Load
@ -551,6 +606,11 @@ Public Class GeckoFX
Pause(1)
Button2.Text = "network scan is in progess " + Math.Abs(i).ToString
Next
Main.LogBrowserData = False
GeckoPreferences.Default("logging.config.LOG_FILE") = "gecko-network.txt"
GeckoPreferences.Default("logging.nsHttp") = 0
Main.WebbrowserURL = WebBrowser1.Url.ToString
Main.WebbrowserText = WebBrowser1.Document.Body.OuterHtml
Main.WebbrowserTitle = WebBrowser1.DocumentTitle
@ -559,8 +619,33 @@ Public Class GeckoFX
SubtitleName = Main.RemoveExtraSpaces(System.Text.RegularExpressions.Regex.Replace(SubtitleName, "[^\w\\-]", " "))
Dim SubtitlePfad As String = Main.Pfad + "\" + SubtitleName
Dim LogText As String = logFileReader.ReadToEnd
Dim Requests() As String = LogText.Split(New String() {"I/nsHttp http request ["}, System.StringSplitOptions.RemoveEmptyEntries)
Dim Requests As New List(Of String)
Dim LogText As String = Nothing
Dim line As String = logFileReader.ReadLine
While (line IsNot Nothing)
line = logFileReader.ReadLine
If InStr(line, "I/nsHttp http request [") Then
For i As Integer = 0 To 25
line = logFileReader.ReadLine
If InStr(line, "I/nsHttp ]") Then
Exit For
Else
LogText = LogText + line + vbNewLine
End If
Next
Requests.Add(LogText)
LogText = Nothing
End If
End While
logFileReader.Dispose()
logFileStream.Dispose()
Dim client0 As New WebClient
client0.Encoding = Encoding.UTF8
If WebBrowser1.Document.Cookie = Nothing Then
@ -568,46 +653,45 @@ Public Class GeckoFX
client0.Headers.Add(HttpRequestHeader.Cookie, WebBrowser1.Document.Cookie)
End If
For i As Integer = 1 To Requests.Count - 1
Dim Requests2() As String = Requests(i).Split(New String() {"I/nsHttp ]"}, System.StringSplitOptions.RemoveEmptyEntries)
If InStr(Requests2(0), " GET ") Then
If InStr(Requests.Item(i), " GET ") Then
Dim URLPath() As String = Requests2(0).Split(New String() {" GET "}, System.StringSplitOptions.RemoveEmptyEntries)
Dim URLPath() As String = Requests.Item(i).Split(New String() {" GET "}, System.StringSplitOptions.RemoveEmptyEntries)
Dim URLPath2() As String = URLPath(1).Split(New String() {" HTTP/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim URLHost1() As String = Requests2(0).Split(New String() {" Host: "}, System.StringSplitOptions.RemoveEmptyEntries)
Dim URLHost1() As String = Requests.Item(i).Split(New String() {" Host: "}, System.StringSplitOptions.RemoveEmptyEntries)
Dim URLHost2() As String = URLHost1(1).Split(New String() {vbNewLine}, System.StringSplitOptions.RemoveEmptyEntries)
Dim RequestURL As String = "https://" + URLHost2(0) + URLPath2(0)
If InStr(Requests2(0), ".m3u8") Then
If InStr(RequestURL, ".m3u8") Then
Dim str0 As String = client0.DownloadString(RequestURL)
If InStr(str0, "#EXTM3U") Then
Main.m3u8List.Add(RequestURL)
End If
ElseIf InStr(Requests2(0), ".mpd") Then
ElseIf InStr(RequestURL, ".mpd") Then
Main.mpdList.Add(RequestURL)
ElseIf InStr(Requests2(0), ".txt") Then
ElseIf InStr(RequestURL, ".txt") Then
Main.txtList.Add(RequestURL)
client0.DownloadFileAsync(New Uri(RequestURL), SubtitlePfad + ".txt")
ElseIf InStr(Requests2(0), ".vtt") Then
ElseIf InStr(RequestURL, ".vtt") Then
Main.txtList.Add(RequestURL)
client0.DownloadFileAsync(New Uri(RequestURL), SubtitlePfad + ".vtt")
ElseIf InStr(Requests2(0), ".srt") Then
ElseIf InStr(RequestURL, ".srt") Then
Main.txtList.Add(RequestURL)
client0.DownloadFileAsync(New Uri(RequestURL), SubtitlePfad + ".srt")
ElseIf InStr(Requests2(0), ".ass") Then
ElseIf InStr(RequestURL, ".ass") Then
Main.txtList.Add(RequestURL)
client0.DownloadFileAsync(New Uri(RequestURL), SubtitlePfad + ".ass")
ElseIf InStr(Requests2(0), ".ssa") Then
ElseIf InStr(RequestURL, ".ssa") Then
Main.txtList.Add(RequestURL)
client0.DownloadFileAsync(New Uri(RequestURL), SubtitlePfad + ".ssa")
ElseIf InStr(Requests2(0), ".dfxp") Then
ElseIf InStr(RequestURL, ".dfxp") Then
Main.txtList.Add(RequestURL)
client0.DownloadFileAsync(New Uri(RequestURL), SubtitlePfad + ".dfxp")
End If
@ -634,7 +718,6 @@ Public Class GeckoFX
End If
ScanTrue = False
Button2.Enabled = True
Catch ex As Exception

View File

@ -68,6 +68,7 @@ Public Class Main
Public TempSoftSubs As New List(Of String)
Public AbourtList As New List(Of String)
Public watingList As New List(Of String)
Public GeckoLogFile As String = Nothing
Dim SoftSubsString As String
Dim CR_Unlock_Error As String
Public Startseite As String = "https://www.crunchyroll.com/"

View File

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