diff --git a/.vs/Crunchyroll Downloader/v17/.suo b/.vs/Crunchyroll Downloader/v17/.suo
index ca0be91..69ff4a7 100644
Binary files a/.vs/Crunchyroll Downloader/v17/.suo and b/.vs/Crunchyroll Downloader/v17/.suo differ
diff --git a/Crunchyroll Downloader/Anime_Add.vb b/Crunchyroll Downloader/Anime_Add.vb
index 5d224c6..d692a6f 100644
--- a/Crunchyroll Downloader/Anime_Add.vb
+++ b/Crunchyroll Downloader/Anime_Add.vb
@@ -30,8 +30,11 @@ Public Class Anime_Add
Dim locale As String = "en-US"
If CBool(InStr(Url, "crunchyroll.com")) = True And CBool(InStr(Url, "watch")) = True And CBool(Main.CrBetaBasic = Nothing) = False Then
#Region "Get Cookies"
- Dim Cookies As String = Main.CR_Cookies '"Cookie: "
+ Main.CR_Cookies = "Cookie: "
Try
+ Dim rk As RegistryKey = Registry.CurrentUser.CreateSubKey("Software\CRDownloader")
+ Dim etp_rt As Boolean = False
+ Dim ajs_user_id As Boolean = False
Dim Collector As New TaskCookieVisitor
Dim CM As ICookieManager = CefSharp_Browser.WebBrowser1.GetCookieManager
CM.VisitAllCookies(Collector)
@@ -39,24 +42,62 @@ Public Class Anime_Add
Dim list As List(Of Global.CefSharp.Cookie) = Collector.Task.Result()
For i As Integer = 0 To list.Count - 1
+ '__cf_bm
If CBool(InStr(list.Item(i).Domain, ".crunchyroll.com")) And CBool(InStr(list.Item(i).Name, "_evidon_suppress")) = False Then
- Cookies = Cookies + list.Item(i).Name + "=" + list.Item(i).Value + ";"
+ Main.CR_Cookies = Main.CR_Cookies + list.Item(i).Name + "=" + list.Item(i).Value + ";"
End If
If CBool(InStr(list.Item(i).Domain, ".crunchyroll.com")) And CBool(InStr(list.Item(i).Name, "c_locale")) Then
locale = list.Item(i).Value
End If
- If CBool(InStr(list.Item(i).Domain, ".crunchyroll.com")) And CBool(InStr(list.Item(i).Name, "etp_rt")) Then
- 'MsgBox(list.Item(i).Domain + ":" + list.Item(i).Name + ":" + vbNewLine + list.Item(i).Value)
+ If CBool(InStr(list.Item(i).Domain, ".crunchyroll.com")) = True And CBool(InStr(list.Item(i).Name, "etp_rt")) = True And Main.CheckCRLogin = True And Main.CR_etp_rt = Nothing Then
+ Debug.WriteLine("etp_rt = True")
+ etp_rt = True
+ Main.CR_etp_rt = list.Item(i).Value
+ rk.SetValue("etp_rt", Main.CR_etp_rt, RegistryValueKind.String)
+ ElseIf CBool(InStr(list.Item(i).Domain, ".crunchyroll.com")) = True And CBool(InStr(list.Item(i).Name, "__cf_bm")) = True = True And Main.CheckCRLogin = True And Main.CR_ajs_user_id = Nothing Then
+ 'MsgBox(list.Item(i).Value)
+ Debug.WriteLine("ajs_user_id = True")
+ ajs_user_id = True
+ Main.CR_ajs_user_id = list.Item(i).Value
+ rk.SetValue("ajs_user_id", Main.CR_ajs_user_id, RegistryValueKind.String)
End If
Next
+
+
+
+ If Main.CR_etp_rt IsNot Nothing And etp_rt = False Then
+ Main.CR_Cookies = "Cookie: " + "etp_rt" + "=" + Main.CR_etp_rt + ";" + Main.CR_Cookies.Replace("Cookie: ", "")
+ Dim etp_rt_cookie As New CefSharp.Cookie
+ etp_rt_cookie.Name = "etp_rt"
+ etp_rt_cookie.Value = Main.CR_etp_rt
+ etp_rt_cookie.HttpOnly = True
+ etp_rt_cookie.Domain = ".crunchyroll.com"
+ Debug.WriteLine("Set etp_rt_cookie: " + CM.SetCookieAsync("http://www.crunchyroll.com", etp_rt_cookie).Result.ToString)
+ End If
+
+ If Main.CR_ajs_user_id IsNot Nothing And ajs_user_id = False Then
+ Main.CR_Cookies = Main.CR_Cookies + "ajs_user_id" + "=" + Main.CR_ajs_user_id + ";"
+ Dim ajs_user_id_cookie As New CefSharp.Cookie
+ ajs_user_id_cookie.Name = "__cf_bm"
+ ajs_user_id_cookie.Value = Main.CR_ajs_user_id
+ ajs_user_id_cookie.HttpOnly = True
+ ajs_user_id_cookie.Domain = ".crunchyroll.com"
+ Debug.WriteLine("Set ajs_user_id_cookie: " + CM.SetCookieAsync("http://www.crunchyroll.com", ajs_user_id_cookie).Result.ToString)
+ End If
+
+
+
Catch ex As Exception
CefSharp_Browser.WebBrowser1.Load(Url)
Exit Sub
End Try
+
+
+
'MsgBox(Cookies)
- Cookies = " -H " + Chr(34) + Cookies + Chr(34)
+ Main.CR_Cookies = " -H " + Chr(34) + Main.CR_Cookies + Chr(34)
#End Region
Dim Auth As String = " -H " + Chr(34) + "Authorization: " + Main.CrBetaBasic + Chr(34)
@@ -64,10 +105,10 @@ Public Class Anime_Add
Dim CRBetaBearer As String = "Bearer "
- Dim v1Token As String = Main.CurlPost("https://www.crunchyroll.com/auth/v1/token", Cookies, Auth, Post)
+ Dim v1Token As String = Main.CurlPost("https://www.crunchyroll.com/auth/v1/token", Main.CR_Cookies, Auth, Post)
If CBool(InStr(v1Token, "curl:")) = True Then
- v1Token = Main.CurlPost("https://www.crunchyroll.com/auth/v1/token", Cookies, Auth, Post)
+ v1Token = Main.CurlPost("https://www.crunchyroll.com/auth/v1/token", Main.CR_Cookies, Auth, Post)
End If
If CBool(InStr(v1Token, "curl:")) = True Then
@@ -94,12 +135,12 @@ Public Class Anime_Add
' client.Headers.Add(Cookies) '+ WebBrowser1.Document.Cookie)
'MsgBox(OmUStreamSplitEpisodeIndex(1))
Dim Auth2 As String = " -H " + Chr(34) + "Authorization: " + CRBetaBearer + Chr(34)
- Dim v2Content As String = Main.CurlAuth("https://www.crunchyroll.com/index/v2", Cookies, Auth2) 'client.DownloadString("https://www.crunchyroll.com/index/v2")
+ Dim v2Content As String = Main.CurlAuth("https://www.crunchyroll.com/index/v2", Main.CR_Cookies, Auth2) 'client.DownloadString("https://www.crunchyroll.com/index/v2")
'Debug.WriteLine(v2Content)
'MsgBox("v2: " + v2Content)
If CBool(InStr(v2Content, "curl:")) = True Then
- v2Content = Main.CurlAuth("https://www.crunchyroll.com/index/v2", Cookies, Auth2)
+ v2Content = Main.CurlAuth("https://www.crunchyroll.com/index/v2", Main.CR_Cookies, Auth2)
End If
If CBool(InStr(v2Content, "curl:")) = True Then
diff --git a/Crunchyroll Downloader/CefSharp_Browser.vb b/Crunchyroll Downloader/CefSharp_Browser.vb
index 8babe34..ddeaddb 100644
--- a/Crunchyroll Downloader/CefSharp_Browser.vb
+++ b/Crunchyroll Downloader/CefSharp_Browser.vb
@@ -34,7 +34,6 @@ Public Class CefSharp_Browser
Me.Invoke(New Action(Function() As Object
-
Main.LoadedUrls.Clear()
Debug.WriteLine("FrameLoadEnd" + Date.Now.ToString)
Main.WebbrowserURL = WebBrowser1.Address
@@ -147,28 +146,10 @@ Public Class CefSharp_Browser
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Dim locale As String = "en-US"
- Main.CR_Cookies = "Cookies: "
- Try
- Dim Collector As New TaskCookieVisitor
- Dim CM As ICookieManager = WebBrowser1.GetCookieManager
- CM.VisitAllCookies(Collector)
- Dim DeviceRegion As String = Nothing
- Dim list As List(Of Global.CefSharp.Cookie) = Collector.Task.Result()
- For i As Integer = 0 To list.Count - 1
- If CBool(InStr(list.Item(i).Domain, ".crunchyroll.com")) = True And CBool(InStr(list.Item(i).Name, "_evidon_suppress")) = False Then
- Main.CR_Cookies = Main.CR_Cookies + list.Item(i).Name + "=" + list.Item(i).Value + ";"
- ' MsgBox(list.Item(i).Domain + vbNewLine + list.Item(i).Name + ":" + vbNewLine + list.Item(i).Value)
- End If
- If CBool(InStr(list.Item(i).Domain, ".crunchyroll.com")) And CBool(InStr(list.Item(i).Name, "c_locale")) Then
- locale = list.Item(i).Value
-
- End If
- Next
- Catch ex As Exception
- Debug.Write(ex.ToString)
- End Try
+ 'MsgBox(Main.CR_etp_rt)
+ 'MsgBox(Main.CR_ajs_user_id)
+ 'MsgBox(Main.CheckCRLogin.ToString)
Try
My.Computer.Clipboard.SetText(WebBrowser1.Address)
@@ -218,7 +199,7 @@ Public Class CefSharp_Browser
If CBool(InStr(WebBrowser1.Address, "https://proxer.me/read/")) Then
Main.WebbrowserURL = WebBrowser1.Address
Dim NameDLFinal As String = Nothing
- Dim NameDL As String() = Document.Split(New String() {"
"}, System.StringSplitOptions.RemoveEmptyEntries)
+ Dim NameDL As String() = Document.Split(New String() {"
"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim NameDL2 As String() = NameDL(1).Split(New String() {"
"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim NameDL3 As String() = NameDL2(0).Split(New String() {Chr(34) + "true" + Chr(34) + ">"}, System.StringSplitOptions.RemoveEmptyEntries)
For i As Integer = 0 To NameDL3.Count - 1
@@ -321,10 +302,12 @@ Public Class CefSharp_Browser
End Sub)
Else
If CBool(InStr(e.Request.Url, "crunchyroll.com")) = True And CBool(InStr(e.Request.Headers, "Basic ")) = True And Main.CrBetaBasic = Nothing Then
+
Dim Basic As String() = e.Request.Headers.Split(New String() {"Basic "}, System.StringSplitOptions.RemoveEmptyEntries)
Dim Basic2 As String() = Basic(1).Split(New String() {","}, System.StringSplitOptions.RemoveEmptyEntries)
Main.CrBetaBasic = "Basic " + Basic2(0)
Debug.WriteLine(Main.CrBetaBasic)
+
End If
@@ -335,6 +318,8 @@ Public Class CefSharp_Browser
+
+
'
'Debug.WriteLine(e.Request.Url)
diff --git a/Crunchyroll Downloader/Main.designer.vb b/Crunchyroll Downloader/Main.designer.vb
index ce76fc9..10c403e 100644
--- a/Crunchyroll Downloader/Main.designer.vb
+++ b/Crunchyroll Downloader/Main.designer.vb
@@ -52,6 +52,7 @@ Partial Class Main
Me.ThreadCount = New System.Windows.Forms.ToolStripMenuItem()
Me.MsgBoxToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.CRCookieToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
+ Me.ClearAllSettingsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
CType(Me.PictureBox5, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox6, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.MetroStyleManager1, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -185,7 +186,7 @@ Partial Class Main
'
'ContextMenuStrip1
'
- Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToggleDebugModeToolStripMenuItem, Me.OpenSettingsToolStripMenuItem, Me.TestDownloadToolStripMenuItem, Me.CheckCRBetaTokenToolStripMenuItem, Me.AddonHTMLToolStripMenuItem, Me.Timer3OffToolStripMenuItem, Me.ThreadCount, Me.MsgBoxToolStripMenuItem, Me.CRCookieToolStripMenuItem})
+ Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToggleDebugModeToolStripMenuItem, Me.OpenSettingsToolStripMenuItem, Me.TestDownloadToolStripMenuItem, Me.CheckCRBetaTokenToolStripMenuItem, Me.AddonHTMLToolStripMenuItem, Me.Timer3OffToolStripMenuItem, Me.ThreadCount, Me.MsgBoxToolStripMenuItem, Me.CRCookieToolStripMenuItem, Me.ClearAllSettingsToolStripMenuItem})
Me.ContextMenuStrip1.Name = "ContextMenuStrip1"
resources.ApplyResources(Me.ContextMenuStrip1, "ContextMenuStrip1")
'
@@ -234,6 +235,11 @@ Partial Class Main
Me.CRCookieToolStripMenuItem.Name = "CRCookieToolStripMenuItem"
resources.ApplyResources(Me.CRCookieToolStripMenuItem, "CRCookieToolStripMenuItem")
'
+ 'ClearAllSettingsToolStripMenuItem
+ '
+ Me.ClearAllSettingsToolStripMenuItem.Name = "ClearAllSettingsToolStripMenuItem"
+ resources.ApplyResources(Me.ClearAllSettingsToolStripMenuItem, "ClearAllSettingsToolStripMenuItem")
+ '
'Main
'
Me.ApplyImageInvert = True
@@ -291,4 +297,5 @@ Partial Class Main
Friend WithEvents ThreadCount As ToolStripMenuItem
Friend WithEvents MsgBoxToolStripMenuItem As ToolStripMenuItem
Friend WithEvents CRCookieToolStripMenuItem As ToolStripMenuItem
+ Friend WithEvents ClearAllSettingsToolStripMenuItem As ToolStripMenuItem
End Class
diff --git a/Crunchyroll Downloader/Main.resx b/Crunchyroll Downloader/Main.resx
index 08fd487..f1b4a7a 100644
--- a/Crunchyroll Downloader/Main.resx
+++ b/Crunchyroll Downloader/Main.resx
@@ -540,6 +540,12 @@
System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ ClearAllSettingsToolStripMenuItem
+
+
+ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
Main
@@ -609,8 +615,14 @@
CR_Cookie
+
+ 233, 22
+
+
+ Clear all settings
+
- 234, 202
+ 234, 246
ContextMenuStrip1
diff --git a/Crunchyroll Downloader/Main.vb b/Crunchyroll Downloader/Main.vb
index 60bbac2..c52ab16 100644
--- a/Crunchyroll Downloader/Main.vb
+++ b/Crunchyroll Downloader/Main.vb
@@ -22,12 +22,18 @@ Public Class Main
Dim t As Thread
Dim HTML As String = Nothing
Public CR_Cookies As String = "Cookie: "
+
+ Public CR_etp_rt As String = Nothing
+ Public CR_ajs_user_id As String = Nothing
+ Public CheckCRLogin As Boolean = True
+
'Public LoadedUrl As String = Nothing
Public CrBetaMass As String = Nothing
Public CrBetaMassEpisodes As String = Nothing
Public CrBetaMassParameters As String = Nothing
Public CrBetaMassBaseURL As String = Nothing
Public CrBetaBasic As String = Nothing
+
'Public CrBetaObjects As String = Nothing
'Public CrBetaStreams As String = Nothing
'Public CrBetaStreamsUrl As String = Nothing
@@ -74,14 +80,14 @@ Public Class Main
Public SubsOnly As Boolean = False
Public VideoFormat As String = ".mp4"
Public MergeSubsFormat As String = "mov_text"
- Public LoginDialog As Boolean = False
- Public NonCR_Timeout As Integer = 5
- Public NonCR_URL As String = Nothing
+ 'Public LoginDialog As Boolean = False
+ 'Public NonCR_Timeout As Integer = 5
+ 'Public NonCR_URL As String = Nothing
Public DlSoftSubsRDY As Boolean = True
Public DialogTaskString As String
- Public ErrorBrowserString As String
- Public ErrorBrowserUrl As String
- Public ErrorBrowserBackString As String
+ 'Public ErrorBrowserString As String
+ 'Public ErrorBrowserUrl As String
+ 'Public ErrorBrowserBackString As String
Public UserCloseDialog As Boolean = False
Dim Aktuell As String
Dim Gesamt As String
@@ -355,6 +361,7 @@ Public Class Main
End Function
Private Sub Form8_Load(sender As Object, e As EventArgs) Handles MyBase.Load
+ '
Me.ContextMenuStrip = ContextMenuStrip1
Dim tbtl As TextBoxTraceListener = New TextBoxTraceListener(TheTextBox)
Trace.Listeners.Add(tbtl)
@@ -397,6 +404,16 @@ Public Class Main
DarkModeValue = CBool(Integer.Parse(rkg.GetValue("Dark_Mode").ToString))
Catch ex As Exception
End Try
+ Try
+ Dim rkg As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\CRDownloader")
+ CR_etp_rt = rkg.GetValue("etp_rt").ToString
+ Catch ex As Exception
+ End Try
+ Try
+ Dim rkg As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\CRDownloader")
+ CR_ajs_user_id = rkg.GetValue("ajs_user_id").ToString
+ Catch ex As Exception
+ End Try
Manager.Style = MetroColorStyle.Orange
If DarkModeValue = True Then
Manager.Theme = MetroThemeStyle.Dark
@@ -589,7 +606,7 @@ Public Class Main
MergeSubsFormat = "mov_text"
End If
- ElseIf MergeSubsFormat = "None" Or MergeSubsFormat = "0" Then
+ ElseIf MergeSubsFormat = "None" Or MergeSubsFormat = "0" Or MergeSubsFormat = "[merge disabled]" Then
MergeSubs = False
Else
MergeSubs = True
@@ -633,10 +650,9 @@ Public Class Main
Dim Format As String = rkg.GetValue("VideoFormat").ToString
If Format = ".mkv" Then
VideoFormat = ".mkv"
- MergeSubsFormat = "copy"
ElseIf Format = ".aac" Then
VideoFormat = ".aac"
- MergeSubsFormat = "copy"
+ MergeSubsFormat = "[merge disabled]"
End If
Catch ex2 As Exception
End Try
@@ -998,6 +1014,7 @@ Public Class Main
Dim sr As StreamReader
Dim sr2 As StreamReader
+
Dim cmd As String = "--no-alpn -fsSLm 15 -A " + My.Resources.ffmpeg_user_agend.Replace("User-Agent: ", "") + " " + Chr(34) + Url + Chr(34)
Dim Proc As New Process
'MsgBox(cmd)
@@ -1026,9 +1043,11 @@ Public Class Main
Loop Until Proc.HasExited
If CurlOutput = Nothing Then
+ Debug.WriteLine("curl-E: " + CurlError)
Return CurlError
Else
+ Debug.WriteLine("curl-O: " + CurlOutput)
Return CurlOutput
End If
@@ -1076,9 +1095,11 @@ Public Class Main
Loop Until Proc.HasExited
If CurlOutput = Nothing Then
+ Debug.WriteLine("curl-E: " + CurlError)
Return CurlError
Else
+ Debug.WriteLine("curl-O: " + CurlOutput)
Return CurlOutput
End If
@@ -1127,11 +1148,11 @@ Public Class Main
Loop Until Proc.HasExited
If CurlOutput = Nothing Then
+ Debug.WriteLine("curl-E: " + CurlError)
Return CurlError
-
Else
+ Debug.WriteLine("curl-O: " + CurlOutput)
Return CurlOutput
-
End If
@@ -1288,6 +1309,9 @@ Public Class Main
End Sub
Public Sub GetBetaVideo(ByVal Streams As String, ByVal WebsiteURL As String) ', ByVal ObjectJson As String, ByVal VideoJson As String) '
+ If b = False Then
+ b = True
+ End If
Debug.WriteLine(Streams)
Debug.WriteLine(vbCrLf)
Debug.WriteLine("Website: " + WebsiteURL)
@@ -1728,7 +1752,8 @@ Public Class Main
'MsgBox(SoftSub_3)
Dim client0 As New WebClient
client0.Encoding = Encoding.UTF8
- Dim str0 As String = client0.DownloadString(SoftSub_3)
+ Dim str0 As String = client0.DownloadString(SoftSub_3) 'Curl(SoftSub_3)
+ 'MsgBox(str0)
Dim Pfad3 As String = Pfad2.Replace(Chr(34), "")
Dim FN As String = Path.ChangeExtension(Path.Combine(Path.GetFileNameWithoutExtension(Pfad3) + "." + GetSubFileLangName(SoftSubs2(i)) + Path.GetExtension(Pfad3)), "ass")
'MsgBox(FN)
@@ -3407,70 +3432,7 @@ Public Class Main
Dim localHTML As String = document
Debug.WriteLine(Date.Now.ToString + "." + Date.Now.Millisecond.ToString)
Debug.WriteLine(Address)
- 'If CBool(InStr(Address, "crunchyroll.com/")) And CBool(InStr(Address, "streams?")) Then
- ' Debug.WriteLine("Streams")
- ' My.Computer.FileSystem.WriteAllText("D:\Projecte\Crunchyroll Downloader - v3.0-final\Crunchyroll-Downloader-v3.0 - CefSharp\Crunchyroll Downloader\bin\x64\Debug\WebInterface\CrBetaStreams.txt", CrBetaStreams, False)
- ' CrBetaStreamsUrl = Address
- ' CrBetaStreams = localHTML.Replace("", "").Replace("", "").Replace("", "").Replace("
", "").Replace("