From 0a1b38d54439b8fbdbf7de1082cf61f1c71e3c64 Mon Sep 17 00:00:00 2001 From: hama3254 <52826614+hama3254@users.noreply.github.com> Date: Sat, 21 Jan 2023 23:08:14 +0100 Subject: [PATCH] improve old style compatibility improve old style compatibility #677 --- .vs/Crunchyroll Downloader/v17/.suo | Bin 189952 -> 190976 bytes Crunchyroll Downloader/Anime_Add.vb | 4 +-- Crunchyroll Downloader/Main.vb | 52 +++++++++++++++++++++------- 3 files changed, 41 insertions(+), 15 deletions(-) diff --git a/.vs/Crunchyroll Downloader/v17/.suo b/.vs/Crunchyroll Downloader/v17/.suo index e7fc1be3f9d3546c33308e4b36eb3122e53d7a5a..95c62123b4a96c4dfccb38e2ee3390d97e8aa8c2 100644 GIT binary patch delta 5827 zcmeI0dsNiN7036^F0il*E((f(uquKQz~!Z=L{}vSjZvdUiBCWvrWz!;OCu6kAB~Tw zg`I@)q{fmBS*<5Q!k+L;O z$;1b;X#dt78}C1t_%7|@R#ru3-j3@wZdFfbdKKUK@*r+v`oP;rrP^@^8bI>rq>1Q1 z2U-ZY2WY_v5CazSbWLw6G_k zz!Go%F0TyqN?GRt=*ztMKSDkT+Q14h3dlM#{j^ipBeNKpP%slNAKb&;=g)qpyR&<` z+tV^G{%A{1!Us}@mP|c^K;}DxKiqWc3EO#W&;IPMOT$ZFQ*fx+&ID%-WYv-JNwPPm}HQ~(cGB0qedrr}j&+G=6z#cP{b>1*uq%eWztqh!7*?gyai5xx4}tp3do-S0C^fnXS@gbKKKB92+ja$x>hh> zrOH>Gh4N=0AN&~d6Ywec415m00Dl5s0@>gK$iIT+;5?WFz5*9PJNO!e1KFNTgXA>1 zEezJSxXJLoJ-H;fFv<6-?#aD7)7HP|GPv8wQOBhJD_Bk5P@j0L?LIu%6`dCXEfn+x z{XiJ#55hqNhy(*b6o>{!Fc1s^gFy@!0%AcN7z%~~IgLmR(S%<5geIdT1*C#BkPgP+ zPCuG}Ys8Q{koU|4mr2m?1leFRm;&wsbLDtzN(_^8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roll Downloader/Anime_Add.vb b/Crunchyroll Downloader/Anime_Add.vb index 997e184..c384245 100644 --- a/Crunchyroll Downloader/Anime_Add.vb +++ b/Crunchyroll Downloader/Anime_Add.vb @@ -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 diff --git a/Crunchyroll Downloader/Main.vb b/Crunchyroll Downloader/Main.vb index 2ed9d58..6d5feb0 100644 --- a/Crunchyroll Downloader/Main.vb +++ b/Crunchyroll Downloader/Main.vb @@ -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