Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Commit

Permalink
fix(issues): better handling of playlist urls
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Jan 14, 2024
1 parent cdbd2b6 commit fcdea79
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def exception_writer(error: Exception, name: str, end_program: bool = False) ->
f.write(f'# :bangbang: **Exception Occurred** :bangbang:\n\n```txt\n{error}\n```\n\n')

if end_program:
raise error
sys.exit(0) # exit without error to allow rest of GitHub workflow steps to run


def igdb_authorization(client_id: str, client_secret: str) -> dict:
Expand Down Expand Up @@ -475,8 +475,10 @@ def check_youtube(data: dict) -> str:

# determine if playlist
# https://www.youtube.com/watch?v=<video_id>&list=<list_id>&index=<1-based-index>
if '&list=' in url or '?list=' in url:
url = url.split('&list=')[0]
for symbol in ['&', '?']:
if f'{symbol}list=' in url:
url = url.split(f'{symbol}list=')[0]
break

# url provided, now process it using youtube_dl
youtube_dl_params = dict(
Expand Down

0 comments on commit fcdea79

Please sign in to comment.