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 End If
If StatusLabel.Text = "Status: waiting for episode selection" Then 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 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()
StatusLabel.Text = "Status: idle" StatusLabel.Text = "Status: idle"
Else
Exit Sub Exit Sub
pictureBox4.Enabled = True
End If End If
'MsgBox(AoD_Cookie) 'ElseIf LabelUpdate = "Status: looking for video file" Then
'Main.WebbrowserCookie = AoD_Cookie ' Exit Sub
If CBool(InStr(Main.WebbrowserText, "/OmU/1080/hlsfirst/")) Then ' pictureBox4.Enabled = True
Dim OmUStreamSplit() As String = Main.WebbrowserText.Split(New String() {"/OmU/1080/hlsfirst/"}, System.StringSplitOptions.RemoveEmptyEntries) Else
Dim OmUStreamSplitToken() As String = OmUStreamSplit(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) If Main.RunningDownloads >= Main.MaxDL Then
Dim OmUStreamSplitEpisodeIndex() As String = OmUStreamSplit(0).Split(New String() {"/videomaterialurl/"}, System.StringSplitOptions.RemoveEmptyEntries) ListBox1.Items.Add(textBox1.Text)
Dim OmUStreamSplitEpisodeIndex2() As String = OmUStreamSplitEpisodeIndex(1).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries) textBox1.ForeColor = Color.FromArgb(9248044)
Dim m3u8Strings As String = Nothing 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: 'I/nsHttp Cookie:
Try Try
@ -285,27 +285,27 @@ Public Class Anime_Add
'("Sub: " + m3u8Strings) '("Sub: " + m3u8Strings)
End Using End Using
Catch ex As Exception Catch ex As Exception
MsgBox(ex.ToString + vbNewLine + "https://www.anime-on-demand.de/videomaterialurl/" + OmUStreamSplitEpisodeIndex2(0) + "/OmU/1080/hlsfirst/" + OmUStreamSplitToken(0)) MsgBox(ex.ToString + vbNewLine + "https://www.anime-on-demand.de/videomaterialurl/" + OmUStreamSplitEpisodeIndex2(0) + "/OmU/1080/hlsfirst/" + OmUStreamSplitToken(0))
End Try End Try
If m3u8Strings = Nothing Then If m3u8Strings = Nothing Then
Else 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
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 End If
If CBool(InStr(Main.WebbrowserText, "/Dub/1080/hlsfirst/")) Then End If
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) If CBool(InStr(Main.WebbrowserText, "/Dub/1080/hlsfirst/")) Then
Dim DubStreamSplitEpisodeIndex() As String = DubStreamSplit(0).Split(New String() {"/videomaterialurl/"}, System.StringSplitOptions.RemoveEmptyEntries) Dim DubStreamSplit() As String = Main.WebbrowserText.Split(New String() {"/Dub/1080/hlsfirst/"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim DubStreamSplitEpisodeIndex2() As String = DubStreamSplitEpisodeIndex(1).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries) Dim DubStreamSplitToken() As String = DubStreamSplit(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
Dim m3u8Strings As String = Nothing Dim DubStreamSplitEpisodeIndex() As String = DubStreamSplit(0).Split(New String() {"/videomaterialurl/"}, System.StringSplitOptions.RemoveEmptyEntries)
'I/nsHttp Cookie: Dim DubStreamSplitEpisodeIndex2() As String = DubStreamSplitEpisodeIndex(1).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries)
Try Dim m3u8Strings As String = Nothing
'I/nsHttp Cookie:
Try
Using client As New WebClient() Using client As New WebClient()
client.Encoding = System.Text.Encoding.UTF8 client.Encoding = System.Text.Encoding.UTF8
client.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), "")) client.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), ""))
@ -318,20 +318,20 @@ Public Class Anime_Add
'MsgBox("Dub: " + m3u8Strings) 'MsgBox("Dub: " + m3u8Strings)
End Using End Using
Catch ex As Exception Catch ex As Exception
MsgBox(ex.ToString + vbNewLine + "https://www.anime-on-demand.de/videomaterialurl/" + DubStreamSplitEpisodeIndex2(0) + "/Dub/1080/hlsfirst/" + DubStreamSplitToken(0)) MsgBox(ex.ToString + vbNewLine + "https://www.anime-on-demand.de/videomaterialurl/" + DubStreamSplitEpisodeIndex2(0) + "/Dub/1080/hlsfirst/" + DubStreamSplitToken(0))
End Try End Try
If m3u8Strings = Nothing Then If m3u8Strings = Nothing Then
Else 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
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 End If
AoD_Mode = True
End If
AoD_Mode = True
If AoD_DubList.Count And AoD_OmUList.Count > 0 Then If AoD_DubList.Count And AoD_OmUList.Count > 0 Then
ComboBox1.Items.Clear() ComboBox1.Items.Clear()
GroupBox3.Visible = False GroupBox3.Visible = False
@ -355,28 +355,42 @@ Public Class Anime_Add
End If End If
ElseIf CBool(InStr(textBox1.Text, "Test=true")) Then ElseIf CBool(InStr(textBox1.Text, "Test=true")) Then
GeckoFX.WebBrowser1.Navigate(textBox1.Text) GeckoFX.WebBrowser1.Navigate(textBox1.Text)
Else 'If CBool(InStr(textBox1.Text, "vrv.co")) Then 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 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 FileLocation As DirectoryInfo = New DirectoryInfo(Application.StartupPath)
Dim CurrentFile As String = Nothing
For Each File In FileLocation.GetFiles() For Each File In FileLocation.GetFiles()
If InStr(File.FullName, "gecko-network.txt") Then 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 Exit For
End If End If
Next Next
If CurrentFile = Nothing Then If Main.GeckoLogFile = Nothing Then
StatusLabel.Text = "Status: error reading network traffic"
Exit Sub
Else 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) Dim logFileReader As StreamReader = New StreamReader(logFileStream)
logFileStream.SetLength(0) logFileStream.SetLength(0)
logFileReader.Close() logFileReader.Close()
logFileStream.Close() logFileStream.Close()
End If End If
Main.LogBrowserData = True
GeckoPreferences.Default("logging.config.LOG_FILE") = "gecko-network.txt"
GeckoPreferences.Default("logging.nsHttp") = 3
GeckoFX.WebBrowser1.Navigate(textBox1.Text) GeckoFX.WebBrowser1.Navigate(textBox1.Text)
StatusLabel.Text = "Status: looking for non CR video file" StatusLabel.Text = "Status: looking for non CR video file"
Main.b = False Main.b = False

View File

@ -235,7 +235,8 @@ Public Class CRD_List_Item
ElseIf Result = DialogResult.Retry Then ElseIf Result = DialogResult.Retry Then
If FailedSegments.Count > 0 Then If FailedSegments.Count > 0 Then
For i As Integer = 0 To FailedSegments.Count - 1 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) FailedSegments.RemoveAt(i)
Evaluator.Start() Evaluator.Start()
ThreadList.Add(Evaluator) ThreadList.Add(Evaluator)
@ -734,33 +735,31 @@ Public Class CRD_List_Item
Dim retry As Boolean = True Dim retry As Boolean = True
Dim retryCount As Integer = 3 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 Else
KeyClient.DownloadFile(KeyFile2(0), Application.StartupPath + "\" + KeyFile3) 'retry = False
retry = False Me.Invoke(New Action(Function()
Catch ex As Exception Label_percent.Text = "Access Error - download canceled"
If retryCount > 0 Then Return Nothing
retryCount = retryCount - 1 End Function))
Me.Invoke(New Action(Function() Return Nothing
Label_percent.Text = "Access Error - retrying" Exit Function
Return Nothing
End Function))
Else End If
Me.Invoke(New Action(Function() End Try
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 While
LoadedKeys.Add(KeyFile2(0)) LoadedKeys.Add(KeyFile2(0))
End If End If
If KeyFile2.Count > 1 Then If KeyFile2.Count > 1 Then

View File

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

View File

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

View File

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