diff options
author | Remita Amine <remitamine@gmail.com> | 2017-10-12 16:05:25 +0000 |
---|---|---|
committer | Remita Amine <remitamine@gmail.com> | 2017-10-12 16:05:25 +0000 |
commit | b0def2c297293dfee3ec48c73bb92116a0ee0154 (patch) | |
tree | f77aabdee34dba2bd4136cba61eaf965b6797e90 | |
parent | 81ce479f4dcc17b83672f5ca3ffcb2a2d1618c96 (diff) |
[onionstudios] add support for bulbs-video embeds
-rw-r--r-- | youtube_dl/extractor/onionstudios.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/youtube_dl/extractor/onionstudios.py b/youtube_dl/extractor/onionstudios.py index 1d336cf30..c6e3d5640 100644 --- a/youtube_dl/extractor/onionstudios.py +++ b/youtube_dl/extractor/onionstudios.py @@ -13,11 +13,11 @@ from ..utils import ( class OnionStudiosIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?onionstudios\.com/(?:videos/[^/]+-|embed\?.*\bid=)(?P<id>\d+)(?!-)' + _VALID_URL = r'https?://(?:www\.)?onionstudios\.com/(?:video(?:s/[^/]+-|/)|embed\?.*\bid=)(?P<id>\d+)(?!-)' _TESTS = [{ 'url': 'http://www.onionstudios.com/videos/hannibal-charges-forward-stops-for-a-cocktail-2937', - 'md5': 'e49f947c105b8a78a675a0ee1bddedfe', + 'md5': '719d1f8c32094b8c33902c17bcae5e34', 'info_dict': { 'id': '2937', 'ext': 'mp4', @@ -29,12 +29,15 @@ class OnionStudiosIE(InfoExtractor): }, { 'url': 'http://www.onionstudios.com/embed?id=2855&autoplay=true', 'only_matching': True, + }, { + 'url': 'http://www.onionstudios.com/video/6139.json', + 'only_matching': True, }] @staticmethod def _extract_url(webpage): mobj = re.search( - r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?onionstudios\.com/embed.+?)\1', webpage) + r'(?s)<(?:iframe|bulbs-video)[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?onionstudios\.com/(?:embed.+?|video/\d+\.json))\1', webpage) if mobj: return mobj.group('url') |