From deed48b472b3cfe2f496b0c4ff3fe40a391e6725 Mon Sep 17 00:00:00 2001 From: Sainyam Kapoor Date: Sat, 5 Apr 2014 10:40:03 +0530 Subject: [PATCH 01/18] [Videoweed] Added support for videoweed. --- youtube_dl/extractor/__init__.py | 1 + youtube_dl/extractor/videoweed.py | 69 +++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 youtube_dl/extractor/videoweed.py diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index 66f71edf6..6a98bc42d 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -284,6 +284,7 @@ from .vimeo import ( VimeoGroupsIE, VimeoReviewIE, ) +from .videoweed import VideoweedIE from .vine import VineIE from .viki import VikiIE from .vk import VKIE diff --git a/youtube_dl/extractor/videoweed.py b/youtube_dl/extractor/videoweed.py new file mode 100644 index 000000000..7110ecaa2 --- /dev/null +++ b/youtube_dl/extractor/videoweed.py @@ -0,0 +1,69 @@ +from __future__ import unicode_literals + +import re + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + compat_urlparse +) + + +class VideoweedIE(InfoExtractor): + IE_NAME = 'videoweed' + IE_DESC = 'VideoWEED' + + #_VALID_URL = r'http://(?:(?:www\.)?%(host)s/file/|(?:(?:embed|www)\.)%(host)s/embed\.php\?(?:.*?&)?v=)(?P[a-z\d]{13})' % {'host': 'videoweed\.com'} + _VALID_URL =r'http://(?:www\.)videoweed\.es/file/(?P[^"]+)' + _HOST = 'www.videoweed.es' + + _FILE_DELETED_REGEX = r'>This file no longer exists on our servers.[^"]+)";' + _TITLE_REGEX = r'

([^<]+)

' + _DESCRIPTION_REGEX = r'(?s)
\s*

[^<]+

([^<]+)

' + + _TEST = { + 'url': 'http://www.videoweed.es/file/89868b4aa3bdf', + 'md5': '7205f346a52bbeba427603ba10d4b935', + 'info_dict': { + 'id': '89868b4aa3bdf', + 'ext': 'flv', + 'title': 'law and order svu 103 dvdrip', + 'description': '' + }, + 'skip': '"Invalid token" errors abound (in web interface as well as youtube-dl, there is nothing we can do about it.)' + } + + def _real_extract(self, url): + mobj = re.match(self._VALID_URL, url) + video_id = mobj.group('id') + print "itworks" + page = self._download_webpage( + 'http://%s/file/%s' % (self._HOST, video_id), video_id, 'Downloading video page') + + if re.search(self._FILE_DELETED_REGEX, page) is not None: + raise ExtractorError(u'Video %s does not exist' % video_id, expected=True) + + filekey = self._search_regex(self._FILEKEY_REGEX, page, 'filekey') + + title = self._html_search_regex(self._TITLE_REGEX, page, 'title', fatal=False) + + description = self._html_search_regex(self._DESCRIPTION_REGEX, page, 'description', default='', fatal=False) + + api_response = self._download_webpage( + 'http://%s/api/player.api.php?key=%s&file=%s' % (self._HOST, filekey, video_id), video_id, + 'Downloading video api response') + + response = compat_urlparse.parse_qs(api_response) + + if 'error_msg' in response: + raise ExtractorError('%s returned error: %s' % (self.IE_NAME, response['error_msg'][0]), expected=True) + + video_url = response['url'][0] + + return { + 'id': video_id, + 'url': video_url, + 'title': title, + 'description': description + } \ No newline at end of file From d6e40507d04aaceb215f4e5efb6f88b36d96d4be Mon Sep 17 00:00:00 2001 From: Sainyam Kapoor Date: Sat, 5 Apr 2014 10:53:22 +0530 Subject: [PATCH 02/18] [videoweed]Cleanup --- youtube_dl/extractor/videoweed.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/videoweed.py b/youtube_dl/extractor/videoweed.py index 7110ecaa2..55a0f1833 100644 --- a/youtube_dl/extractor/videoweed.py +++ b/youtube_dl/extractor/videoweed.py @@ -37,7 +37,7 @@ class VideoweedIE(InfoExtractor): def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) video_id = mobj.group('id') - print "itworks" + page = self._download_webpage( 'http://%s/file/%s' % (self._HOST, video_id), video_id, 'Downloading video page') From 91745595d355711194ad57da8630b28ebe011da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 5 Apr 2014 15:32:55 +0700 Subject: [PATCH 03/18] [videoweed] Simplify --- youtube_dl/extractor/__init__.py | 2 +- youtube_dl/extractor/videoweed.py | 64 ++++++------------------------- 2 files changed, 12 insertions(+), 54 deletions(-) diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index 6a98bc42d..f8de85b27 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -276,6 +276,7 @@ from .videodetective import VideoDetectiveIE from .videolecturesnet import VideoLecturesNetIE from .videofyme import VideofyMeIE from .videopremium import VideoPremiumIE +from .videoweed import VideoWeedIE from .vimeo import ( VimeoIE, VimeoChannelIE, @@ -284,7 +285,6 @@ from .vimeo import ( VimeoGroupsIE, VimeoReviewIE, ) -from .videoweed import VideoweedIE from .vine import VineIE from .viki import VikiIE from .vk import VKIE diff --git a/youtube_dl/extractor/videoweed.py b/youtube_dl/extractor/videoweed.py index 55a0f1833..1a69dcd89 100644 --- a/youtube_dl/extractor/videoweed.py +++ b/youtube_dl/extractor/videoweed.py @@ -1,69 +1,27 @@ from __future__ import unicode_literals -import re - -from .common import InfoExtractor -from ..utils import ( - ExtractorError, - compat_urlparse -) +from .novamov import NovaMovIE -class VideoweedIE(InfoExtractor): +class VideoWeedIE(NovaMovIE): IE_NAME = 'videoweed' - IE_DESC = 'VideoWEED' + IE_DESC = 'VideoWeed' + + _VALID_URL = NovaMovIE._VALID_URL_TEMPLATE % {'host': 'videoweed\.(?:es|com)'} - #_VALID_URL = r'http://(?:(?:www\.)?%(host)s/file/|(?:(?:embed|www)\.)%(host)s/embed\.php\?(?:.*?&)?v=)(?P[a-z\d]{13})' % {'host': 'videoweed\.com'} - _VALID_URL =r'http://(?:www\.)videoweed\.es/file/(?P[^"]+)' _HOST = 'www.videoweed.es' - _FILE_DELETED_REGEX = r'>This file no longer exists on our servers.This file no longer exists on our servers.<' _FILEKEY_REGEX = r'flashvars\.filekey="(?P[^"]+)";' _TITLE_REGEX = r'

([^<]+)

' - _DESCRIPTION_REGEX = r'(?s)
\s*

[^<]+

([^<]+)

' _TEST = { - 'url': 'http://www.videoweed.es/file/89868b4aa3bdf', - 'md5': '7205f346a52bbeba427603ba10d4b935', + 'url': 'http://www.videoweed.es/file/b42178afbea14', + 'md5': 'abd31a2132947262c50429e1d16c1bfd', 'info_dict': { - 'id': '89868b4aa3bdf', + 'id': 'b42178afbea14', 'ext': 'flv', - 'title': 'law and order svu 103 dvdrip', + 'title': 'optical illusion dissapeared image magic illusion', 'description': '' }, - 'skip': '"Invalid token" errors abound (in web interface as well as youtube-dl, there is nothing we can do about it.)' - } - - def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) - video_id = mobj.group('id') - - page = self._download_webpage( - 'http://%s/file/%s' % (self._HOST, video_id), video_id, 'Downloading video page') - - if re.search(self._FILE_DELETED_REGEX, page) is not None: - raise ExtractorError(u'Video %s does not exist' % video_id, expected=True) - - filekey = self._search_regex(self._FILEKEY_REGEX, page, 'filekey') - - title = self._html_search_regex(self._TITLE_REGEX, page, 'title', fatal=False) - - description = self._html_search_regex(self._DESCRIPTION_REGEX, page, 'description', default='', fatal=False) - - api_response = self._download_webpage( - 'http://%s/api/player.api.php?key=%s&file=%s' % (self._HOST, filekey, video_id), video_id, - 'Downloading video api response') - - response = compat_urlparse.parse_qs(api_response) - - if 'error_msg' in response: - raise ExtractorError('%s returned error: %s' % (self.IE_NAME, response['error_msg'][0]), expected=True) - - video_url = response['url'][0] - - return { - 'id': video_id, - 'url': video_url, - 'title': title, - 'description': description - } \ No newline at end of file + } \ No newline at end of file From 60ccc59a1c5d8e6976ff2496f223a54ffb687d57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 5 Apr 2014 15:34:54 +0700 Subject: [PATCH 04/18] [novamov] Improve _VALID_URL --- youtube_dl/extractor/novamov.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/novamov.py b/youtube_dl/extractor/novamov.py index fd310e219..dde9bea69 100644 --- a/youtube_dl/extractor/novamov.py +++ b/youtube_dl/extractor/novamov.py @@ -13,7 +13,8 @@ class NovaMovIE(InfoExtractor): IE_NAME = 'novamov' IE_DESC = 'NovaMov' - _VALID_URL = r'http://(?:(?:www\.)?%(host)s/video/|(?:(?:embed|www)\.)%(host)s/embed\.php\?(?:.*?&)?v=)(?P[a-z\d]{13})' % {'host': 'novamov\.com'} + _VALID_URL_TEMPLATE = r'http://(?:(?:www\.)?%(host)s/(?:file|video)/|(?:(?:embed|www)\.)%(host)s/embed\.php\?(?:.*?&)?v=)(?P[a-z\d]{13})' + _VALID_URL = _VALID_URL_TEMPLATE % {'host': 'novamov\.com'} _HOST = 'www.novamov.com' From 92810ff4978871f2861c80c1b174295740d34de6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 5 Apr 2014 15:35:21 +0700 Subject: [PATCH 05/18] [nowvideo] Improve _VALID_URL --- youtube_dl/extractor/nowvideo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/nowvideo.py b/youtube_dl/extractor/nowvideo.py index dd665874d..8e6ec2344 100644 --- a/youtube_dl/extractor/nowvideo.py +++ b/youtube_dl/extractor/nowvideo.py @@ -7,7 +7,7 @@ class NowVideoIE(NovaMovIE): IE_NAME = 'nowvideo' IE_DESC = 'NowVideo' - _VALID_URL = r'http://(?:(?:www\.)?%(host)s/video/|(?:(?:embed|www)\.)%(host)s/embed\.php\?(?:.*?&)?v=)(?P[a-z\d]{13})' % {'host': 'nowvideo\.(?:ch|sx|eu)'} + _VALID_URL = NovaMovIE._VALID_URL_TEMPLATE % {'host': 'nowvideo\.(?:ch|sx|eu)'} _HOST = 'www.nowvideo.ch' From 50f566076fe4167f0fd6028b0cde7046c5554e93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 5 Apr 2014 15:49:45 +0700 Subject: [PATCH 06/18] [generic] Add support for videoweed embeds --- youtube_dl/extractor/generic.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index 238cc7125..1c45ebb00 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -523,6 +523,12 @@ class GenericIE(InfoExtractor): if mobj is not None: return self.url_result(mobj.group('url'), 'NowVideo') + # Look for embedded VideoWeed player + mobj = re.search( + r']+?src=(["\'])(?Phttp://(?:(?:embed|www)\.)?videoweed\.(?:es|com)/embed\.php.+?)\1', webpage) + if mobj is not None: + return self.url_result(mobj.group('url'), 'VideoWeed') + # Look for embedded Facebook player mobj = re.search( r']+?src=(["\'])(?Phttps://www\.facebook\.com/video/embed.+?)\1', webpage) From 610e47c87e23bcadb5ef74ed4d008fc5f2a66302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 5 Apr 2014 15:53:50 +0700 Subject: [PATCH 07/18] Credit @sainyamkapoor for videoweed extractor --- youtube_dl/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index aba8b4537..7e504b75c 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -52,6 +52,7 @@ __authors__ = ( 'Juan C. Olivares', 'Mattias Harrysson', 'phaer', + 'Sainyam Kapoor', ) __license__ = 'Public Domain' From 1ff7c0f7d804dedb9186490f2d61c773e62650c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 5 Apr 2014 16:09:03 +0700 Subject: [PATCH 08/18] [movshare] Add support for movshare.net --- youtube_dl/extractor/__init__.py | 1 + youtube_dl/extractor/movshare.py | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 youtube_dl/extractor/movshare.py diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index f8de85b27..689f94f67 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -156,6 +156,7 @@ from .mofosex import MofosexIE from .mooshare import MooshareIE from .morningstar import MorningstarIE from .motorsport import MotorsportIE +from .movshare import MovShareIE from .mtv import ( MTVIE, MTVIggyIE, diff --git a/youtube_dl/extractor/movshare.py b/youtube_dl/extractor/movshare.py new file mode 100644 index 000000000..2cf8b64bb --- /dev/null +++ b/youtube_dl/extractor/movshare.py @@ -0,0 +1,26 @@ +from __future__ import unicode_literals + +from .novamov import NovaMovIE + + +class MovShareIE(NovaMovIE): + IE_NAME = 'movshare' + IE_DESC = 'MovShare' + + _VALID_URL = NovaMovIE._VALID_URL_TEMPLATE % {'host': 'movshare\.(?:net|sx)'} + + _HOST = 'www.movshare.net' + + _TITLE_REGEX = r'Title: ([^<]+)

' + _DESCRIPTION_REGEX = r'Description: ([^<]+)

' + + _TEST = { + 'url': 'http://www.movshare.net/video/559e28be54d96', + 'md5': 'abd31a2132947262c50429e1d16c1bfd', + 'info_dict': { + 'id': '559e28be54d96', + 'ext': 'flv', + 'title': 'dissapeared image', + 'description': 'optical illusion dissapeared image magic illusion', + } + } \ No newline at end of file From 4479bf2762213ea4372a72138afcd2a5bb444e23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 5 Apr 2014 16:09:28 +0700 Subject: [PATCH 09/18] [videoweed] Simplify --- youtube_dl/extractor/videoweed.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/youtube_dl/extractor/videoweed.py b/youtube_dl/extractor/videoweed.py index 1a69dcd89..6d6e8e9c4 100644 --- a/youtube_dl/extractor/videoweed.py +++ b/youtube_dl/extractor/videoweed.py @@ -11,8 +11,6 @@ class VideoWeedIE(NovaMovIE): _HOST = 'www.videoweed.es' - _FILE_DELETED_REGEX = r'>This file no longer exists on our servers.<' - _FILEKEY_REGEX = r'flashvars\.filekey="(?P[^"]+)";' _TITLE_REGEX = r'

([^<]+)

' _TEST = { From 6f88df2c577786f05741e8bcf8d379262641831d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 5 Apr 2014 16:29:44 +0700 Subject: [PATCH 10/18] [divxstage] Add support for divxstage.eu --- youtube_dl/extractor/__init__.py | 1 + youtube_dl/extractor/divxstage.py | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 youtube_dl/extractor/divxstage.py diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index 689f94f67..65d97d94f 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -62,6 +62,7 @@ from .dotsub import DotsubIE from .dreisat import DreiSatIE from .defense import DefenseGouvFrIE from .discovery import DiscoveryIE +from .divxstage import DivxStageIE from .dropbox import DropboxIE from .ebaumsworld import EbaumsWorldIE from .ehow import EHowIE diff --git a/youtube_dl/extractor/divxstage.py b/youtube_dl/extractor/divxstage.py new file mode 100644 index 000000000..4b323dd2c --- /dev/null +++ b/youtube_dl/extractor/divxstage.py @@ -0,0 +1,27 @@ +from __future__ import unicode_literals + +from .novamov import NovaMovIE + + +class DivxStageIE(NovaMovIE): + IE_NAME = 'divstage' + IE_DESC = 'DivxStage' + + _VALID_URL = NovaMovIE._VALID_URL_TEMPLATE % {'host': 'divxstage\.(?:eu|net)'} + + _HOST = 'www.divxstage.eu' + + _FILE_DELETED_REGEX = r'>This file no longer exists on our servers.<' + _TITLE_REGEX = r'
\s*([^<]+)' + _DESCRIPTION_REGEX = r'
\s*[^<]+\s*

([^<]+)

' + + _TEST = { + 'url': 'http://www.divxstage.eu/video/57f238e2e5e01', + 'md5': '63969f6eb26533a1968c4d325be63e72', + 'info_dict': { + 'id': '57f238e2e5e01', + 'ext': 'flv', + 'title': 'youtubedl test video', + 'description': 'This is a test video for youtubedl.', + } + } \ No newline at end of file From d0e4cf82f19de1ddd8adb7b234fa28f37c54161b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 5 Apr 2014 16:31:38 +0700 Subject: [PATCH 11/18] [movshare] Add _FILE_DELETED_REGEX --- youtube_dl/extractor/movshare.py | 1 + 1 file changed, 1 insertion(+) diff --git a/youtube_dl/extractor/movshare.py b/youtube_dl/extractor/movshare.py index 2cf8b64bb..bb2ae6d05 100644 --- a/youtube_dl/extractor/movshare.py +++ b/youtube_dl/extractor/movshare.py @@ -11,6 +11,7 @@ class MovShareIE(NovaMovIE): _HOST = 'www.movshare.net' + _FILE_DELETED_REGEX = r'>This file no longer exists on our servers.<' _TITLE_REGEX = r'Title: ([^<]+)

' _DESCRIPTION_REGEX = r'Description: ([^<]+)

' From 931055e6cbd45b6a0b001006d840edd2b5af7d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 5 Apr 2014 16:32:14 +0700 Subject: [PATCH 12/18] [videoweed] Revert _FILE_DELETED_REGEX --- youtube_dl/extractor/videoweed.py | 1 + 1 file changed, 1 insertion(+) diff --git a/youtube_dl/extractor/videoweed.py b/youtube_dl/extractor/videoweed.py index 6d6e8e9c4..4a08ddd43 100644 --- a/youtube_dl/extractor/videoweed.py +++ b/youtube_dl/extractor/videoweed.py @@ -11,6 +11,7 @@ class VideoWeedIE(NovaMovIE): _HOST = 'www.videoweed.es' + _FILE_DELETED_REGEX = r'>This file no longer exists on our servers.<' _TITLE_REGEX = r'

([^<]+)

' _TEST = { From 7cd3bc5f99f76fb6e8bdc94f8c26338da65d47d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 5 Apr 2014 16:38:57 +0700 Subject: [PATCH 13/18] [nowvideo] Support more domains --- youtube_dl/extractor/generic.py | 2 +- youtube_dl/extractor/nowvideo.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index 1c45ebb00..e0d227aec 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -519,7 +519,7 @@ class GenericIE(InfoExtractor): # Look for embedded NowVideo player mobj = re.search( - r']+?src=(["\'])(?Phttp://(?:(?:embed|www)\.)?nowvideo\.(?:ch|sx|eu)/embed\.php.+?)\1', webpage) + r']+?src=(["\'])(?Phttp://(?:(?:embed|www)\.)?nowvideo\.(?:ch|sx|eu|at|ag|co)/embed\.php.+?)\1', webpage) if mobj is not None: return self.url_result(mobj.group('url'), 'NowVideo') diff --git a/youtube_dl/extractor/nowvideo.py b/youtube_dl/extractor/nowvideo.py index 8e6ec2344..bfba18418 100644 --- a/youtube_dl/extractor/nowvideo.py +++ b/youtube_dl/extractor/nowvideo.py @@ -7,7 +7,7 @@ class NowVideoIE(NovaMovIE): IE_NAME = 'nowvideo' IE_DESC = 'NowVideo' - _VALID_URL = NovaMovIE._VALID_URL_TEMPLATE % {'host': 'nowvideo\.(?:ch|sx|eu)'} + _VALID_URL = NovaMovIE._VALID_URL_TEMPLATE % {'host': 'nowvideo\.(?:ch|sx|eu|at|ag|co)'} _HOST = 'www.nowvideo.ch' From 342f33bf9eff2bbe2d1df43f16b240c904a0338f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 5 Apr 2014 16:50:05 +0700 Subject: [PATCH 14/18] [divxstage] Support more domains --- youtube_dl/extractor/divxstage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/divxstage.py b/youtube_dl/extractor/divxstage.py index 4b323dd2c..c76844b39 100644 --- a/youtube_dl/extractor/divxstage.py +++ b/youtube_dl/extractor/divxstage.py @@ -7,7 +7,7 @@ class DivxStageIE(NovaMovIE): IE_NAME = 'divstage' IE_DESC = 'DivxStage' - _VALID_URL = NovaMovIE._VALID_URL_TEMPLATE % {'host': 'divxstage\.(?:eu|net)'} + _VALID_URL = NovaMovIE._VALID_URL_TEMPLATE % {'host': 'divxstage\.(?:eu|net|ch|co|at|ag)'} _HOST = 'www.divxstage.eu' From 9d0993ec4a07dae779f83490811a6aba2d4711b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 5 Apr 2014 17:00:18 +0700 Subject: [PATCH 15/18] [movshare] Support more domains --- youtube_dl/extractor/movshare.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/movshare.py b/youtube_dl/extractor/movshare.py index bb2ae6d05..4191cf7a0 100644 --- a/youtube_dl/extractor/movshare.py +++ b/youtube_dl/extractor/movshare.py @@ -7,7 +7,7 @@ class MovShareIE(NovaMovIE): IE_NAME = 'movshare' IE_DESC = 'MovShare' - _VALID_URL = NovaMovIE._VALID_URL_TEMPLATE % {'host': 'movshare\.(?:net|sx)'} + _VALID_URL = NovaMovIE._VALID_URL_TEMPLATE % {'host': 'movshare\.(?:net|sx|ag)'} _HOST = 'www.movshare.net' From cca37fba486562efac63cfe4820ea9184c6857b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 5 Apr 2014 17:15:43 +0700 Subject: [PATCH 16/18] [divxstage] Fix typo in IE_NAME --- youtube_dl/extractor/divxstage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/divxstage.py b/youtube_dl/extractor/divxstage.py index c76844b39..4ca3f37a2 100644 --- a/youtube_dl/extractor/divxstage.py +++ b/youtube_dl/extractor/divxstage.py @@ -4,7 +4,7 @@ from .novamov import NovaMovIE class DivxStageIE(NovaMovIE): - IE_NAME = 'divstage' + IE_NAME = 'divxstage' IE_DESC = 'DivxStage' _VALID_URL = NovaMovIE._VALID_URL_TEMPLATE % {'host': 'divxstage\.(?:eu|net|ch|co|at|ag)'} From 15c0e8e7b264c926b2cdc90d00c88368acd4eeba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 5 Apr 2014 17:20:05 +0700 Subject: [PATCH 17/18] [generic] Generalize novamov based embeds --- youtube_dl/extractor/generic.py | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index e0d227aec..cf245d9cd 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -511,23 +511,18 @@ class GenericIE(InfoExtractor): if mobj is not None: return self.url_result(mobj.group(1), 'Mpora') - # Look for embedded NovaMov player + # Look for embedded NovaMov-based player mobj = re.search( - r']+?src=(["\'])(?Phttp://(?:(?:embed|www)\.)?novamov\.com/embed\.php.+?)\1', webpage) + r'''(?x)]+?src=(["\']) + (?Phttp://(?:(?:embed|www)\.)? + (?:novamov\.com| + nowvideo\.(?:ch|sx|eu|at|ag|co)| + videoweed\.(?:es|com)| + movshare\.(?:net|sx|ag)| + divxstage\.(?:eu|net|ch|co|at|ag)) + /embed\.php.+?)\1''', webpage) if mobj is not None: - return self.url_result(mobj.group('url'), 'NovaMov') - - # Look for embedded NowVideo player - mobj = re.search( - r']+?src=(["\'])(?Phttp://(?:(?:embed|www)\.)?nowvideo\.(?:ch|sx|eu|at|ag|co)/embed\.php.+?)\1', webpage) - if mobj is not None: - return self.url_result(mobj.group('url'), 'NowVideo') - - # Look for embedded VideoWeed player - mobj = re.search( - r']+?src=(["\'])(?Phttp://(?:(?:embed|www)\.)?videoweed\.(?:es|com)/embed\.php.+?)\1', webpage) - if mobj is not None: - return self.url_result(mobj.group('url'), 'VideoWeed') + return self.url_result(mobj.group('url')) # Look for embedded Facebook player mobj = re.search( From 17c5a0077463240ec37aa6275ad65b6b0f79efeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 5 Apr 2014 19:36:22 +0700 Subject: [PATCH 18/18] [novamov] Simplify --- youtube_dl/extractor/novamov.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/novamov.py b/youtube_dl/extractor/novamov.py index dde9bea69..2e7ab1e4f 100644 --- a/youtube_dl/extractor/novamov.py +++ b/youtube_dl/extractor/novamov.py @@ -13,7 +13,7 @@ class NovaMovIE(InfoExtractor): IE_NAME = 'novamov' IE_DESC = 'NovaMov' - _VALID_URL_TEMPLATE = r'http://(?:(?:www\.)?%(host)s/(?:file|video)/|(?:(?:embed|www)\.)%(host)s/embed\.php\?(?:.*?&)?v=)(?P[a-z\d]{13})' + _VALID_URL_TEMPLATE = r'http://(?:(?:www\.)?%(host)s/(?:file|video)/|(?:(?:embed|www)\.)%(host)s/embed\.php\?(?:.*?&)?v=)(?P[a-z\d]{13})' _VALID_URL = _VALID_URL_TEMPLATE % {'host': 'novamov\.com'} _HOST = 'www.novamov.com' @@ -37,18 +37,17 @@ class NovaMovIE(InfoExtractor): def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) - video_id = mobj.group('videoid') + video_id = mobj.group('id') page = self._download_webpage( 'http://%s/video/%s' % (self._HOST, video_id), video_id, 'Downloading video page') if re.search(self._FILE_DELETED_REGEX, page) is not None: - raise ExtractorError(u'Video %s does not exist' % video_id, expected=True) + raise ExtractorError('Video %s does not exist' % video_id, expected=True) filekey = self._search_regex(self._FILEKEY_REGEX, page, 'filekey') title = self._html_search_regex(self._TITLE_REGEX, page, 'title', fatal=False) - description = self._html_search_regex(self._DESCRIPTION_REGEX, page, 'description', default='', fatal=False) api_response = self._download_webpage(