Skip to content

Commit

Permalink
add broad Exception to ytdl stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
rking32 committed Sep 14, 2020
1 parent 6741e7e commit 0a3ebab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion userge/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class Config:
ANTISPAM_SENTRY = False
RUN_DYNO_SAVER = False
HEROKU_APP = heroku3.from_key(HEROKU_API_KEY).apps()[HEROKU_APP_NAME] \
if HEROKU_API_KEY else None
if HEROKU_API_KEY and HEROKU_APP_NAME else None
STATUS = None


Expand Down
8 changes: 4 additions & 4 deletions userge/plugins/misc/utube.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def _yt_description(link):
try:
x = ytdl.YoutubeDL({'no-playlist': True, 'logger': LOGGER}).extract_info(
link, download=False)
except ytdl.utils.YoutubeDLError as y_e:
except Exception as y_e: # pylint: disable=broad-except
LOGGER.exception(y_e)
return y_e
else:
Expand All @@ -176,7 +176,7 @@ def _yt_getInfo(link):
for i in formats:
out += (f"`{i.get('format_id', '')} | {i.get('format_note', None)}"
f" | {i.get('ext', None)}`\n")
except ytdl.utils.YoutubeDLError as y_e:
except Exception as y_e: # pylint: disable=broad-except
LOGGER.exception(y_e)
return y_e
else:
Expand Down Expand Up @@ -210,7 +210,7 @@ def _tubeDl(url: list, prog, starttime, uid=None):
x = ytdl.YoutubeDL(_opts)
x.add_progress_hook(prog)
dloader = x.download(url)
except ytdl.utils.YoutubeDLError as y_e:
except Exception as y_e: # pylint: disable=broad-except
LOGGER.exception(y_e)
return y_e
else:
Expand Down Expand Up @@ -240,7 +240,7 @@ def _mp3Dl(url, prog, starttime):
x = ytdl.YoutubeDL(_opts)
x.add_progress_hook(prog)
dloader = x.download(url)
except ytdl.utils.YoutubeDLError as y_e:
except Exception as y_e: # pylint: disable=broad-except
LOGGER.exception(y_e)
return y_e
else:
Expand Down

0 comments on commit 0a3ebab

Please sign in to comment.