Add extra logging
This commit is contained in:
parent
df8537e811
commit
a31d7d5a90
1 changed files with 4 additions and 1 deletions
5
app.py
5
app.py
|
@ -371,7 +371,10 @@ def proxy(video_id):
|
|||
# so in addition to including these when the User Agent is a Twitter bot,
|
||||
# we also include them when the video is too long to download in order to remove the play button.
|
||||
if 'twitterbot' in request_user_agent or not download_allowed:
|
||||
logger.info(f"{video_id}: Twitterbot detected - adding Twitter tags")
|
||||
if 'twitterbot' in request_user_agent:
|
||||
logger.info(f"{video_id}: Twitterbot detected - adding Twitter tags")
|
||||
if not download_allowed:
|
||||
logger.info(f"{video_id}: Video too long to download - will not show play button")
|
||||
og_tags_str += f'\n<meta content="{thumbnail_url}" property="twitter:image"/>'
|
||||
og_tags_str += '\n<meta content="summary_large_image" property="twitter:card"/>'
|
||||
og_tags_str += '\n<meta content="www.nicovideo.gay" name="twitter:domain"/>'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue