From 9c4c233b846bd9be4c48b788d6d2347af764f15d Mon Sep 17 00:00:00 2001 From: peugeot Date: Sat, 30 Aug 2014 23:05:33 +0200 Subject: [PATCH] Fix exception with n_views<1000 --- youtube_dl/extractor/vporn.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/vporn.py b/youtube_dl/extractor/vporn.py index 0d182b650..645e935ec 100644 --- a/youtube_dl/extractor/vporn.py +++ b/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'((?P\d+),)?(?P\d+) VIEWS', 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,