X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fcamdemy.py;h=8f0c6c545c35312813bb461b3218f868a660fdd2;hb=384bf91f8802805283f993714ace137e831ba45e;hp=8eece2c029097b34256de40670ddbc36ea95a316;hpb=59eaf69e3300ad7f780d0f976052fcc3416284c1;p=youtube-dl diff --git a/youtube_dl/extractor/camdemy.py b/youtube_dl/extractor/camdemy.py index 8eece2c02..8f0c6c545 100644 --- a/youtube_dl/extractor/camdemy.py +++ b/youtube_dl/extractor/camdemy.py @@ -10,6 +10,7 @@ from ..compat import ( ) from ..utils import ( clean_html, + parse_duration, str_to_int, unified_strdate, ) @@ -25,8 +26,9 @@ class CamdemyIE(InfoExtractor): 'id': '5181', 'ext': 'mp4', 'title': 'Ch1-1 Introduction, Signals (02-23-2012)', - 'thumbnail': 're:^https?://.*\.jpg$', + 'thumbnail': r're:^https?://.*\.jpg$', 'creator': 'ss11spring', + 'duration': 1591, 'upload_date': '20130114', 'view_count': int, } @@ -39,9 +41,10 @@ class CamdemyIE(InfoExtractor): 'id': '13885', 'ext': 'mp4', 'title': 'EverCam + Camdemy QuickStart', - 'thumbnail': 're:^https?://.*\.jpg$', + 'thumbnail': r're:^https?://.*\.jpg$', 'description': 'md5:2a9f989c2b153a2342acee579c6e7db6', 'creator': 'evercam', + 'duration': 318, } }, { # External source (YouTube) @@ -74,6 +77,7 @@ class CamdemyIE(InfoExtractor): oembed_obj = self._download_json( 'http://www.camdemy.com/oembed/?format=json&url=' + url, video_id) + title = oembed_obj['title'] thumb_url = oembed_obj['thumbnail_url'] video_folder = compat_urlparse.urljoin(thumb_url, 'video/') file_list_doc = self._download_xml( @@ -97,18 +101,18 @@ class CamdemyIE(InfoExtractor): return { 'id': video_id, 'url': video_url, - 'title': oembed_obj['title'], + 'title': title, 'thumbnail': thumb_url, 'description': description, - 'creator': oembed_obj['author_name'], - 'duration': oembed_obj['duration'], + 'creator': oembed_obj.get('author_name'), + 'duration': parse_duration(oembed_obj.get('duration')), 'upload_date': upload_date, 'view_count': view_count, } class CamdemyFolderIE(InfoExtractor): - _VALID_URL = r'https?://www.camdemy.com/folder/(?P\d+)' + _VALID_URL = r'https?://(?:www\.)?camdemy\.com/folder/(?P\d+)' _TESTS = [{ # links with trailing slash 'url': 'http://www.camdemy.com/folder/450',