diff --git a/sweebot.py b/sweebot.py index 5ebeeb2..0583c4a 100644 --- a/sweebot.py +++ b/sweebot.py @@ -51,13 +51,10 @@ def get_yt_id(url): if query.hostname in {'www.youtube.com', 'youtube.com', 'music.youtube.com'}: # URLs that have the ID in the path instead of the query. integrated_in_url = ["watch", "embed", "v", "shorts"] - try: - # The regular /watch path, which stores the ID in the query. - if query.path == '/watch': return parse_qs(query.query)['v'][0] - # Alternatively, it will get the ID in the path if the path was in the list above. - elif query.path.split('/')[1] in integrated_in_url: return query.path.split('/')[2] - except: - return None + # The regular /watch path, which stores the ID in the query. + if query.path == '/watch': return parse_qs(query.query)['v'][0] + # Alternatively, it will get the ID in the path if the path was in the list above. + elif query.path.split('/')[1] in integrated_in_url: return query.path.split('/')[2] class config: def __init__(self): self.conn = sqlite3.connect(environ["SBconfig"]) @@ -680,6 +677,7 @@ while True: else: raise Exception("No special URL, go ahead and parse the normal title...") except: + print(traceback.formal_exc()) e = get(i, headers=headers, timeout=10) header = e.headers content_type = header.get('content-type').split(";")[0]