diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 1cab440f4..5d39e3018 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -396,6 +396,7 @@ from .fusion import FusionIE from .fxnetworks import FXNetworksIE from .gaia import GaiaIE from .gameinformer import GameInformerIE +from .gamerdvr import GamerDVRIE from .gamespot import GameSpotIE from .gamestar import GameStarIE from .gaskrank import GaskrankIE diff --git a/youtube_dl/extractor/gamerdvr.py b/youtube_dl/extractor/gamerdvr.py new file mode 100644 index 000000000..d70ed1b55 --- /dev/null +++ b/youtube_dl/extractor/gamerdvr.py @@ -0,0 +1,39 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class GamerDVRIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?gamerdvr\.com/gamer/\S+/video/(?P\d+)' + _TEST = { + 'url': 'https://gamerdvr.com/gamer/videogamer3/video/83193307', + 'md5': 'f747c74fbc7617a70d8c071927623cde', + 'info_dict': { + 'id': '83193307', + 'ext': 'mp4', + 'title': "videogamer3's Xbox Call of Duty®: Modern Warfare® clip 83193307. Find your Xbox clips on GamerDVR.com", + 'description': "videogamer3's Xbox Call of Duty®: Modern Warfare® clips and gameplay playing Call of Duty®: Modern Warfare®. All your Xbox clips and screenshots on GamerDVR.com. View, manage, and share easily!", + 'uploader': 'videogamer3' + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + video_url = self._html_search_regex( + r"(.+?)', webpage, 'title') + description = self._html_search_regex( + r"[\w-]{36})' + _VALID_URL = r'https?://(?:www\.)?xboxclips\.com/\S+?/(?P[a-zA-Z0-9-]{36})' _TEST = { - 'url': 'http://xboxclips.com/video.php?uid=2533274823424419&gamertag=Iabdulelah&vid=074a69a9-5faf-46aa-b93b-9909c1720325', - 'md5': 'fbe1ec805e920aeb8eced3c3e657df5d', + 'url': 'https://xboxclips.com/DeeperGnu613/7936bcb9-83fc-4565-979b-8db96bffa460', + 'md5': 'e434323563f3ae6f02ab1f5b8f514f28', 'info_dict': { - 'id': '074a69a9-5faf-46aa-b93b-9909c1720325', + 'id': '7936bcb9-83fc-4565-979b-8db96bffa460', 'ext': 'mp4', - 'title': 'Iabdulelah playing Titanfall', - 'filesize_approx': 26800000, - 'upload_date': '20140807', - 'duration': 56, + 'title': "XboxClips - DeeperGnu613 playing Forza Horizon 4", + 'uploader': 'DeeperGnu613' } } def _real_extract(self, url): video_id = self._match_id(url) - webpage = self._download_webpage(url, video_id) - video_url = self._html_search_regex( - r'>(?:Link|Download): ]+href="([^"]+)"', webpage, 'video URL') + r"XboxClips \| ([^<]+)', webpage, 'title') - upload_date = unified_strdate(self._html_search_regex( - r'>Recorded: ([^<]+)<', webpage, 'upload date', fatal=False)) - filesize = parse_filesize(self._html_search_regex( - r'>Size: ([^<]+)<', webpage, 'file size', fatal=False)) - duration = int_or_none(self._html_search_regex( - r'>Duration: (\d+) Seconds<', webpage, 'duration', fatal=False)) - view_count = int_or_none(self._html_search_regex( - r'>Views: (\d+)<', webpage, 'view count', fatal=False)) - + r'(.+?)', webpage, 'title') + uploader = self._html_search_regex( + r'

(.+?)

', webpage, 'uploader') return { 'id': video_id, - 'url': video_url, 'title': title, - 'upload_date': upload_date, - 'filesize_approx': filesize, - 'duration': duration, - 'view_count': view_count, - } + 'uploader': uploader, + 'url': video_url + } \ No newline at end of file