Chapters option, cookie override removed

Chapters are now an option and disabled by default
Cookies are no longer applied to the browser
This commit is contained in:
hama3254 2022-10-25 18:05:57 +02:00
parent e659df955a
commit b8c64a9a0d
5 changed files with 159 additions and 103 deletions

Binary file not shown.

View File

@ -66,25 +66,25 @@ Public Class Anime_Add
If Main.CR_etp_rt IsNot Nothing And etp_rt = False Then '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: ", "") ' Main.CR_Cookies = "Cookie: " + "etp_rt" + "=" + Main.CR_etp_rt + ";" + Main.CR_Cookies.Replace("Cookie: ", "")
Dim etp_rt_cookie As New CefSharp.Cookie ' Dim etp_rt_cookie As New CefSharp.Cookie
etp_rt_cookie.Name = "etp_rt" ' etp_rt_cookie.Name = "etp_rt"
etp_rt_cookie.Value = Main.CR_etp_rt ' etp_rt_cookie.Value = Main.CR_etp_rt
etp_rt_cookie.HttpOnly = True ' etp_rt_cookie.HttpOnly = True
etp_rt_cookie.Domain = ".crunchyroll.com" ' etp_rt_cookie.Domain = ".crunchyroll.com"
Debug.WriteLine("Set etp_rt_cookie: " + CM.SetCookieAsync("http://www.crunchyroll.com", etp_rt_cookie).Result.ToString) ' Debug.WriteLine("Set etp_rt_cookie: " + CM.SetCookieAsync("http://www.crunchyroll.com", etp_rt_cookie).Result.ToString)
End If 'End If
If Main.CR_ajs_user_id IsNot Nothing And ajs_user_id = False Then '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 + ";" ' Main.CR_Cookies = Main.CR_Cookies + "ajs_user_id" + "=" + Main.CR_ajs_user_id + ";"
Dim ajs_user_id_cookie As New CefSharp.Cookie ' Dim ajs_user_id_cookie As New CefSharp.Cookie
ajs_user_id_cookie.Name = "__cf_bm" ' ajs_user_id_cookie.Name = "__cf_bm"
ajs_user_id_cookie.Value = Main.CR_ajs_user_id ' ajs_user_id_cookie.Value = Main.CR_ajs_user_id
ajs_user_id_cookie.HttpOnly = True ' ajs_user_id_cookie.HttpOnly = True
ajs_user_id_cookie.Domain = ".crunchyroll.com" ' 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) ' Debug.WriteLine("Set ajs_user_id_cookie: " + CM.SetCookieAsync("http://www.crunchyroll.com", ajs_user_id_cookie).Result.ToString)
End If 'End If

View File

@ -148,6 +148,7 @@ Public Class Main
Public DefaultSubFunimation As String = "Disabled" Public DefaultSubFunimation As String = "Disabled"
Public DefaultSubCR As String = "Disabled" Public DefaultSubCR As String = "Disabled"
Public DubMode As Boolean = True Public DubMode As Boolean = True
Public CR_Chapters As Boolean = False
#Region "Sprachen Vairablen" #Region "Sprachen Vairablen"
Public URL_Invaild As String = "something is wrong here..." Public URL_Invaild As String = "something is wrong here..."
Dim DL_Path_String As String = "Please choose download directory." Dim DL_Path_String As String = "Please choose download directory."
@ -391,6 +392,7 @@ Public Class Main
settings.CefCommandLineArgs.Add("disable-gpu-vsync") settings.CefCommandLineArgs.Add("disable-gpu-vsync")
settings.CefCommandLineArgs.Add("disable-d3d11") settings.CefCommandLineArgs.Add("disable-d3d11")
settings.CefCommandLineArgs.Add("disable-gpu-rasterization") settings.CefCommandLineArgs.Add("disable-gpu-rasterization")
settings.UserAgent = My.Resources.ffmpeg_user_agend.Replace("User-Agent: ", "").Replace(Chr(34), "")
settings.DisableGpuAcceleration() settings.DisableGpuAcceleration()
'settings.CefCommandLineArgs("autoplay-policy") = "no-user-gesture-required" 'settings.CefCommandLineArgs("autoplay-policy") = "no-user-gesture-required"
settings.LogFile = Path.Combine(Application.StartupPath, "lib", "browser.log") settings.LogFile = Path.Combine(Application.StartupPath, "lib", "browser.log")
@ -511,6 +513,12 @@ Public Class Main
Catch ex As Exception Catch ex As Exception
End Try End Try
Try
Dim rkg As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\CRDownloader")
CR_Chapters = CBool(Integer.Parse(rkg.GetValue("CR_Chapters").ToString))
Catch ex As Exception
End Try
Try Try
Dim rkg As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\CRDownloader") Dim rkg As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\CRDownloader")
KeepCache = CBool(Integer.Parse(rkg.GetValue("Keep_Cache").ToString)) KeepCache = CBool(Integer.Parse(rkg.GetValue("Keep_Cache").ToString))
@ -1286,7 +1294,7 @@ Public Class Main
End If End If
If CBool(InStr(SeasonJson, "curl:")) = True Then If CBool(InStr(SeasonJson, "curl:")) = True Then
MsgBox("Error- Getting data") MsgBox("Error - Getting SeasonJson data")
Exit Sub Exit Sub
End If End If
SeasonJson = CleanJSON(SeasonJson) SeasonJson = CleanJSON(SeasonJson)
@ -1371,7 +1379,7 @@ Public Class Main
End If End If
If CBool(InStr(ObjectJson, "curl:")) = True Then If CBool(InStr(ObjectJson, "curl:")) = True Then
MsgBox("Error- Getting data") MsgBox("Error - Getting ObjectJson data")
Exit Sub Exit Sub
End If End If
@ -1571,6 +1579,10 @@ Public Class Main
#End Region #End Region
#Region "Chapters" #Region "Chapters"
'MsgBox(ObjectsURLBuilder4(0)) 'MsgBox(ObjectsURLBuilder4(0))
Dim Mdata_File As String = Application.StartupPath + "\" + ObjectsURLBuilder4(0) + "-mdata.txt"
If CR_Chapters = True Then
Dim ChaptersUrl As String = "https://static.crunchyroll.com/datalab-intro-v2/" + ObjectsURLBuilder4(0) + ".json" Dim ChaptersUrl As String = "https://static.crunchyroll.com/datalab-intro-v2/" + ObjectsURLBuilder4(0) + ".json"
Dim ChaptersJson As String = Nothing Dim ChaptersJson As String = Nothing
@ -1601,7 +1613,6 @@ Public Class Main
'Debug.WriteLine("ChaptersUrl: " + ChaptersUrl) 'Debug.WriteLine("ChaptersUrl: " + ChaptersUrl)
'MsgBox(ChaptersJson) 'MsgBox(ChaptersJson)
Dim Mdata_File As String = Application.StartupPath + "\" + ObjectsURLBuilder4(0) + "-mdata.txt"
If ChaptersJson IsNot Nothing Then If ChaptersJson IsNot Nothing Then
Dim StartTime As String() = ChaptersJson.Split(New String() {Chr(34) + "startTime" + Chr(34) + ": "}, System.StringSplitOptions.RemoveEmptyEntries) Dim StartTime As String() = ChaptersJson.Split(New String() {Chr(34) + "startTime" + Chr(34) + ": "}, System.StringSplitOptions.RemoveEmptyEntries)
@ -1658,7 +1669,7 @@ Public Class Main
End If End If
End If
#End Region #End Region
#Region "VideoJson" #Region "VideoJson"
Dim VideoJson As String = Nothing Dim VideoJson As String = Nothing
@ -1670,8 +1681,9 @@ Public Class Main
End If End If
If CBool(InStr(VideoJson, "curl:")) = True Then If CBool(InStr(VideoJson, "curl:")) = True Then
ChaptersJson = Nothing VideoJson = Nothing
Debug.WriteLine("no Chapter data... ignoring") MsgBox("Error - Getting VideoJson data")
Exit Sub
End If End If

View File

@ -151,6 +151,8 @@ Partial Class Einstellungen
Me.Label5 = New MetroFramework.Controls.MetroLabel() Me.Label5 = New MetroFramework.Controls.MetroLabel()
Me.BackgroundWorker1 = New System.ComponentModel.BackgroundWorker() Me.BackgroundWorker1 = New System.ComponentModel.BackgroundWorker()
Me.Btn_Save = New System.Windows.Forms.Button() Me.Btn_Save = New System.Windows.Forms.Button()
Me.GroupBox20 = New System.Windows.Forms.GroupBox()
Me.ChB_Chapters = New MetroFramework.Controls.MetroCheckBox()
CType(Me.pictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.pictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.GroupBox14.SuspendLayout() Me.GroupBox14.SuspendLayout()
Me.SoftSubs.SuspendLayout() Me.SoftSubs.SuspendLayout()
@ -188,6 +190,7 @@ Partial Class Einstellungen
Me.GroupBox8.SuspendLayout() Me.GroupBox8.SuspendLayout()
Me.TabPage7.SuspendLayout() Me.TabPage7.SuspendLayout()
CType(Me.PictureBox7, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBox7, System.ComponentModel.ISupportInitialize).BeginInit()
Me.GroupBox20.SuspendLayout()
Me.SuspendLayout() Me.SuspendLayout()
' '
'ToolTip1 'ToolTip1
@ -1106,7 +1109,7 @@ Partial Class Einstellungen
Me.TabControl1.FontWeight = MetroFramework.MetroTabControlWeight.Regular Me.TabControl1.FontWeight = MetroFramework.MetroTabControlWeight.Regular
Me.TabControl1.Location = New System.Drawing.Point(22, 60) Me.TabControl1.Location = New System.Drawing.Point(22, 60)
Me.TabControl1.Name = "TabControl1" Me.TabControl1.Name = "TabControl1"
Me.TabControl1.SelectedIndex = 1 Me.TabControl1.SelectedIndex = 3
Me.TabControl1.Size = New System.Drawing.Size(509, 567) Me.TabControl1.Size = New System.Drawing.Size(509, 567)
Me.TabControl1.TabIndex = 0 Me.TabControl1.TabIndex = 0
Me.TabControl1.UseSelectable = True Me.TabControl1.UseSelectable = True
@ -1120,9 +1123,9 @@ Partial Class Einstellungen
Me.MetroTabPage2.HorizontalScrollbarBarColor = True Me.MetroTabPage2.HorizontalScrollbarBarColor = True
Me.MetroTabPage2.HorizontalScrollbarHighlightOnWheel = False Me.MetroTabPage2.HorizontalScrollbarHighlightOnWheel = False
Me.MetroTabPage2.HorizontalScrollbarSize = 10 Me.MetroTabPage2.HorizontalScrollbarSize = 10
Me.MetroTabPage2.Location = New System.Drawing.Point(4, 35) Me.MetroTabPage2.Location = New System.Drawing.Point(4, 44)
Me.MetroTabPage2.Name = "MetroTabPage2" Me.MetroTabPage2.Name = "MetroTabPage2"
Me.MetroTabPage2.Size = New System.Drawing.Size(501, 528) Me.MetroTabPage2.Size = New System.Drawing.Size(501, 519)
Me.MetroTabPage2.TabIndex = 8 Me.MetroTabPage2.TabIndex = 8
Me.MetroTabPage2.Text = "Naming" Me.MetroTabPage2.Text = "Naming"
Me.MetroTabPage2.VerticalScrollbarBarColor = True Me.MetroTabPage2.VerticalScrollbarBarColor = True
@ -1311,6 +1314,7 @@ Partial Class Einstellungen
' '
'MetroTabPage1 'MetroTabPage1
' '
Me.MetroTabPage1.Controls.Add(Me.GroupBox20)
Me.MetroTabPage1.Controls.Add(Me.GroupBox19) Me.MetroTabPage1.Controls.Add(Me.GroupBox19)
Me.MetroTabPage1.Controls.Add(Me.GroupBox14) Me.MetroTabPage1.Controls.Add(Me.GroupBox14)
Me.MetroTabPage1.Controls.Add(Me.GB_SubLanguage) Me.MetroTabPage1.Controls.Add(Me.GB_SubLanguage)
@ -1318,9 +1322,9 @@ Partial Class Einstellungen
Me.MetroTabPage1.HorizontalScrollbarBarColor = True Me.MetroTabPage1.HorizontalScrollbarBarColor = True
Me.MetroTabPage1.HorizontalScrollbarHighlightOnWheel = False Me.MetroTabPage1.HorizontalScrollbarHighlightOnWheel = False
Me.MetroTabPage1.HorizontalScrollbarSize = 10 Me.MetroTabPage1.HorizontalScrollbarSize = 10
Me.MetroTabPage1.Location = New System.Drawing.Point(4, 35) Me.MetroTabPage1.Location = New System.Drawing.Point(4, 44)
Me.MetroTabPage1.Name = "MetroTabPage1" Me.MetroTabPage1.Name = "MetroTabPage1"
Me.MetroTabPage1.Size = New System.Drawing.Size(501, 528) Me.MetroTabPage1.Size = New System.Drawing.Size(501, 519)
Me.MetroTabPage1.TabIndex = 7 Me.MetroTabPage1.TabIndex = 7
Me.MetroTabPage1.Text = "Crunchyroll" Me.MetroTabPage1.Text = "Crunchyroll"
Me.MetroTabPage1.VerticalScrollbarBarColor = True Me.MetroTabPage1.VerticalScrollbarBarColor = True
@ -1732,6 +1736,30 @@ Partial Class Einstellungen
Me.Btn_Save.TabIndex = 9 Me.Btn_Save.TabIndex = 9
Me.Btn_Save.UseVisualStyleBackColor = False Me.Btn_Save.UseVisualStyleBackColor = False
' '
'GroupBox20
'
Me.GroupBox20.BackColor = System.Drawing.Color.Transparent
Me.GroupBox20.Controls.Add(Me.ChB_Chapters)
Me.GroupBox20.Font = New System.Drawing.Font("Arial", 9.75!)
Me.GroupBox20.ForeColor = System.Drawing.Color.Black
Me.GroupBox20.Location = New System.Drawing.Point(3, 385)
Me.GroupBox20.Name = "GroupBox20"
Me.GroupBox20.Size = New System.Drawing.Size(490, 62)
Me.GroupBox20.TabIndex = 34
Me.GroupBox20.TabStop = False
Me.GroupBox20.Text = "Chapters"
'
'ChB_Chapters
'
Me.ChB_Chapters.AutoSize = True
Me.ChB_Chapters.FontSize = MetroFramework.MetroCheckBoxSize.Medium
Me.ChB_Chapters.Location = New System.Drawing.Point(158, 23)
Me.ChB_Chapters.Name = "ChB_Chapters"
Me.ChB_Chapters.Size = New System.Drawing.Size(145, 19)
Me.ChB_Chapters.TabIndex = 5
Me.ChB_Chapters.Text = "enable CR Chapters"
Me.ChB_Chapters.UseSelectable = True
'
'Einstellungen 'Einstellungen
' '
Me.ApplyImageInvert = True Me.ApplyImageInvert = True
@ -1798,6 +1826,8 @@ Partial Class Einstellungen
Me.GroupBox8.PerformLayout() Me.GroupBox8.PerformLayout()
Me.TabPage7.ResumeLayout(False) Me.TabPage7.ResumeLayout(False)
CType(Me.PictureBox7, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureBox7, System.ComponentModel.ISupportInitialize).EndInit()
Me.GroupBox20.ResumeLayout(False)
Me.GroupBox20.PerformLayout()
Me.ResumeLayout(False) Me.ResumeLayout(False)
Me.PerformLayout() Me.PerformLayout()
@ -1931,4 +1961,6 @@ Partial Class Einstellungen
Friend WithEvents GroupBox19 As GroupBox Friend WithEvents GroupBox19 As GroupBox
Friend WithEvents DubMode As MetroFramework.Controls.MetroCheckBox Friend WithEvents DubMode As MetroFramework.Controls.MetroCheckBox
Friend WithEvents CB_Merge As MetroFramework.Controls.MetroComboBox Friend WithEvents CB_Merge As MetroFramework.Controls.MetroComboBox
Friend WithEvents GroupBox20 As GroupBox
Friend WithEvents ChB_Chapters As MetroFramework.Controls.MetroCheckBox
End Class End Class

View File

@ -61,6 +61,10 @@ Public Class Einstellungen
DubMode.Checked = True DubMode.Checked = True
End If End If
If Main.CR_Chapters = True Then
ChB_Chapters.Checked = True
End If
If Main.DarkModeValue = True Then If Main.DarkModeValue = True Then
DarkMode.Checked = True DarkMode.Checked = True
GroupBoxColor(Color.FromArgb(150, 150, 150)) GroupBoxColor(Color.FromArgb(150, 150, 150))
@ -392,6 +396,14 @@ Public Class Einstellungen
rk.SetValue("DubMode", 0, RegistryValueKind.String) rk.SetValue("DubMode", 0, RegistryValueKind.String)
End If End If
If ChB_Chapters.Checked = True Then
Main.CR_Chapters = True
rk.SetValue("CR_Chapters", 1, RegistryValueKind.String)
Else
Main.CR_Chapters = False
rk.SetValue("CR_Chapters", 0, RegistryValueKind.String)
End If
If KodiSupport.Checked = True Then If KodiSupport.Checked = True Then
Main.KodiNaming = True Main.KodiNaming = True
rk.SetValue("KodiSupport", 1, RegistryValueKind.String) rk.SetValue("KodiSupport", 1, RegistryValueKind.String)