Преглед на файлове

[youtube] Use the existing `w` and `h` variables

Lukáš Lalinský преди 9 години
родител
ревизия
41f24c321d
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      youtube_dl/extractor/youtube.py

+ 1 - 1
youtube_dl/extractor/youtube.py

@@ -1515,7 +1515,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
             w = float(stretched_m.group('w'))
             w = float(stretched_m.group('w'))
             h = float(stretched_m.group('h'))
             h = float(stretched_m.group('h'))
             if w > 0 and h > 0:
             if w > 0 and h > 0:
-                ratio = float(stretched_m.group('w')) / float(stretched_m.group('h'))
+                ratio = w / h
                 for f in formats:
                 for f in formats:
                     if f.get('vcodec') != 'none':
                     if f.get('vcodec') != 'none':
                         f['stretched_ratio'] = ratio
                         f['stretched_ratio'] = ratio