]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/xboxclips.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
12 class XboxClipsIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://(?:www\.)?xboxclips\.com/(?:video\.php\?.*vid=|[^/]+/)(?P<id>[\w-]{36})'
15 'url': 'https://xboxclips.com/video.php?uid=2533274823424419&gamertag=Iabdulelah&vid=074a69a9-5faf-46aa-b93b-9909c1720325',
16 'md5': 'fbe1ec805e920aeb8eced3c3e657df5d',
18 'id': '074a69a9-5faf-46aa-b93b-9909c1720325',
20 'title': 'Iabdulelah playing Titanfall',
21 'filesize_approx': 26800000,
22 'upload_date': '20140807',
27 def _real_extract(self
, url
):
28 video_id
= self
._match
_id
(url
)
30 webpage
= self
._download
_webpage
(url
, video_id
)
32 video_url
= self
._html
_search
_regex
(
33 r
'>(?:Link|Download): <a[^>]+href="([^"]+)"', webpage
, 'video URL')
34 title
= self
._html
_search
_regex
(
35 r
'<title>XboxClips \| ([^<]+)</title>', webpage
, 'title')
36 upload_date
= unified_strdate(self
._html
_search
_regex
(
37 r
'>Recorded: ([^<]+)<', webpage
, 'upload date', fatal
=False))
38 filesize
= parse_filesize(self
._html
_search
_regex
(
39 r
'>Size: ([^<]+)<', webpage
, 'file size', fatal
=False))
40 duration
= int_or_none(self
._html
_search
_regex
(
41 r
'>Duration: (\d+) Seconds<', webpage
, 'duration', fatal
=False))
42 view_count
= int_or_none(self
._html
_search
_regex
(
43 r
'>Views: (\d+)<', webpage
, 'view count', fatal
=False))
49 'upload_date': upload_date
,
50 'filesize_approx': filesize
,
52 'view_count': view_count
,