mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-07 08:07:15 +08:00
Added GamerDVR and XboxClips
This commit is contained in:
parent
a3eeef2035
commit
1fd12ae04d
@ -396,6 +396,7 @@ from .fusion import FusionIE
|
|||||||
from .fxnetworks import FXNetworksIE
|
from .fxnetworks import FXNetworksIE
|
||||||
from .gaia import GaiaIE
|
from .gaia import GaiaIE
|
||||||
from .gameinformer import GameInformerIE
|
from .gameinformer import GameInformerIE
|
||||||
|
from .gamerdvr import GamerDVRIE
|
||||||
from .gamespot import GameSpotIE
|
from .gamespot import GameSpotIE
|
||||||
from .gamestar import GameStarIE
|
from .gamestar import GameStarIE
|
||||||
from .gaskrank import GaskrankIE
|
from .gaskrank import GaskrankIE
|
||||||
|
39
youtube_dl/extractor/gamerdvr.py
Normal file
39
youtube_dl/extractor/gamerdvr.py
Normal file
@ -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<id>\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"<source src=\"(\S+)\"", webpage, 'URL')
|
||||||
|
title = self._html_search_regex(
|
||||||
|
r'<title>(.+?)</title>', webpage, 'title')
|
||||||
|
description = self._html_search_regex(
|
||||||
|
r"<meta name=\"description\" content=([\"'])((?:\\\1|.)*?)\1",
|
||||||
|
webpage, 'description', group=2)
|
||||||
|
uploader = self._html_search_regex(
|
||||||
|
r"window\.gamertag = '(\S+)'", webpage, 'uploader')
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'title': title,
|
||||||
|
'description': description,
|
||||||
|
'uploader': uploader,
|
||||||
|
'url': video_url
|
||||||
|
}
|
@ -2,52 +2,33 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
|
||||||
int_or_none,
|
|
||||||
parse_filesize,
|
|
||||||
unified_strdate,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class XboxClipsIE(InfoExtractor):
|
class XboxClipsIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?xboxclips\.com/(?:video\.php\?.*vid=|[^/]+/)(?P<id>[\w-]{36})'
|
_VALID_URL = r'https?://(?:www\.)?xboxclips\.com/\S+?/(?P<id>[a-zA-Z0-9-]{36})'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'http://xboxclips.com/video.php?uid=2533274823424419&gamertag=Iabdulelah&vid=074a69a9-5faf-46aa-b93b-9909c1720325',
|
'url': 'https://xboxclips.com/DeeperGnu613/7936bcb9-83fc-4565-979b-8db96bffa460',
|
||||||
'md5': 'fbe1ec805e920aeb8eced3c3e657df5d',
|
'md5': 'e434323563f3ae6f02ab1f5b8f514f28',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '074a69a9-5faf-46aa-b93b-9909c1720325',
|
'id': '7936bcb9-83fc-4565-979b-8db96bffa460',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Iabdulelah playing Titanfall',
|
'title': "XboxClips - DeeperGnu613 playing Forza Horizon 4",
|
||||||
'filesize_approx': 26800000,
|
'uploader': 'DeeperGnu613'
|
||||||
'upload_date': '20140807',
|
|
||||||
'duration': 56,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
video_url = self._html_search_regex(
|
video_url = self._html_search_regex(
|
||||||
r'>(?:Link|Download): <a[^>]+href="([^"]+)"', webpage, 'video URL')
|
r"<source src=\"(\S+)\"", webpage, 'URL')
|
||||||
title = self._html_search_regex(
|
title = self._html_search_regex(
|
||||||
r'<title>XboxClips \| ([^<]+)</title>', webpage, 'title')
|
r'<title>(.+?)</title>', webpage, 'title')
|
||||||
upload_date = unified_strdate(self._html_search_regex(
|
uploader = self._html_search_regex(
|
||||||
r'>Recorded: ([^<]+)<', webpage, 'upload date', fatal=False))
|
r'<h3>(.+?)</h3>', webpage, 'uploader')
|
||||||
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))
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'url': video_url,
|
|
||||||
'title': title,
|
'title': title,
|
||||||
'upload_date': upload_date,
|
'uploader': uploader,
|
||||||
'filesize_approx': filesize,
|
'url': video_url
|
||||||
'duration': duration,
|
}
|
||||||
'view_count': view_count,
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user