From aa41c9c5cf86a1d50612fb399725782d88713b31 Mon Sep 17 00:00:00 2001 From: Michael Moore Date: Mon, 30 Jan 2017 10:59:39 -0600 Subject: [PATCH] Updated Wimp.com extractor to work with newer jPlayer code using data-dash values in the video div tag --- youtube_dl/extractor/wimp.py | 48 ++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/youtube_dl/extractor/wimp.py b/youtube_dl/extractor/wimp.py index 54eb51427..481b06813 100644 --- a/youtube_dl/extractor/wimp.py +++ b/youtube_dl/extractor/wimp.py @@ -12,22 +12,28 @@ class WimpIE(JWPlatformBaseIE): 'info_dict': { 'id': 'maru-is-exhausted', 'ext': 'mp4', - 'title': 'Maru is exhausted.', + 'title': 'Maru Is Exhausted.', 'description': 'md5:57e099e857c0a4ea312542b684a869b8', } }, { 'url': 'http://www.wimp.com/clowncar/', - 'md5': '5c31ad862a90dc5b1f023956faec13fe', + 'md5': '4e2986c793694b55b37cf92521d12bb4', 'info_dict': { - 'id': 'cG4CEr2aiSg', - 'ext': 'webm', - 'title': 'Basset hound clown car...incredible!', - 'description': '5 of my Bassets crawled in this dog loo! www.bellinghambassets.com\n\nFor licensing/usage please contact: licensing(at)jukinmediadotcom', - 'upload_date': '20140303', - 'uploader': 'Gretchen Hoey', - 'uploader_id': 'gretchenandjeff1', + 'id': 'clowncar', + 'ext': 'mp4', + 'title': 'It\'s Like A Clown Car.', + 'description': 'Gretchen Hoey raises Basset Hounds and on this particular day, she catches a few of them snuggling together in one doghouse. After one of them notices her, they all begin to funnel out of the doghouse like clowns in a clown car to greet her.' }, 'add_ie': ['Youtube'], + }, { + 'url': 'http://www.wimp.com/bird-does-funny-march/', + 'md5': 'f2833774cf4d680849989a1cf92a06cc', + 'info_dict': { + 'id': 'bird-does-funny-march', + 'ext': 'mp4', + 'title': 'Bird Does Funny March', + 'description': 'This bird\'s walk might look pretty silly, but as soon as you add some military marching music over it, it becomes the most regal sight you\'ve ever seen.\r\n' + } }] def _real_extract(self, url): @@ -45,13 +51,23 @@ class WimpIE(JWPlatformBaseIE): 'ie_key': YoutubeIE.ie_key(), } - info_dict = self._extract_jwplayer_data( - webpage, video_id, require_title=False) + url = self._search_regex(r'class=\'oyt-container .*? data-src=\'(.*?)\'', webpage, 'Video URL', default=None, fatal=False) - info_dict.update({ - 'id': video_id, - 'title': self._og_search_title(webpage), - 'description': self._og_search_description(webpage), - }) + if url: + info_dict = { + 'id': video_id, + 'title': self._og_search_title(webpage), + 'description': self._og_search_description(webpage), + 'url': url + } + else: + info_dict = self._extract_jwplayer_data( + webpage, video_id, require_title=False) + + info_dict.update({ + 'id': video_id, + 'title': self._og_search_title(webpage), + 'description': self._og_search_description(webpage), + }) return info_dict