diff --git a/catchup.py b/catchup.py index 939cd23..9587cd7 100755 --- a/catchup.py +++ b/catchup.py @@ -26,6 +26,10 @@ def getPageProps(url): main_props = getPageProps(START_URL) +if not "catchupInfo" in main_props: + print("[bold red]Error: No catchupInfo in starting URL. Check whether this URL is correct:") + print(f"[bold cyan][url={START_URL}]{START_URL}") + shows = main_props["catchupInfo"] shows_done = 0 @@ -69,6 +73,12 @@ with Progress( show_props = getPageProps(show_url) #print(show_props) + if not "catchupInfo" in show_props: + print(f"[bold red]Error: No catch up info for [bold magenta]{title}") + shows_done += 1 + prog.update(task_show, completed=shows_done) + continue + episodes = show_props["catchupInfo"]["episodes"] episodes_done = 0 prog.start_task(task_epi)