X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fvimeo.py;h=255855558cf64ddfe847db56e00e029f4bbbdf22;hb=ad3bc6acd5d6724875b9fa59f9b5cdb9b904ec91;hp=2e1a09a0b7c0caa7a8947eab2be895b607e6b7ca;hpb=4f3e943080f3381213ee979647f68eee43af4bb8;p=youtube-dl diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dl/extractor/vimeo.py index 2e1a09a0b..255855558 100644 --- a/youtube_dl/extractor/vimeo.py +++ b/youtube_dl/extractor/vimeo.py @@ -18,6 +18,7 @@ from ..utils import ( std_headers, unsmuggle_url, urlencode_postdata, + int_or_none, ) @@ -74,6 +75,7 @@ class VimeoIE(VimeoBaseInfoExtractor, SubtitlesInfoExtractor): "uploader_id": "user7108434", "uploader": "Filippo Valsorda", "title": "youtube-dl test video - \u2605 \" ' \u5e78 / \\ \u00e4 \u21ad \U0001d550", + "duration": 10, }, }, { @@ -86,6 +88,7 @@ class VimeoIE(VimeoBaseInfoExtractor, SubtitlesInfoExtractor): 'uploader_id': 'openstreetmapus', 'uploader': 'OpenStreetMap US', 'title': 'Andy Allan - Putting the Carto into OpenStreetMap Cartography', + 'duration': 1595, }, }, { @@ -98,6 +101,7 @@ class VimeoIE(VimeoBaseInfoExtractor, SubtitlesInfoExtractor): 'title': 'Kathy Sierra: Building the minimum Badass User, Business of Software', 'uploader': 'The BLN & Business of Software', 'uploader_id': 'theblnbusinessofsoftware', + 'duration': 3610, }, }, { @@ -111,6 +115,7 @@ class VimeoIE(VimeoBaseInfoExtractor, SubtitlesInfoExtractor): 'upload_date': '20130614', 'uploader_id': 'user18948128', 'uploader': 'Jaime Marquínez Ferrándiz', + 'duration': 10, }, 'params': { 'videopassword': 'youtube-dl', @@ -128,6 +133,7 @@ class VimeoIE(VimeoBaseInfoExtractor, SubtitlesInfoExtractor): 'upload_date': '20131015', 'uploader_id': 'staff', 'uploader': 'Vimeo Staff', + 'duration': 62, } }, ] @@ -273,6 +279,9 @@ class VimeoIE(VimeoBaseInfoExtractor, SubtitlesInfoExtractor): else: raise + # Extract video duration + video_duration = int_or_none(config["video"].get("duration")) + # Extract upload date video_upload_date = None mobj = re.search(r'