improve old style compatibility

improve old style compatibility #677
This commit is contained in:
hama3254 2023-01-21 23:08:14 +01:00
parent 18e4d9a0d4
commit 0a1b38d544
3 changed files with 41 additions and 15 deletions

Binary file not shown.

View File

@ -213,8 +213,8 @@ Public Class Anime_Add
End If
Catch ex As Exception
MsgBox(ex.ToString)
Main.b = True
MsgBox(Main.URL_Invaild, MsgBoxStyle.OkOnly)
Main.b = True
MsgBox(Main.URL_Invaild, MsgBoxStyle.OkOnly)
End Try
ElseIf groupBox2.Visible = True Then

View File

@ -1114,29 +1114,57 @@ Public Class Main
Dim SeasonSubData As List(Of JToken) = Entry.Children().ToList
Dim localSeasons As New List(Of CR_Seasons)
Dim season_number As String = Nothing
Dim id As String = Nothing
Dim audio_localeMain As String = Nothing
For Each SeasonSubItem As JProperty In SeasonSubData
SeasonSubItem.CreateReader()
Select Case SeasonSubItem.Name
Case "versions"
For Each VersionItem As JObject In SeasonSubItem.Values
Try
For Each VersionItem As JObject In SeasonSubItem.Values
Dim guid As String = VersionItem.GetValue("guid").ToString
Dim audio_locale As String = VersionItem.GetValue("audio_locale").ToString
localSeasons.Add(New CR_Seasons(guid, audio_locale, Auth))
Next
Dim guid As String = VersionItem.GetValue("guid").ToString
Dim audio_locale As String = VersionItem.GetValue("audio_locale").ToString
localSeasons.Add(New CR_Seasons(guid, audio_locale, Auth))
Next
Catch ex As Exception
Debug.WriteLine("Error getting season data")
End Try
Case "season_number"
season_number = SeasonSubItem.Value.ToString
Case "id"
id = SeasonSubItem.Value.ToString
Case "audio_locale"
audio_localeMain = SeasonSubItem.Value.ToString
End Select
Next
For i As Integer = 0 To localSeasons.Count - 1
Anime_Add.ComboBox1.Items.Add(HardSubValuesToDisplay(localSeasons.Item(i).audio_locale) + " - Season " + season_number)
CR_MassSeasons.Add(localSeasons.Item(i))
Next
If localSeasons.Count = 0 Then
Anime_Add.ComboBox1.Items.Add(HardSubValuesToDisplay(audio_localeMain) + " - Season " + season_number)
CR_MassSeasons.Add(New CR_Seasons(id, audio_localeMain, Auth))
End If
If localSeasons.Count > 0 Then
For i As Integer = 0 To CR_MassSeasons.Count - 1
If CR_MassSeasons.Item(i).guid = localSeasons.Item(0).guid Then
localSeasons.Clear()
Exit For
End If
Next
End If
If localSeasons.Count > 0 Then
For i As Integer = 0 To localSeasons.Count - 1
Anime_Add.ComboBox1.Items.Add(HardSubValuesToDisplay(localSeasons.Item(i).audio_locale) + " - Season " + season_number)
CR_MassSeasons.Add(localSeasons.Item(i))
Next
End If
Next
End Select
Next
@ -4398,7 +4426,6 @@ Public Class Main
Dim v1Token As String = CurlPost("https://www.crunchyroll.com/auth/v1/token", Loc_CR_Cookies, Auth, Post)
If CBool(InStr(v1Token, "curl:")) = True And CBool(InStr(v1Token, "400")) = True Then
v1Token = CurlPost("https://www.crunchyroll.com/auth/v1/token", Loc_CR_Cookies, Auth, Post.Replace("etp_rt_cookie", "client_id"))
@ -4419,7 +4446,6 @@ Public Class Main
v1Token = CurlPost("https://www.crunchyroll.com/auth/v1/token", Loc_CR_Cookies, Auth, Post)
End If
'MsgBox(v1Token)
If CBool(InStr(v1Token, "curl:")) = True Then