1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-07 05:37:15 +08:00

Added GamerDVR and XboxClips

This commit is contained in:
Joshua Lochner 2020-01-22 00:32:36 +02:00
parent a3eeef2035
commit 1fd12ae04d
3 changed files with 53 additions and 32 deletions

View File

@ -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

View 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
}

View File

@ -2,52 +2,33 @@
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_filesize,
unified_strdate,
)
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 = {
'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): <a[^>]+href="([^"]+)"', webpage, 'video URL')
r"<source src=\"(\S+)\"", webpage, 'URL')
title = self._html_search_regex(
r'<title>XboxClips \| ([^<]+)</title>', 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'<title>(.+?)</title>', webpage, 'title')
uploader = self._html_search_regex(
r'<h3>(.+?)</h3>', 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
}