Fix exception with n_views<1000
authorpeugeot <peugeot@psa.fr>
Sat, 30 Aug 2014 21:05:33 +0000 (23:05 +0200)
committerpeugeot <peugeot@psa.fr>
Sat, 30 Aug 2014 21:05:33 +0000 (23:05 +0200)
youtube_dl/extractor/vporn.py

index 0d182b650779574e520f9f574ab108b7fa819cd4..645e935ecf3b46d66d7a5d16b93a1e42ec62bc8a 100644 (file)
@@ -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,