3 from .common
import InfoExtractor
12 class XboxClipsIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://(?:www\.)?(?:xboxclips\.com|gameclips\.io)/(?:video\.php\?.*vid=|[^/]+/)(?P<id>[\da-f]{8}-(?:[\da-f]{4}-){3}[\da-f]{12})'
15 'url': 'http://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',
26 'url': 'https://gameclips.io/iAbdulElah/074a69a9-5faf-46aa-b93b-9909c1720325',
27 'only_matching': True,
30 def _real_extract(self
, url
):
31 video_id
= self
._match
_id
(url
)
33 if '/video.php' in url
:
35 url
= 'https://gameclips.io/{}/{}'.format(qs
['gamertag'][0], qs
['vid'][0])
37 webpage
= self
._download
_webpage
(url
, video_id
)
38 info
= self
._parse
_html
5_media
_entries
(url
, webpage
, video_id
)[0]
40 title
= self
._html
_search
_meta
(['og:title', 'twitter:title'], webpage
)
43 r
'>Recorded: (\d{2})-(Jan|Feb|Mar|Apr|May|Ju[nl]|Aug|Sep|Oct|Nov|Dec)-(\d{4})',
46 upload_date
= '%s%.2d%s' % (mobj
.group(3), month_by_abbreviation(mobj
.group(2)), mobj
.group(1))
47 filesize
= parse_filesize(self
._html
_search
_regex
(
48 r
'>Size: ([^<]+)<', webpage
, 'file size', fatal
=False))
49 duration
= int_or_none(self
._html
_search
_regex
(
50 r
'>Duration: (\d+) Seconds<', webpage
, 'duration', fatal
=False))
51 view_count
= int_or_none(self
._html
_search
_regex
(
52 r
'>Views: (\d+)<', webpage
, 'view count', fatal
=False))
57 'upload_date': upload_date
,
58 'filesize_approx': filesize
,
60 'view_count': view_count
,