]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/xboxclips.py
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
14 class XboxClipsIE(InfoExtractor
):
15 _VALID_URL
= r
'https?://(?:www\.)?xboxclips\.com/video\.php\?.*vid=(?P<id>[\w-]{36})'
17 'url': 'https://xboxclips.com/video.php?uid=2533274823424419&gamertag=Iabdulelah&vid=074a69a9-5faf-46aa-b93b-9909c1720325',
18 'md5': 'fbe1ec805e920aeb8eced3c3e657df5d',
20 'id': '074a69a9-5faf-46aa-b93b-9909c1720325',
22 'title': 'Iabdulelah playing Upload Studio',
23 'filesize_approx': 28101836.8,
24 'timestamp': 1407388500,
25 'upload_date': '20140807',
30 def _real_extract(self
, url
):
31 mobj
= re
.match(self
._VALID
_URL
, url
)
32 video_id
= mobj
.group('id')
34 webpage
= self
._download
_webpage
(url
, video_id
)
36 video_url
= self
._html
_search
_regex
(
37 r
'>Link: <a href="([^"]+)">', webpage
, 'video URL')
38 title
= self
._html
_search
_regex
(
39 r
'<title>XboxClips \| ([^<]+)</title>', webpage
, 'title')
40 timestamp
= parse_iso8601(self
._html
_search
_regex
(
41 r
'>Recorded: ([^<]+)<', webpage
, 'upload date', fatal
=False))
42 filesize
= float_or_none(self
._html
_search
_regex
(
43 r
'>Size: ([\d\.]+)MB<', webpage
, 'file size', fatal
=False), invscale
=1024 * 1024)
44 duration
= int_or_none(self
._html
_search
_regex
(
45 r
'>Duration: (\d+) Seconds<', webpage
, 'duration', fatal
=False))
46 view_count
= int_or_none(self
._html
_search
_regex
(
47 r
'>Views: (\d+)<', webpage
, 'view count', fatal
=False))
53 'timestamp': timestamp
,
54 'filesize_approx': filesize
,
56 'view_count': view_count
,