mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-30 12:17:54 +01:00
Conforming to PEP8 (Flake8)
This commit is contained in:
parent
dce2ce3961
commit
c42551d3db
@ -3,16 +3,22 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
class GamerDVRIE(InfoExtractor):
|
class GamerDVRIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?gamerdvr\.com/gamer/\S+/video/(?P<id>\d+)'
|
_VALID_URL = r'https?://(?:www\.)?gamerdvr\.com' +
|
||||||
|
'/gamer/\S+/video/(?P<id>\d+)'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'https://gamerdvr.com/gamer/videogamer3/video/83193307',
|
'url': 'https://gamerdvr.com/gamer/videogamer3/video/83193307',
|
||||||
'md5': 'f747c74fbc7617a70d8c071927623cde',
|
'md5': 'f747c74fbc7617a70d8c071927623cde',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '83193307',
|
'id': '83193307',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': "videogamer3's Xbox Call of Duty®: Modern Warfare® clip 83193307. Find your Xbox clips on GamerDVR.com",
|
'title': "videogamer3's Xbox Call of Duty®: Modern Warfare® " +
|
||||||
'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!",
|
"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'
|
'uploader': 'videogamer3'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -20,14 +26,19 @@ class GamerDVRIE(InfoExtractor):
|
|||||||
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(r"<source src=\"(\S+)\"", webpage, 'URL')
|
video_url = self._html_search_regex(
|
||||||
title = self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title')
|
r"<source src=\"(\S+)\"", webpage, 'URL')
|
||||||
description = self._html_search_regex(r"<meta name=\"description\" content=([\"'])((?:\\\1|.)*?)\1", webpage, 'description',group=2)
|
title = self._html_search_regex(
|
||||||
uploader = self._html_search_regex(r"window\.gamertag = '(\S+)'", webpage, 'uploader')
|
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 {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
'description': description,
|
'description': description,
|
||||||
'uploader': uploader,
|
'uploader': uploader,
|
||||||
'url':video_url
|
'url': video_url
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user