Browse Source

[youtube] Clarify rationale for yt:stretch validation

totalwebcasting
Sergey M․ 9 years ago
parent
commit
5faf9fed7e
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      youtube_dl/extractor/youtube.py

+ 2
- 0
youtube_dl/extractor/youtube.py View File

@ -1514,6 +1514,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
if stretched_m: if stretched_m:
w = float(stretched_m.group('w')) w = float(stretched_m.group('w'))
h = float(stretched_m.group('h')) h = float(stretched_m.group('h'))
# yt:stretch may hold invalid ratio data (e.g. for Q39EVAstoRM ratio is 17:0).
# We will only process correct ratios.
if w > 0 and h > 0: if w > 0 and h > 0:
ratio = w / h ratio = w / h
for f in formats: for f in formats:


Loading…
Cancel
Save