diff --git a/.vs/Crunchyroll Downloader/v17/.suo b/.vs/Crunchyroll Downloader/v17/.suo
index af79778..0db710b 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 584d1e8..7dafe5b 100644
--- a/Crunchyroll Downloader/Anime_Add.vb
+++ b/Crunchyroll Downloader/Anime_Add.vb
@@ -22,158 +22,158 @@ Public Class Anime_Add
Public AuthorizationCookie As String = Nothing
- Private Sub LoadBrowser(ByVal Url As String)
+ Public Sub LoadBrowser(ByVal Url As String)
Main.LoadedUrl = Url
- Dim locale As String = "en-US"
- If CBool(InStr(Url, "beta.crunchyroll.com")) = True And CBool(InStr(Url, "watch")) = True And CBool(Main.CrBetaBasic = Nothing) = False Then
-#Region "Get Cookies"
- Dim Cookies As String = "Cookie: "
- Try
- Dim Collector As New TaskCookieVisitor
- Dim CM As ICookieManager = CefSharp_Browser.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
- 'MsgBox(list.Item(i).Name + ":" + vbNewLine + list.Item(i).Value)
- 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 + ";"
- 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
+ ' Dim locale As String = "en-US"
+ ' If CBool(InStr(Url, "beta.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: "
+ ' 'Try
+ ' ' Dim Collector As New TaskCookieVisitor
+ ' ' Dim CM As ICookieManager = CefSharp_Browser.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
+ ' ' 'MsgBox(list.Item(i).Name + ":" + vbNewLine + list.Item(i).Value)
+ ' ' 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 + ";"
+ ' ' 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
- CefSharp_Browser.WebBrowser1.Load(Url)
- Exit Sub
- End Try
+ ' ' End If
+ ' ' Next
+ ' 'Catch ex As Exception
+ ' ' CefSharp_Browser.WebBrowser1.Load(Url)
+ ' ' Exit Sub
+ ' 'End Try
-#End Region
- Dim CRBetaBearer As String = "Bearer "
- Try
+ '#End Region
+ ' Dim CRBetaBearer As String = "Bearer "
+ ' Try
- Dim Request As HttpWebRequest = CType(WebRequest.Create("https://beta.crunchyroll.com/auth/v1/token"), HttpWebRequest)
- Request.Method = "POST"
- Request.ContentType = "application/x-www-form-urlencoded"
- Request.Accept = "application/json, text/plain, */*"
- 'Request.Headers.Add("Accept-Language: de,en-US;q=0.7,en;q=0.3")
- Request.Headers.Add("Accept-Encoding: identity")
- Request.Headers.Add("Authorization: " + Main.CrBetaBasic)
- 'Request.Headers.Add("Referer: " + Url)
- Request.Referer = Url
- Request.Headers.Add("Origin: https://beta.crunchyroll.com")
- Request.Headers.Add(Cookies)
- Dim Post As String = "grant_type=etp_rt_cookie"
- Dim byteArray() As Byte = Encoding.UTF8.GetBytes(Post)
- Request.ContentLength = byteArray.Length
- Dim DataStream As Stream = Request.GetRequestStream()
- DataStream.Write(byteArray, 0, byteArray.Length)
- DataStream.Close()
- Dim Response As HttpWebResponse = CType(Request.GetResponse(), HttpWebResponse)
- DataStream = Response.GetResponseStream()
- Dim reader As New StreamReader(DataStream)
- Dim ServerResponseString As String = reader.ReadToEnd()
- reader.Close()
- DataStream.Close()
- Response.Close()
- 'Debug.WriteLine(ServerResponseString)
- Dim Token() As String = ServerResponseString.Split(New String() {Chr(34) + "access_token" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim Token2() As String = Token(1).Split(New String() {Chr(34) + "," + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
- CRBetaBearer = CRBetaBearer + Token2(0)
- Catch ex As Exception
- Debug.WriteLine(ex.ToString)
- CefSharp_Browser.WebBrowser1.Load(Url)
- Exit Sub
- End Try
+ ' Dim Request As HttpWebRequest = CType(WebRequest.Create("https://www.crunchyroll.com/auth/v1/token"), HttpWebRequest)
+ ' Request.Method = "POST"
+ ' Request.ContentType = "application/x-www-form-urlencoded"
+ ' Request.Accept = "application/json, text/plain, */*"
+ ' 'Request.Headers.Add("Accept-Language: de,en-US;q=0.7,en;q=0.3")
+ ' Request.Headers.Add("Accept-Encoding: gzip, deflate, br") 'identity")
+ ' Request.Headers.Add("Authorization: " + Main.CrBetaBasic)
+ ' 'Request.Headers.Add("Referer: " + Url)
+ ' Request.Referer = Url
+ ' Request.Headers.Add("Origin: https://www.crunchyroll.com")
+ ' Request.Headers.Add(Cookies)
+ ' Dim Post As String = "grant_type=etp_rt_cookie"
+ ' Dim byteArray() As Byte = Encoding.UTF8.GetBytes(Post)
+ ' Request.ContentLength = byteArray.Length
+ ' Dim DataStream As Stream = Request.GetRequestStream()
+ ' DataStream.Write(byteArray, 0, byteArray.Length)
+ ' DataStream.Close()
+ ' Dim Response As HttpWebResponse = CType(Request.GetResponse(), HttpWebResponse)
+ ' DataStream = Response.GetResponseStream()
+ ' Dim reader As New StreamReader(DataStream)
+ ' Dim ServerResponseString As String = reader.ReadToEnd()
+ ' reader.Close()
+ ' DataStream.Close()
+ ' Response.Close()
+ ' 'Debug.WriteLine(ServerResponseString)
+ ' Dim Token() As String = ServerResponseString.Split(New String() {Chr(34) + "access_token" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
+ ' Dim Token2() As String = Token(1).Split(New String() {Chr(34) + "," + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
+ ' CRBetaBearer = CRBetaBearer + Token2(0)
+ ' Catch ex As Exception
+ ' Debug.WriteLine(ex.ToString)
+ ' CefSharp_Browser.WebBrowser1.Load(Url)
+ ' Exit Sub
+ ' End Try
- Dim ObjectsUrl As String = Nothing
+ ' Dim ObjectsUrl As String = Nothing
- Try
- Using client As New WebClient()
- client.Encoding = System.Text.Encoding.UTF8
- client.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), ""))
- client.Headers.Add("ACCEPT: application/json, text/javascript, */*; q=0.01")
- client.Headers.Add("Accept-Encoding: identity")
- client.Headers.Add("Referer: " + Url)
- client.Headers.Add("Authorization: " + CRBetaBearer)
- client.Headers.Add(Cookies) '+ WebBrowser1.Document.Cookie)
- 'MsgBox(OmUStreamSplitEpisodeIndex(1))
- Dim v2Content As String = client.DownloadString("https://beta.crunchyroll.com/index/v2")
- 'Debug.WriteLine(v2Content)
+ ' Try
+ ' Using client As New WebClient()
+ ' client.Encoding = System.Text.Encoding.UTF8
+ ' client.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), ""))
+ ' client.Headers.Add("ACCEPT: application/json, text/javascript, */*; q=0.01")
+ ' client.Headers.Add("Accept-Encoding: identity")
+ ' client.Headers.Add("Referer: " + Url)
+ ' client.Headers.Add("Authorization: " + CRBetaBearer)
+ ' client.Headers.Add(Cookies) '+ WebBrowser1.Document.Cookie)
+ ' 'MsgBox(OmUStreamSplitEpisodeIndex(1))
+ ' Dim v2Content As String = client.DownloadString("https://www.crunchyroll.com/index/v2")
+ ' 'Debug.WriteLine(v2Content)
- Dim v2ContentBeta() As String = v2Content.Split(New String() {Chr(34) + "cms_beta" + Chr(34) + ":"}, System.StringSplitOptions.RemoveEmptyEntries)
+ ' Dim v2ContentBeta() As String = v2Content.Split(New String() {Chr(34) + "cms_beta" + Chr(34) + ":"}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim bucket() As String = v2ContentBeta(1).Split(New String() {Chr(34) + "bucket" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim bucket2() As String = bucket(1).Split(New String() {Chr(34) + "," + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
+ ' Dim bucket() As String = v2ContentBeta(1).Split(New String() {Chr(34) + "bucket" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
+ ' Dim bucket2() As String = bucket(1).Split(New String() {Chr(34) + "," + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim policy() As String = v2ContentBeta(1).Split(New String() {Chr(34) + "policy" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim policy2() As String = policy(1).Split(New String() {Chr(34) + "," + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
+ ' Dim policy() As String = v2ContentBeta(1).Split(New String() {Chr(34) + "policy" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
+ ' Dim policy2() As String = policy(1).Split(New String() {Chr(34) + "," + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim signature() As String = v2ContentBeta(1).Split(New String() {Chr(34) + "signature" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim signature2() As String = signature(1).Split(New String() {Chr(34) + "," + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
+ ' Dim signature() As String = v2ContentBeta(1).Split(New String() {Chr(34) + "signature" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
+ ' Dim signature2() As String = signature(1).Split(New String() {Chr(34) + "," + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim key_pair_id() As String = v2ContentBeta(1).Split(New String() {Chr(34) + "key_pair_id" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim key_pair_id2() As String = key_pair_id(1).Split(New String() {Chr(34) + "," + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
+ ' Dim key_pair_id() As String = v2ContentBeta(1).Split(New String() {Chr(34) + "key_pair_id" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
+ ' Dim key_pair_id2() As String = key_pair_id(1).Split(New String() {Chr(34) + "," + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim ObjectsURLBuilder3() As String = Url.Split(New String() {"watch/"}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim ObjectsURLBuilder4() As String = ObjectsURLBuilder3(1).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries)
+ ' Dim ObjectsURLBuilder3() As String = Url.Split(New String() {"watch/"}, System.StringSplitOptions.RemoveEmptyEntries)
+ ' Dim ObjectsURLBuilder4() As String = ObjectsURLBuilder3(1).Split(New String() {"/"}, System.StringSplitOptions.RemoveEmptyEntries)
- ObjectsUrl = "https://beta.crunchyroll.com/cms/v2" + bucket2(0) + "/objects/" + ObjectsURLBuilder4(0) + "?locale=" + locale + "&Signature=" + signature2(0) + "&Policy=" + policy2(0) + "&Key-Pair-Id=" + key_pair_id2(0)
- End Using
+ ' ObjectsUrl = "https://www.crunchyroll.com/cms/v2" + bucket2(0) + "/objects/" + ObjectsURLBuilder4(0) + "?locale=" + locale + "&Signature=" + signature2(0) + "&Policy=" + policy2(0) + "&Key-Pair-Id=" + key_pair_id2(0)
+ ' End Using
- 'Debug.WriteLine(ObjectsUrl)
+ ' 'Debug.WriteLine(ObjectsUrl)
- Catch ex As Exception
- CefSharp_Browser.WebBrowser1.Load(Url)
- Exit Sub
- End Try
+ ' Catch ex As Exception
+ ' CefSharp_Browser.WebBrowser1.Load(Url)
+ ' Exit Sub
+ ' End Try
- Dim StreamsUrl As String = Nothing
- Dim ObjectJson As String
- Try
- Try
- Using client As New WebClient()
- client.Encoding = System.Text.Encoding.UTF8
- client.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), ""))
- ObjectJson = client.DownloadString(ObjectsUrl)
- End Using
- Catch ex As Exception
- Debug.WriteLine("error- getting name data")
- Exit Sub
- End Try
+ ' Dim StreamsUrl As String = Nothing
+ ' Dim ObjectJson As String
+ ' Try
+ ' Try
+ ' Using client As New WebClient()
+ ' client.Encoding = System.Text.Encoding.UTF8
+ ' client.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), ""))
+ ' ObjectJson = client.DownloadString(ObjectsUrl)
+ ' End Using
+ ' Catch ex As Exception
+ ' Debug.WriteLine("error- getting name data")
+ ' Exit Sub
+ ' End Try
- Catch ex As Exception
- CefSharp_Browser.WebBrowser1.Load(Url)
- Exit Sub
- End Try
+ ' Catch ex As Exception
+ ' CefSharp_Browser.WebBrowser1.Load(Url)
+ ' Exit Sub
+ ' End Try
- Try
- Dim StreamsUrlBuilder() As String = ObjectJson.Split(New String() {"videos/"}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim StreamsUrlBuilder2() As String = StreamsUrlBuilder(1).Split(New String() {"/streams"}, System.StringSplitOptions.RemoveEmptyEntries)
+ ' Try
+ ' Dim StreamsUrlBuilder() As String = ObjectJson.Split(New String() {"videos/"}, System.StringSplitOptions.RemoveEmptyEntries)
+ ' Dim StreamsUrlBuilder2() As String = StreamsUrlBuilder(1).Split(New String() {"/streams"}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim StreamsUrlBuilder3() As String = ObjectsUrl.Split(New String() {"objects/"}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim StreamsUrlBuilder4() As String = StreamsUrlBuilder3(1).Split(New String() {"?"}, System.StringSplitOptions.RemoveEmptyEntries)
+ ' Dim StreamsUrlBuilder3() As String = ObjectsUrl.Split(New String() {"objects/"}, System.StringSplitOptions.RemoveEmptyEntries)
+ ' Dim StreamsUrlBuilder4() As String = StreamsUrlBuilder3(1).Split(New String() {"?"}, System.StringSplitOptions.RemoveEmptyEntries)
- StreamsUrl = StreamsUrlBuilder3(0) + "videos/" + StreamsUrlBuilder2(0) + "/streams?" + StreamsUrlBuilder4(1)
+ ' StreamsUrl = StreamsUrlBuilder3(0) + "videos/" + StreamsUrlBuilder2(0) + "/streams?" + StreamsUrlBuilder4(1)
- ' Debug.WriteLine(StreamsUrl)
- Catch ex As Exception
- CefSharp_Browser.WebBrowser1.Load(Url)
- Exit Sub
- End Try
+ ' ' Debug.WriteLine(StreamsUrl)
+ ' Catch ex As Exception
+ ' CefSharp_Browser.WebBrowser1.Load(Url)
+ ' Exit Sub
+ ' End Try
- Main.GetBetaVideoProxy(StreamsUrl, Url)
+ ' Main.GetBetaVideoProxy(StreamsUrl, Url)
- Else
- CefSharp_Browser.WebBrowser1.Load(Url)
- End If
+ ' Else
+ CefSharp_Browser.WebBrowser1.Load(Url)
+ 'End If
End Sub
@@ -457,7 +457,7 @@ Public Class Anime_Add
comboBox3.Enabled = False
ComboBox1.Enabled = False
- ElseIf CBool(InStr(Main.WebbrowserURL, "beta.crunchyroll.com")) = True Then
+ ElseIf CBool(InStr(Main.WebbrowserURL, "crunchyroll.com")) = True Then
StatusLabel.Text = "Status: idle"
'btn_dl.BackgroundImage = My.Resources.add_mass_running_cancel
@@ -484,18 +484,6 @@ Public Class Anime_Add
comboBox3.Enabled = False
ComboBox1.Enabled = False
- Else 'CR
-
- StatusLabel.Text = "Status: idle"
- 'btn_dl.BackgroundImage = My.Resources.add_mass_running_cancel
- btn_dl.Text = "Cancel"
- Mass_DL_Cancel = True
- bt_Cancel_mass.Enabled = False
- bt_Cancel_mass.Visible = False
- Main.MassDL()
- comboBox4.Enabled = False
- comboBox3.Enabled = False
- ComboBox1.Enabled = False
End If
ElseIf GroupBox3.Visible = True Then
@@ -605,11 +593,11 @@ Public Class Anime_Add
End Sub
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
- If CBool(InStr(Main.WebbrowserURL, "beta.crunchyroll.com")) = True Then
+ If CBool(InStr(Main.WebbrowserURL, "crunchyroll.com")) = True Then
comboBox3.Items.Clear()
comboBox4.Items.Clear()
- comboBox3.Enabled = True
- comboBox4.Enabled = True
+ comboBox3.Enabled = False
+ comboBox4.Enabled = False
comboBox3.Text = Nothing
comboBox4.Text = Nothing
Dim SeasonSplit() As String = Main.CrBetaMass.Split(New String() {Chr(34) + "id" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
@@ -617,45 +605,25 @@ Public Class Anime_Add
Dim SeasonSplit2() As String = SeasonSplit(ComboBox1.SelectedIndex + 1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
Dim EpisodeJsonURL As String = Main.CrBetaMassBaseURL + "episodes?season_id=" + SeasonSplit2(0) + "&locale=" + Main.CrBetaMassParameters
- Dim EpisodeJson As String = Nothing
+
Debug.WriteLine(EpisodeJsonURL)
- Try
- Using client As New WebClient()
- client.Encoding = System.Text.Encoding.UTF8
- client.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), ""))
- EpisodeJson = client.DownloadString(EpisodeJsonURL)
- End Using
- Catch ex As Exception
- Debug.WriteLine("error- getting EpisodeJson data")
- Debug.WriteLine(ex.ToString)
- Exit Sub
- End Try
- Main.CrBetaMassEpisodes = EpisodeJson
-
- Dim EpisodeNameSplit() As String = EpisodeJson.Split(New String() {Chr(34) + "title" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
+ CefSharp_Browser.WebBrowser1.LoadUrl(EpisodeJsonURL)
- Dim EpisodeSplit() As String = EpisodeJson.Split(New String() {Chr(34) + "episode" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
- For i As Integer = 1 To EpisodeSplit.Count - 1
- Dim EpisodeSplit2() As String = EpisodeSplit(i).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim EpisodeNameSplit2() As String = EpisodeNameSplit(i).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
- If EpisodeSplit(i).Substring(0, 1) = Chr(34) Then
- comboBox3.Items.Add(EpisodeNameSplit2(0))
- comboBox4.Items.Add(EpisodeNameSplit2(0))
- Else
- comboBox3.Items.Add("Episode " + EpisodeSplit2(0))
- comboBox4.Items.Add("Episode " + EpisodeSplit2(0))
- End If
-
- Next
-
- If comboBox3.Items.Count > 0 Then
- comboBox3.SelectedIndex = 0
- comboBox4.SelectedIndex = comboBox4.Items.Count - 1
- End If
+ 'Try
+ ' Using client As New WebClient()
+ ' client.Encoding = System.Text.Encoding.UTF8
+ ' client.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), ""))
+ ' EpisodeJson = client.DownloadString(EpisodeJsonURL)
+ ' End Using
+ 'Catch ex As Exception
+ ' Debug.WriteLine("error- getting EpisodeJson data")
+ ' Debug.WriteLine(ex.ToString)
+ ' Exit Sub
+ 'End Try
@@ -761,42 +729,6 @@ Public Class Anime_Add
End If
- Else
-
- 'MsgBox(Main.WebbrowserURL)
- comboBox3.Items.Clear()
- comboBox4.Items.Clear()
- comboBox3.Enabled = True
- comboBox4.Enabled = True
- 'comboBox3.Items.Add("[First Episode]")
- 'comboBox4.Items.Add("[Last Episode]")
- Dim SeasonDropdownAnzahl As String() = Main.WebbrowserText.Split(New String() {"season-dropdown content-menu block"}, System.StringSplitOptions.RemoveEmptyEntries)
- Array.Reverse(SeasonDropdownAnzahl)
- Dim SDV As Integer = 0
- For i As Integer = 0 To SeasonDropdownAnzahl.Count - 1
- If CBool(InStr(SeasonDropdownAnzahl(i), Chr(34) + ">" + ComboBox1.SelectedItem.ToString + "")) Then
- SDV = i
- End If
- Next
- 'MsgBox(SDV)
- Dim Anzahl As String() = SeasonDropdownAnzahl(SDV).Split(New String() {"wrapper container-shadow hover-classes"}, System.StringSplitOptions.RemoveEmptyEntries)
- 'MsgBox(Anzahl(0))
- Dim c As Integer = Anzahl.Count - 1
- Array.Reverse(Anzahl)
- For i As Integer = 0 To Anzahl.Count - 2
- Dim URLGrapp As String() = Anzahl(i).Split(New String() {"title=" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
-
- Dim URLGrapp2 As String() = URLGrapp(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
-
- comboBox3.Items.Add(URLGrapp2(0))
- comboBox4.Items.Add(URLGrapp2(0))
- Next
-
- If comboBox3.Items.Count > 0 Then
- comboBox3.SelectedIndex = 0
- comboBox4.SelectedIndex = comboBox4.Items.Count - 1
- End If
-
End If
End Sub
diff --git a/Crunchyroll Downloader/CefSharp_Browser.vb b/Crunchyroll Downloader/CefSharp_Browser.vb
index 4b6a94f..ad170ae 100644
--- a/Crunchyroll Downloader/CefSharp_Browser.vb
+++ b/Crunchyroll Downloader/CefSharp_Browser.vb
@@ -9,6 +9,7 @@ Imports System.Net.WebUtility
Imports System.IO.Compression
Imports System.Text
Imports AdapterRequestHandler
+Imports System.Security.Policy
Public Class CefSharp_Browser
@@ -39,6 +40,7 @@ Public Class CefSharp_Browser
Main.WebbrowserURL = WebBrowser1.Address
TextBox1.Text = Main.WebbrowserURL
+
Try
If Btn_Scan.Enabled = False And Btn_Scan.Text = "Start network scan" Then
Btn_Scan.Enabled = True
@@ -71,15 +73,17 @@ Public Class CefSharp_Browser
Try
Dim HTML As String = Await WebBrowser1.GetSourceAsync
+ ' Dim HTML2 As String = Await
+
Document = HTML
Debug.WriteLine("get html")
Me.Invoke(New Action(Function() As Object
+
Main.WebbrowserText = HTML
Main.WebbrowserURL = WebBrowser1.Address
Main.WebbrowserTitle = DocumentTitle
Main.ProcessHTML(HTML, WebBrowser1.Address, DocumentTitle)
-
'If Main.UserBowser = False Then
' Me.Close()
'End If
@@ -143,6 +147,28 @@ 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
Try
My.Computer.Clipboard.SetText(WebBrowser1.Address)
@@ -283,23 +309,32 @@ Public Class CefSharp_Browser
If (Me.InvokeRequired) Then
Me.Invoke(Sub()
- If CBool(InStr(e.Request.Url, "beta.crunchyroll.com")) = True And CBool(InStr(e.Request.Headers, "Basic ")) = True And Main.CrBetaBasic = Nothing Then
+ 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
+
+
+
End Sub)
Else
- If CBool(InStr(e.Request.Url, "beta.crunchyroll.com")) = True And CBool(InStr(e.Request.Headers, "Basic ")) = True And Main.CrBetaBasic = Nothing Then
+ 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
+
+
+
End If
+
+
+
'
'Debug.WriteLine(e.Request.Url)
@@ -336,8 +371,7 @@ Public Class CefSharp_Browser
Exit Sub
End If
Debug.WriteLine(e.Request.Url)
-
- ElseIf CBool(InStr(e.Request.Url, "https://beta-api.crunchyroll.com/")) And CBool(InStr(e.Request.Url, "streams?")) Then
+ ElseIf CBool(InStr(e.Request.Url, "crunchyroll.com/")) And CBool(InStr(e.Request.Url, "streams?")) Then
If (Me.InvokeRequired) Then
Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Url))
Exit Sub
@@ -346,25 +380,7 @@ Public Class CefSharp_Browser
Exit Sub
End If
Debug.WriteLine(e.Request.Url)
- ElseIf CBool(InStr(e.Request.Url, "https://beta.crunchyroll.com/")) And CBool(InStr(e.Request.Url, "streams?")) Then
- If (Me.InvokeRequired) Then
- Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Url))
- Exit Sub
- Else
- Main.LoadedUrls.Add(e.Request.Url)
- Exit Sub
- End If
- Debug.WriteLine(e.Request.Url)
- ElseIf CBool(InStr(e.Request.Url, "https://beta-api.crunchyroll.com/")) And CBool(InStr(e.Request.Url, "seasons?series_id=")) Then
- If (Me.InvokeRequired) Then
- Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Url))
- Exit Sub
- Else
- Main.LoadedUrls.Add(e.Request.Url)
- Exit Sub
- End If
- Debug.WriteLine(e.Request.Url)
- ElseIf CBool(InStr(e.Request.Url, "https://beta.crunchyroll.com/")) And CBool(InStr(e.Request.Url, "seasons?series_id=")) Then
+ ElseIf CBool(InStr(e.Request.Url, "crunchyroll.com/")) And CBool(InStr(e.Request.Url, "seasons?series_id=")) Then
If (Me.InvokeRequired) Then
Me.Invoke(Sub() Main.LoadedUrls.Add(e.Request.Url))
Exit Sub
@@ -394,159 +410,6 @@ Public Class CefSharp_Browser
End If
- Exit Sub
-
-
- Dim requesturl As String = Nothing
- Try
- requesturl = e.Request.Url
- Catch ex As Exception
- Exit Sub
- End Try
-
-
-
-
- If CBool(InStr(requesturl, "https://api.vrv.co")) And CBool(InStr(requesturl, "streams?")) Then
- Debug.WriteLine("vrv-1 " + requesturl)
- If Main.b = False Then
- Main.Get_VRV_VideoProxy(requesturl, Main.WebbrowserURL)
- Main.b = True
- End If
-
- ElseIf CBool(InStr(requesturl, "https://api.vrv.co")) And CBool(InStr(requesturl, "seasons?series_id=")) Then
- Debug.WriteLine("vrv-2 " + requesturl)
- Exit Sub
- If Main.b = False Then
- Main.GetBetaSeasons(requesturl)
- Main.b = True
- End If
-
- End If
-
-
- If CBool(InStr(requesturl, "https://beta-api.crunchyroll.com/")) And CBool(InStr(requesturl, "streams?")) Then
-
- If Main.b = False Then
- Main.GetBetaVideoProxy(requesturl, Main.WebbrowserURL)
- Main.b = True
- End If
-
- ElseIf CBool(InStr(requesturl, "https://beta.crunchyroll.com/")) And CBool(InStr(requesturl, "streams?")) Then
-
- If Main.b = False Then
- Main.GetBetaVideoProxy(requesturl, Main.WebbrowserURL)
- Main.b = True
- End If
-
- ElseIf CBool(InStr(requesturl, "https://beta.crunchyroll.com/")) And CBool(InStr(requesturl, "seasons?series_id=")) Then
-
- If Main.b = False Then
- Main.GetBetaSeasons(requesturl)
- Main.b = True
- End If
-
- ElseIf CBool(InStr(requesturl, "https://beta-api.crunchyroll.com/")) And CBool(InStr(requesturl, "seasons?series_id=")) Then
-
- If Main.b = False Then
- Main.GetBetaSeasons(requesturl)
- Main.b = True
- End If
- End If
-
-
- If CBool(InStr(requesturl, "https://title-api.prd.funimationsvc.com")) And CBool(InStr(requesturl, "?region=")) Then
- Try
- Main.WebbrowserCookie = Cookie
- Catch ex As Exception
- End Try
-
- If Main.FunimationAPIRegion = Nothing Then
-
- Me.Invoke(New Action(Function() As Object
- Dim parms As String() = requesturl.Split(New String() {"?region="}, System.StringSplitOptions.RemoveEmptyEntries)
- Main.FunimationAPIRegion = "?region=" + parms(1)
- Return Nothing
- End Function))
-
- End If
-
- If Main.b = False Then
- If CBool(InStr(requesturl, "https://title-api.prd.funimationsvc.com/v1/show")) And CBool(InStr(requesturl, "/episodes/")) Then
- Main.GetFunimationNewJS_VideoProxy(requesturl)
- Main.b = True
- Exit Sub
- Else
- Debug.WriteLine("processing js")
- Me.Invoke(New Action(Function() As Object
- Anime_Add.ProcessFunimationJS(WebBrowser1.Address)
- Return Nothing
- End Function))
- Main.b = True
-
- Exit Sub
- End If
-
-
- End If
- End If
-
- If ScanTrue = True Then
-
- If CBool(InStr(requesturl, ".m3u8")) Then
- Dim client0 As New WebClient
- client0.Encoding = Encoding.UTF8
- 'client0.Headers.Add(HttpRequestHeader.Cookie, e.Channel.GetRequestHeader("Cookie"))
- Dim str0 As String = client0.DownloadString(requesturl)
-
- If CBool(InStr(str0, "#EXTM3U")) Then
- Main.m3u8List.Add(requesturl)
- Else
- Dim DecodedUrl As String = UrlDecode(requesturl)
- 'MsgBox(DecodedUrl)
- Dim URLSplit() As String = DecodedUrl.Split(New String() {".m3u8"}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim URLSplit2() As String = URLSplit(0).Split(New String() {"https://"}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim NewUrl As String = "https://" + URLSplit2(URLSplit2.Count - 1) + ".m3u8" + URLSplit(1)
- 'MsgBox(NewUrl)
- Dim str1 As String = client0.DownloadString(NewUrl)
- 'MsgBox(str1)
- If CBool(InStr(str1, "#EXTM3U")) Then
- Main.m3u8List.Add(NewUrl)
- End If
-
- End If
- ElseIf CBool(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 CBool(InStr(requesturl, ".txt")) Then
- Main.txtList.Add(requesturl)
- ElseIf CBool(InStr(requesturl, ".vtt")) Then
- Main.txtList.Add(requesturl)
- ElseIf CBool(InStr(requesturl, ".srt")) Then
- Main.txtList.Add(requesturl)
- ElseIf CBool(InStr(requesturl, ".ass")) Then
- Main.txtList.Add(requesturl)
- ElseIf CBool(InStr(requesturl, ".ssa")) Then
- Main.txtList.Add(requesturl)
- ElseIf CBool(InStr(requesturl, ".dfxp")) Then
- Main.txtList.Add(requesturl)
- End If
- End If
-
-
End Sub
diff --git a/Crunchyroll Downloader/Main.designer.vb b/Crunchyroll Downloader/Main.designer.vb
index 4e82f32..ce76fc9 100644
--- a/Crunchyroll Downloader/Main.designer.vb
+++ b/Crunchyroll Downloader/Main.designer.vb
@@ -51,6 +51,7 @@ Partial Class Main
Me.Timer3OffToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ThreadCount = New System.Windows.Forms.ToolStripMenuItem()
Me.MsgBoxToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
+ Me.CRCookieToolStripMenuItem = 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()
@@ -184,7 +185,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.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.Name = "ContextMenuStrip1"
resources.ApplyResources(Me.ContextMenuStrip1, "ContextMenuStrip1")
'
@@ -228,6 +229,11 @@ Partial Class Main
Me.MsgBoxToolStripMenuItem.Name = "MsgBoxToolStripMenuItem"
resources.ApplyResources(Me.MsgBoxToolStripMenuItem, "MsgBoxToolStripMenuItem")
'
+ 'CRCookieToolStripMenuItem
+ '
+ Me.CRCookieToolStripMenuItem.Name = "CRCookieToolStripMenuItem"
+ resources.ApplyResources(Me.CRCookieToolStripMenuItem, "CRCookieToolStripMenuItem")
+ '
'Main
'
Me.ApplyImageInvert = True
@@ -284,4 +290,5 @@ Partial Class Main
Friend WithEvents Timer3OffToolStripMenuItem As ToolStripMenuItem
Friend WithEvents ThreadCount As ToolStripMenuItem
Friend WithEvents MsgBoxToolStripMenuItem As ToolStripMenuItem
+ Friend WithEvents CRCookieToolStripMenuItem As ToolStripMenuItem
End Class
diff --git a/Crunchyroll Downloader/Main.resx b/Crunchyroll Downloader/Main.resx
index cadd56d..08fd487 100644
--- a/Crunchyroll Downloader/Main.resx
+++ b/Crunchyroll Downloader/Main.resx
@@ -534,6 +534,12 @@
"}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim CR_Name_2 As String() = CR_Name_1(1).Split(New String() {"
"}, System.StringSplitOptions.RemoveEmptyEntries) '(New [Char]() {"-"})
- Dim CR_Name_Staffel0_Folge1 As String()
- If CBool(InStr(CR_Name_2(0), ",")) Then
- CR_Name_Staffel0_Folge1 = CR_Name_2(0).Split(New [Char]() {System.Convert.ToChar(",")}, System.StringSplitOptions.RemoveEmptyEntries)
- CR_Anime_Staffel = CR_Name_Staffel0_Folge1(0).Trim()
- CR_Anime_Folge = CR_Name_Staffel0_Folge1(1)
- CR_Anime_Folge = String.Join(" ", CR_Anime_Folge.Split(invalids, StringSplitOptions.RemoveEmptyEntries)).TrimEnd("."c).Replace(Chr(34), "").Replace("\", "").Replace("/", "") 'System.Text.RegularExpressions.Regex.Replace(CR_Anime_Folge, "[^\w\\-]", " ")
- Else
- CR_Anime_Staffel = Nothing
- CR_Anime_Folge = CR_Name_2(0).Trim()
- 'MsgBox(CR_Anime_Folge)
- CR_Anime_Folge = String.Join(" ", CR_Anime_Folge.Split(invalids, StringSplitOptions.RemoveEmptyEntries)).TrimEnd("."c).Replace(Chr(34), "").Replace("\", "").Replace("/", "") 'System.Text.RegularExpressions.Regex.Replace(CR_Anime_Folge, "[^\w\\-]", " ")
- End If
- Dim CR_Name_4 As String() = CR_Name_1(0).Split(New String() {"class=" + Chr(34) + "text-link" + Chr(34) + ">"}, System.StringSplitOptions.RemoveEmptyEntries) '(New [Char]() {"-"})
- Dim CR_Name_Anime0 As String() = CR_Name_4(CR_Name_4.Length - 1).Split(New String() {""}, System.StringSplitOptions.RemoveEmptyEntries)
- CR_Name_Anime0(0) = String.Join(" ", CR_Name_Anime0(0).Split(invalids, StringSplitOptions.RemoveEmptyEntries)).TrimEnd("."c).Replace(Chr(34), "").Replace("\", "").Replace("/", "") 'System.Text.RegularExpressions.Regex.Replace(CR_Name_Anime0(0), "[^\w\\-]", " ")
- CR_Anime_Titel = CR_Name_Anime0(0).Trim
- 'CR_FilenName_Backup = RemoveExtraSpaces(CR_FilenName)
- End If
- If CBool(InStr(WebbrowserText, My.Resources.CR_Episode_Nr)) Then
- If CBool(InStr(WebbrowserText, My.Resources.CR_Episode_Nr + Chr(34))) Then
- Debug.WriteLine("No Episode Number in a movie")
- Else
- Dim CR_Episode_1 As String() = WebbrowserText.Split(New String() {My.Resources.CR_Episode_Nr}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim CR_Episode_2 As String() = CR_Episode_1(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) '(New [Char]() {"-"})
- CR_Anime_Folge_int = String.Join(" ", CR_Episode_2(0).Split(invalids, StringSplitOptions.RemoveEmptyEntries)).TrimEnd("."c).Replace(Chr(34), "").Replace("\", "").Replace("/", "") 'System.Text.RegularExpressions.Regex.Replace(CR_Name_2(0), "[^\w\\-]", " ")
- CR_Anime_Folge_int = RemoveExtraSpaces(CR_Anime_Folge_int)
- 'CR_Anime_Folge_int = AddLeadingZeros(CR_Anime_Folge_int)
- End If
- If CBool(InStr(CR_Anime_Folge_int, ",")) Then
- CR_Anime_Folge_int = CR_Anime_Folge_int.Replace(",", ".")
- End If
- End If
- If CBool(InStr(WebbrowserHeadText, My.Resources.CR_Season_Nr)) Then
- If CBool(InStr(WebbrowserHeadText, My.Resources.CR_Season_Nr + Chr(34))) Then
- Debug.WriteLine("No Season Number in a movie")
- Else
- Dim CR_Season_1 As String() = WebbrowserHeadText.Split(New String() {My.Resources.CR_Season_Nr}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim CR_Season_2 As String() = CR_Season_1(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries) '(New [Char]() {"-"})
- CR_Anime_Staffel_int = String.Join(" ", CR_Season_2(0).Split(invalids, StringSplitOptions.RemoveEmptyEntries)).TrimEnd("."c).Replace(Chr(34), "").Replace("\", "").Replace("/", "") 'System.Text.RegularExpressions.Regex.Replace(CR_Name_2(0), "[^\w\\-]", " ")
- CR_Anime_Staffel_int = RemoveExtraSpaces(CR_Anime_Staffel_int)
- End If
- Else
- Debug.WriteLine("Not found?")
- End If
- If CBool(InStr(WebbrowserText, My.Resources.CR_MediaName)) = True Then ' And CBool(InStr(WebbrowserText, "”"))
- Dim CR_Name_1 As String() = WebbrowserText.Split(New String() {My.Resources.CR_MediaName}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim CR_Name_2 As String() = CR_Name_1(1).Split(New String() {My.Resources.CR_MediaName2}, System.StringSplitOptions.RemoveEmptyEntries) '(New [Char]() {"-"})
- CR_Anime_Name = String.Join(" ", CR_Name_2(0).Split(invalids, StringSplitOptions.RemoveEmptyEntries)).TrimEnd("."c).Replace(Chr(34), "").Replace("\", "").Replace("/", "") 'System.Text.RegularExpressions.Regex.Replace(CR_Name_2(0), "[^\w\\-]", " ")
- CR_Anime_Name = RemoveExtraSpaces(CR_Anime_Name)
- End If
- If CR_Anime_Titel = Nothing Then 'it's a movie??
-
- Dim CR_Name_1 As String() = WebbrowserText.Split(New String() {My.Resources.CR_MovieTop}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim CR_Name_2 As String() = CR_Name_1(2).Split(New String() {My.Resources.CR_MovieBT}, System.StringSplitOptions.RemoveEmptyEntries) '(New [Char]() {"-"})
- CR_Anime_Titel = String.Join(" ", CR_Name_2(0).Split(invalids, StringSplitOptions.RemoveEmptyEntries)).TrimEnd("."c).Replace(Chr(34), "").Replace("\", "").Replace("/", "") 'System.Text.RegularExpressions.Regex.Replace(CR_Name_2(0), "[^\w\\-]", " ")
- CR_Anime_Titel = RemoveExtraSpaces(CR_Anime_Titel)
-
-
- End If
-
-
- If Season_Prefix = "[default season prefix]" Then
- Else
- If CR_Anime_Staffel_int = "0" Then
- Else
- CR_Anime_Staffel = Season_Prefix + CR_Anime_Staffel_int
- End If
- End If
- If Episode_Prefix = "[default episode prefix]" Then
- If CR_Anime_Folge_int = Nothing Then
-
- ElseIf CR_Anime_Folge = Nothing = True And CR_Anime_Folge_int = Nothing = False Then
- CR_Anime_Folge = "Episode " + AddLeadingZeros(CR_Anime_Folge_int)
- Else
- CR_Anime_Folge = CR_Anime_Folge.Replace(CR_Anime_Folge_int, AddLeadingZeros(CR_Anime_Folge_int))
- End If
- Else
- If CR_Anime_Folge_int = Nothing Then
-
- ElseIf CR_Anime_Folge = Nothing = True And CR_Anime_Folge_int = Nothing = False Then
- CR_Anime_Folge = "Episode " + AddLeadingZeros(CR_Anime_Folge_int)
- Else
- CR_Anime_Folge = Episode_Prefix + AddLeadingZeros(CR_Anime_Folge_int)
- End If
- End If
-
- If CR_Anime_Titel = Nothing Then
- CR_FilenName = CR_Anime_Name
- ElseIf CR_NameMethode = 0 Then
- If CR_Anime_Staffel = Nothing Then
- CR_FilenName = CR_Anime_Titel + " " + CR_Anime_Folge
- Else
- CR_FilenName = CR_Anime_Titel + " " + CR_Anime_Staffel + " " + CR_Anime_Folge
- End If
- ElseIf CR_NameMethode = 1 Then
- If CR_Anime_Staffel = Nothing Then
- CR_FilenName = CR_Anime_Titel + " " + CR_Anime_Name
- Else
- CR_FilenName = CR_Anime_Titel + " " + CR_Anime_Staffel + " " + CR_Anime_Name
- End If
- ElseIf CR_NameMethode = 2 Then
- If CR_Anime_Staffel = Nothing Then
- CR_FilenName = CR_Anime_Titel + " " + CR_Anime_Folge + " " + CR_Anime_Name
- Else
- CR_FilenName = CR_Anime_Titel + " " + CR_Anime_Staffel + " " + CR_Anime_Folge + " " + CR_Anime_Name
- End If
- ElseIf CR_NameMethode = 3 Then
- If CR_Anime_Staffel = Nothing Then
- CR_FilenName = CR_Anime_Titel + " " + CR_Anime_Name + " " + CR_Anime_Folge
- Else
- CR_FilenName = CR_Anime_Titel + " " + CR_Anime_Name + " " + CR_Anime_Staffel + " " + CR_Anime_Folge
- End If
- End If
- If KodiNaming = True And CR_Anime_Folge_int IsNot Nothing Then
- Dim KodiString As String = "[S"
- If CR_Anime_Staffel_int = "0" Then
- CR_Anime_Staffel_int = "01"
- Else
- CR_Anime_Staffel_int = "0" + CR_Anime_Staffel_int
- End If
- KodiString = KodiString + CR_Anime_Staffel_int + " E" + AddLeadingZeros(CR_Anime_Folge_int)
- KodiString = KodiString + "] "
- CR_FilenName = KodiString + CR_FilenName
- End If
- 'MsgBox(CR_FilenName)
-#End Region
- 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)).Replace(Chr(34), "").Replace("\", "").Replace("/", "") 'System.Text.RegularExpressions.Regex.Replace(TextBox2_Text, "[^\w\\-]", " "))
- End If
- If CR_FilenName = Nothing Then
- CR_FilenName = WebbrowserTitle
- End If
- CR_FilenName = String.Join(" ", CR_FilenName.Split(invalids, StringSplitOptions.RemoveEmptyEntries)).TrimEnd("."c).Replace(Chr(34), "").Replace("\", "").Replace("/", "") 'System.Text.RegularExpressions.Regex.Replace(CR_FilenName, "[^\w\\-]", " ")
- CR_FilenName = RemoveExtraSpaces(CR_FilenName)
- 'My.Computer.FileSystem.WriteAllText("log.log", WebbrowserText, False)
- Pfad2 = UseSubfolder(CR_Anime_Titel, CR_Anime_Staffel, Pfad)
- If Not Directory.Exists(Path.GetDirectoryName(Pfad2)) Then
- ' Nein! Jetzt erstellen...
- Try
- Directory.CreateDirectory(Path.GetDirectoryName(Pfad2))
- Pfad2 = Chr(34) + Pfad2 + CR_FilenName + VideoFormat + Chr(34)
- Catch ex As Exception
- ' Ordner wurde nich erstellt
- Pfad2 = Chr(34) + Pfad + CR_FilenName + VideoFormat + Chr(34)
- End Try
- Else
- Pfad2 = Chr(34) + Pfad2 + CR_FilenName + VideoFormat + Chr(34)
- End If
-#End Region
-#Region "Subs"
- Dim SoftSubs2 As New List(Of String)
- If SoftSubs.Count > 0 Then
- For i As Integer = 0 To SoftSubs.Count - 1
- If CBool(InStr(WebbrowserText, Chr(34) + "language" + Chr(34) + ":" + Chr(34) + SoftSubs(i) + Chr(34) + ",")) Then
- SoftSubs2.Add(SoftSubs(i))
- Else
- 'MsgBox("Softsubtitle for " + SoftSubs(i) + " is not avalible.", MsgBoxStyle.Information)
- End If
- Next
- End If
- If SubSprache = "None" Then
- If CBool(InStr(WebbrowserText, Chr(34) + "hardsub_lang" + Chr(34) + ":null")) Then
- SubSprache2 = "null"
- Else
- Me.Invoke(New Action(Function() As Object
- ResoNotFoundString = WebbrowserText
- DialogTaskString = "Language"
- ErrorDialog.ShowDialog()
- Return Nothing
- End Function))
- If UserCloseDialog = True Then
- Throw New System.Exception(Chr(34) + "UserAbort" + Chr(34))
- Else
- If ResoBackString = Nothing Then
- Else
- SubSprache2 = ResoBackString
- End If
- End If
- 'Throw New System.Exception("Could not find the sub language")
- End If
- Else
- If CBool(InStr(WebbrowserText, Chr(34) + "hardsub_lang" + Chr(34) + ":" + Chr(34) + SubSprache + Chr(34) + ",")) Then
- SubSprache2 = Chr(34) + SubSprache + Chr(34)
- ElseIf CBool(InStr(WebbrowserText, Chr(34) + "language" + Chr(34) + ":" + Chr(34) + SubSprache + Chr(34) + ",")) Then
- If MessageBox.Show("It look like only Softsubtitle are avalibe." + vbNewLine + "Are you want to use Softsubtitle this time instead?", "No Hardsubtitle", MessageBoxButtons.YesNo) = DialogResult.Yes Then
- SubSprache2 = "null"
- SoftSubs2.Add(SubSprache)
- Else
- Throw New System.Exception("Could not find the sub language")
- End If
- Else
- Me.Invoke(New Action(Function() As Object
- ResoNotFoundString = WebbrowserText
- DialogTaskString = "Language"
- ErrorDialog.ShowDialog()
- Return Nothing
- End Function))
- If UserCloseDialog = True Then
- Throw New System.Exception(Chr(34) + "UserAbort" + Chr(34))
- Else
- If ResoBackString = Nothing Then
- Else
- SubSprache2 = ResoBackString
- End If
- End If
- End If
- End If
-#End Region
- If Grapp_Abord = True Then
- Grapp_RDY = True
- Grapp_Abord = False
- 'MsgBox("grapp_abourd")
- Exit Sub
- End If
-#Region "m3u8 suche"
- Dim CR_URI_Master As String = Nothing
- If SubsOnly = False Then
- Dim ii As Integer = 0
- 'MsgBox(Chr(34) + "hardsub_lang" + Chr(34) + ":" + SubSprache2 + "," + Chr(34) + "url" + Chr(34) + ":" + Chr(34))
- Dim CR_URI_Master_Split1 As String() = WebbrowserText.Split(New String() {My.Resources.hls_Value}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim hls_List As New List(Of String)
- For i As Integer = 0 To CR_URI_Master_Split1.Count - 1
- If CBool(InStr(CR_URI_Master_Split1(i), My.Resources.hls_endString)) Then
- Dim s As String() = CR_URI_Master_Split1(i).Split(New String() {My.Resources.hls_endString}, System.StringSplitOptions.RemoveEmptyEntries)
- hls_List.Add(s(0))
- End If
- Next
- 'Dim CR_URI_Master_Split1 As String() = WebbrowserText.Split(New String() {Chr(34) + "hardsub_lang" + Chr(34) + ":" + SubSprache2 + "," + Chr(34) + "url" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
- For i As Integer = 0 To hls_List.Count - 1
- If CBool(InStr(hls_List(i), Chr(34) + "hardsub_lang" + Chr(34) + ":" + SubSprache2 + "," + Chr(34) + "url" + Chr(34) + ":" + Chr(34))) Then
- Dim s() As String = hls_List(i).Split(New String() {Chr(34) + "hardsub_lang" + Chr(34) + ":" + SubSprache2 + "," + Chr(34) + "url" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
- CR_URI_Master = s(1).Replace("\/", "/")
- Dim dub() As String = hls_List(i).Split(New String() {Chr(34) + "audio_lang" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim dub2() As String = dub(0).Split(New String() {Chr(34) + ","}, System.StringSplitOptions.RemoveEmptyEntries)
- CR_Anime_Dub = dub2(0)
- 'MsgBox(CR_URI_Master)
- End If
- Next
- If CBool(InStr(CR_URI_Master, "master.m3u8")) Then
- Me.Invoke(New Action(Function() As Object
- Anime_Add.StatusLabel.Text = "Status: m3u8 found, looking for resolution"
- Me.Text = "Status: m3u8 found, looking for resolution"
- Me.Invalidate()
- Return Nothing
- End Function))
- Else
- Throw New System.Exception("Premium Episode")
- End If
- Else
- Me.Invoke(New Action(Function() As Object
- Anime_Add.StatusLabel.Text = "Status: Substitles only mode - skipped video"
- Me.Text = "Status: Substitles only mode - skipped video"
- Me.Invalidate()
- Return Nothing
- End Function))
- End If
-#End Region
-#Region "Download softsub file or build ffmpeg cmd"
- Dim SoftSubMergeURLs As String = Nothing
- Dim SoftSubMergeMaps As String = " -map 0:v -map 0:a"
- Dim SoftSubMergeMetatata As String = Nothing
- If SoftSubs2.Count > 0 Then
- If MergeSubs = True And SubsOnly = False Then
- Dim DispositionIndex As Integer
- For i As Integer = 0 To SoftSubs2.Count - 1
- Debug.WriteLine(SoftSubs2(i))
- If SoftSubs2(i) = DefaultSubCR Then
- DispositionIndex = i
- End If
- Dim SoftSub As String() = WebbrowserText.Split(New String() {Chr(34) + "language" + Chr(34) + ":" + Chr(34) + SoftSubs2(i) + Chr(34) + "," + Chr(34) + "url" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim SoftSub_2 As String() = SoftSub(1).Split(New [Char]() {Chr(34)})
- Dim SoftSub_3 As String = SoftSub_2(0).Replace("\/", "/")
- If SoftSubMergeURLs = Nothing Then
- SoftSubMergeURLs = " -i " + Chr(34) + SoftSub_3 + Chr(34)
- Else
- SoftSubMergeURLs = SoftSubMergeURLs + " -i " + Chr(34) + SoftSub_3 + Chr(34)
- End If
- SoftSubMergeMaps = SoftSubMergeMaps + " -map " + (i + 1).ToString
- If SoftSubMergeMetatata = Nothing Then
- SoftSubMergeMetatata = " -metadata:s:s:" + i.ToString + " language=" + CCtoMP4CC(SoftSubs2(i)) + " -metadata:s:s:" + i.ToString + " title=" + Chr(34) + HardSubValuesToDisplay(SoftSubs2(i)) + Chr(34) + " -metadata:s:s:" + i.ToString + " handler_name=" + Chr(34) + HardSubValuesToDisplay(SoftSubs2(i)) + Chr(34)
- Else
- SoftSubMergeMetatata = SoftSubMergeMetatata + " -metadata:s:s:" + i.ToString + " language=" + CCtoMP4CC(SoftSubs2(i)) + " -metadata:s:s:" + i.ToString + " title=" + Chr(34) + HardSubValuesToDisplay(SoftSubs2(i)) + Chr(34) + " -metadata:s:s:" + i.ToString + " handler_name=" + Chr(34) + HardSubValuesToDisplay(SoftSubs2(i)) + Chr(34)
- End If
- Next
- If DispositionIndex = Nothing Then
- Else
- SoftSubMergeMetatata = SoftSubMergeMetatata + " -disposition:s:" + DispositionIndex.ToString + " default"
- End If
- Else
- For i As Integer = 0 To SoftSubs2.Count - 1
- Dim ii As Integer = i
- Me.Invoke(New Action(Function() As Object
- Anime_Add.StatusLabel.Text = "Status: downloading subtitle file " + HardSubValuesToDisplay(SoftSubs2(ii))
- Me.Text = "Status: downloading subtitle file " + HardSubValuesToDisplay(SoftSubs2(ii))
- Me.Invalidate()
- Return Nothing
- End Function))
- Dim SoftSub As String() = WebbrowserText.Split(New String() {Chr(34) + "language" + Chr(34) + ":" + Chr(34) + SoftSubs2(i) + Chr(34) + "," + Chr(34) + "url" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim SoftSub_2 As String() = SoftSub(1).Split(New [Char]() {Chr(34)})
- Dim SoftSub_3 As String = SoftSub_2(0).Replace("\/", "/")
- Dim client0 As New WebClient
- client0.Encoding = Encoding.UTF8
- Dim str0 As String = client0.DownloadString(SoftSub_3)
- 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)
- If i = 0 And IncludeLangName = False Then
- FN = Path.ChangeExtension(Path.GetFileName(Pfad3), "ass")
- 'MsgBox(FN)
- End If
- Dim Pfad4 As String = Path.Combine(Path.GetDirectoryName(Pfad3), FN)
- 'MsgBox(Pfad4)
- 'File.WriteAllText(Pfad4, str0, Encoding.UTF8)
- WriteText(Pfad4, str0)
- Pause(3)
- Next
- End If
- End If
-#End Region
-#Region "lösche doppel download"
- Dim Pfad5 As String = Pfad2.Replace(Chr(34), "")
- If My.Computer.FileSystem.FileExists(Pfad5) Then 'Pfad = Kompeltter Pfad mit Dateinamen + ENdung
- Me.Invoke(New Action(Function() As Object
- Anime_Add.StatusLabel.Text = "Status: The file video already exists."
- Me.Text = "Status: The file video already exists."
- Me.Invalidate()
- Return Nothing
- End Function))
- If MessageBox.Show("The file " + Pfad5 + " already exists." + vbNewLine + "You want to override it?", "File exists!", MessageBoxButtons.OKCancel) = DialogResult.OK Then
- Try
- My.Computer.FileSystem.DeleteFile(Pfad5)
- Catch ex As Exception
- End Try
- Else
- Grapp_RDY = True
- Exit Sub
- End If
- End If
-#End Region
- If SubsOnly = False Then
- If Reso = 42 And HybridMode = False Then
- If MergeSubs = True Then
- URL_DL = "-i " + Chr(34) + CR_URI_Master + Chr(34) + SoftSubMergeURLs + SoftSubMergeMaps + " " + ffmpeg_command + " -c:s " + MergeSubsFormat + SoftSubMergeMetatata + " -metadata:s:a:0 language=" + CCtoMP4CC(CR_Anime_Dub)
- Else
- URL_DL = "-i " + Chr(34) + CR_URI_Master + Chr(34) + " -metadata:s:a:0 language=" + CCtoMP4CC(CR_Anime_Dub) + " " + ffmpeg_command_temp
- End If
- 'MsgBox(URL_DL)
- Else
- Dim client As New System.Net.WebClient
- client.Encoding = Encoding.UTF8
- 'MsgBox(CR_URI_Master)
- Dim str As String = client.DownloadString(CR_URI_Master)
- 'MsgBox(str)
- If CBool(InStr(str, "x" + Reso.ToString + ",")) Then
- Reso2 = "x" + Reso.ToString
- Else
- 'MsgBox(str)
- If CBool(InStr(str, ResoSave + ",")) Then
- Reso2 = Reso2
- Else
- Me.Invoke(New Action(Function() As Object
- DialogTaskString = "Resolution"
- ResoNotFoundString = str
- ErrorDialog.ShowDialog()
- Return Nothing
- End Function))
- 'MsgBox(ResoBackString)
- If UserCloseDialog = True Then
- Throw New System.Exception(Chr(34) + "UserAbort" + Chr(34))
- Else
- Reso2 = ResoBackString
- ResoSave = ResoBackString
- End If
- End If
- End If
- Dim ffmpeg_url_1 As String() = str.Split(New String() {Reso2 + ","}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim ffmpeg_url_3 As String() = Nothing
- Dim ffmpeg_url_2 As String() = ffmpeg_url_1(1).Split(New [Char]() {Chr(34)})
- ffmpeg_url_3 = ffmpeg_url_2(2).Split(New [Char]() {System.Convert.ToChar("#")})
- If MergeSubs = True Then
- URL_DL = "-i " + Chr(34) + ffmpeg_url_3(0).Trim() + Chr(34) + SoftSubMergeURLs + SoftSubMergeMaps + " " + ffmpeg_command + " -c:s " + MergeSubsFormat + SoftSubMergeMetatata + " -metadata:s:a:0 language=" + CCtoMP4CC(CR_Anime_Dub)
- Else
- URL_DL = "-i " + Chr(34) + ffmpeg_url_3(0).Trim() + Chr(34) + " -metadata:s:a:0 language=" + CCtoMP4CC(CR_Anime_Dub) + " " + ffmpeg_command_temp
- End If
- End If
- End If
-#Region "thumbnail"
- Dim thumbnail As String() = WebbrowserText.Split(New String() {My.Resources.thumbnailString}, System.StringSplitOptions.RemoveEmptyEntries)
- Dim thumbnail2 As String() = thumbnail(1).Split(New String() {Chr(34) + "}"}, System.StringSplitOptions.RemoveEmptyEntries) '(New [Char]() {"-"})
- Dim thumbnail3 As String = thumbnail2(0).Replace("\/", "/")
-#End Region
-#Region "
", "").Replace("", "").Replace("