Re-order download allowed logic
This commit is contained in:
parent
8089130b7e
commit
abbe5c3bd9
6
app.py
6
app.py
@ -312,13 +312,13 @@ def proxy(video_id):
|
||||
video_width, video_height = get_video_resolution(params) if params else (None, None)
|
||||
|
||||
download_allowed = True
|
||||
if params['video']['duration'] > 60 * 20: # 20 minutes
|
||||
logger.info(f"{video_id}: Video download ignored due to duration ({params['video']['duration']} seconds)")
|
||||
download_allowed = False
|
||||
request_user_agent = request.headers.get('User-Agent', '').lower()
|
||||
if download_allowed and 'discordbot' not in request_user_agent:
|
||||
logger.info(f"{video_id}: Video download ignored due to user agent ({request_user_agent})")
|
||||
download_allowed = False
|
||||
if params['video']['duration'] > 60 * 20: # 20 minutes
|
||||
logger.info(f"{video_id}: Video download ignored due to duration ({params['video']['duration']} seconds)")
|
||||
download_allowed = False
|
||||
video_quality = get_video_quality(params) if params else None
|
||||
if download_allowed and video_quality is not None:
|
||||
video_in_cdn = is_video_in_cdn(video_id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user