Fixed tweet not found error

This commit is contained in:
Dylan
2023-05-04 23:29:12 +01:00
parent 69b99dcc9b
commit d84938ee08

View File

@ -14,6 +14,7 @@ import twExtract as twExtract
from configHandler import config from configHandler import config
from cache import addVnfToLinkCache,getVnfFromLinkCache from cache import addVnfToLinkCache,getVnfFromLinkCache
from yt_dlp.utils import ExtractorError from yt_dlp.utils import ExtractorError
from twitter.api import TwitterHTTPError
app = Flask(__name__) app = Flask(__name__)
CORS(app) CORS(app)
@ -206,6 +207,11 @@ def vnfFromCacheOrDL(video_link):
else: else:
exErr.msg=None exErr.msg=None
return None,exErr.msg return None,exErr.msg
except TwitterHTTPError as twErr:
if twErr.e.code == 404:
return None,msgs.tweetNotFound
else:
return None,None
except Exception as e: except Exception as e:
print(e) print(e)
return None,None return None,None