projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'rrooij-gamekings_fix'
[youtube-dl]
/
youtube_dl
/
extractor
/
gameone.py
diff --git
a/youtube_dl/extractor/gameone.py
b/youtube_dl/extractor/gameone.py
index da9d447915ab2546b6fd65ee0fda0084eaef885a..a07d69841f9278b932754b603249dc9f8eea53a0 100644
(file)
--- a/
youtube_dl/extractor/gameone.py
+++ b/
youtube_dl/extractor/gameone.py
@@
-6,7
+6,9
@@
import re
from .common import InfoExtractor
from ..utils import (
xpath_with_ns,
from .common import InfoExtractor
from ..utils import (
xpath_with_ns,
- parse_iso8601
+ parse_iso8601,
+ float_or_none,
+ int_or_none,
)
NAMESPACE_MAP = {
)
NAMESPACE_MAP = {
@@
-47,7
+49,7
@@
class GameOneIE(InfoExtractor):
'description': 'Jet Set Radio HD, Tekken Tag Tournament 2, Source Filmmaker',
'timestamp': 1347971451,
'title': 'Game One - Folge 220',
'description': 'Jet Set Radio HD, Tekken Tag Tournament 2, Source Filmmaker',
'timestamp': 1347971451,
'title': 'Game One - Folge 220',
- 'duration': 896,
+ 'duration': 896
.62
,
'age_limit': 16,
}
}
'age_limit': 16,
}
}
@@
-55,8
+57,7
@@
class GameOneIE(InfoExtractor):
]
def _real_extract(self, url):
]
def _real_extract(self, url):
- mobj = re.match(self._VALID_URL, url)
- video_id = mobj.group('id')
+ video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
og_video = self._og_search_video_url(webpage, secure=False)
webpage = self._download_webpage(url, video_id)
og_video = self._og_search_video_url(webpage, secure=False)
@@
-83,13
+84,13
@@
class GameOneIE(InfoExtractor):
video_id,
'Downloading media:content')
rendition_items = content.findall('.//rendition')
video_id,
'Downloading media:content')
rendition_items = content.findall('.//rendition')
- duration =
int(rendition_items[0].get('duration').split('.')[0]
)
+ duration =
float_or_none(rendition_items[0].get('duration')
)
formats = [
{
'url': re.sub(r'.*/(r2)', RAW_MP4_URL + r'\1', r.find('./src').text),
formats = [
{
'url': re.sub(r'.*/(r2)', RAW_MP4_URL + r'\1', r.find('./src').text),
- 'width': int(r.get('width')),
- 'height': int(r.get('height')),
- 'tbr': int(r.get('bitrate')),
+ 'width': int
_or_none
(r.get('width')),
+ 'height': int
_or_none
(r.get('height')),
+ 'tbr': int
_or_none
(r.get('bitrate')),
}
for r in rendition_items
]
}
for r in rendition_items
]