瀏覽代碼

Fix exception with n_views<1000

peugeot 11 年之前
父節點
當前提交
9c4c233b84
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      youtube_dl/extractor/vporn.py

+ 5 - 1
youtube_dl/extractor/vporn.py

@@ -35,7 +35,11 @@ class VpornIE(InfoExtractor):
         duration = int(mobj.group('minutes')) * 60 + int(mobj.group('seconds')) if mobj else None
 
         mobj = re.search(r'<span>((?P<thousands>\d+),)?(?P<units>\d+) VIEWS</span>', webpage)
-        view_count = int(mobj.group('thousands')) * 1000 + int(mobj.group('units')) if mobj else None
+        try:
+            view_count = int(mobj.group('units'))
+            view_count += int(mobj.group('thousands')) * 1000
+        except:
+            pass
 
         return {
             'id': video_id,