Improve logging & messages returned

This commit is contained in:
Dylan 2023-08-13 15:23:08 +01:00
parent e0713a8eeb
commit 189f42ef79
3 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,7 @@
failedToScan="Failed to scan your link! This may be due to an incorrect link, private/suspended account, deleted tweet, or recent changes to Twitter's API (Thanks, Elon!)."
failedToScanExtra = "\n\nTwitter gave me this error: "
tweetNotFound="Tweet not found."
unknownError="Unknown Error"
tweetSuspended="This Tweet is from a suspended account."
videoDescLimit=220

View File

@ -166,6 +166,7 @@ def extractStatus(url):
try:
return method(url)
except Exception as e:
print(f"{method.__name__} method failed: {str(e)}")
continue
raise twExtractError.TwExtractError(400, "Extract error")

View File

@ -377,7 +377,7 @@ def vnfFromCacheOrDL(video_link):
elif 'suspended' in exErr.msg:
exErr.msg=msgs.tweetSuspended
else:
exErr.msg=msgs.tweetNotFound
exErr.msg=msgs.unknownError
log.error("VNF Get failed: " + video_link + " " + log.get_exception_traceback_str(exErr))
return None,exErr.msg