From 52cffcb186432f9f1b30fba159414aff6a923f59 Mon Sep 17 00:00:00 2001 From: dinesh Date: Thu, 23 Oct 2014 20:27:13 +0530 Subject: [PATCH 1/2] [thoughtworks] wistia support added --- youtube_dl/extractor/generic.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index 9057a6beb..877447381 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -380,6 +380,16 @@ class GenericIE(InfoExtractor): 'uploader': 'education-portal.com', }, }, + { + 'url': 'http://thoughtworks.wistia.com/medias/uxjb0lwrcz', + 'md5': 'baf49c2baa8a7de5f3fc145a8506dcd4', + 'info_dict': { + 'id': 'uxjb0lwrcz', + 'ext': 'mp4', + 'title': 'Conversation about Hexagonal Rails Part 1', + 'duration': 1715.0, + }, + }, ] def report_following_redirect(self, new_url): @@ -651,6 +661,10 @@ class GenericIE(InfoExtractor): playlists, lambda p: '//dailymotion.com/playlist/%s' % p) # Look for embedded Wistia player + mobj = re.search(r'https?://fast\.wistia\.net/embed/iframe/(?P[a-zA-Z0-9_]+)(["\']))', webpage) + if mobj: + return self.url_result(mobj.group('url'), 'Wistia') + match = re.search( r']+?src=(["\'])(?P(?:https?:)?//(?:fast\.)?wistia\.net/embed/iframe/.+?)\1', webpage) if match: @@ -664,6 +678,7 @@ class GenericIE(InfoExtractor): 'title': video_title, 'id': video_id, } + match = re.search(r'(?:id=["\']wistia_|data-wistia-?id=["\']|Wistia\.embed\(["\'])(?P[^"\']+)', webpage) if match: return { From 85d7b7658617895703a3645f14e76a65a1a2f7e6 Mon Sep 17 00:00:00 2001 From: dinesh Date: Thu, 23 Oct 2014 21:23:56 +0530 Subject: [PATCH 2/2] [thoughtworks] wistia regex modified --- youtube_dl/extractor/generic.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index 877447381..bf957fa3f 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -386,8 +386,9 @@ class GenericIE(InfoExtractor): 'info_dict': { 'id': 'uxjb0lwrcz', 'ext': 'mp4', - 'title': 'Conversation about Hexagonal Rails Part 1', + 'title': 'Conversation about Hexagonal Rails Part 1 - ThoughtWorks', 'duration': 1715.0, + 'uploader': 'thoughtworks.wistia.com', }, }, ] @@ -661,12 +662,8 @@ class GenericIE(InfoExtractor): playlists, lambda p: '//dailymotion.com/playlist/%s' % p) # Look for embedded Wistia player - mobj = re.search(r'https?://fast\.wistia\.net/embed/iframe/(?P[a-zA-Z0-9_]+)(["\']))', webpage) - if mobj: - return self.url_result(mobj.group('url'), 'Wistia') - match = re.search( - r']+?src=(["\'])(?P(?:https?:)?//(?:fast\.)?wistia\.net/embed/iframe/.+?)\1', webpage) + r'(?:]+?src)=(["\'])(?P(?:https?:)?//(?:fast\.)?wistia\.net/embed/iframe/.+?)\1', webpage) if match: embed_url = self._proto_relative_url( unescapeHTML(match.group('url')))