34 lines
1.1 KiB
Python
Raw Normal View History

2016-10-02 13:39:18 +02:00
# coding: utf-8
from __future__ import unicode_literals
2014-08-08 09:48:02 +03:00
from .common import InfoExtractor
2014-08-08 09:48:02 +03:00
class XboxClipsIE(InfoExtractor):
2020-01-22 00:32:36 +02:00
_VALID_URL = r'https?://(?:www\.)?xboxclips\.com/\S+?/(?P<id>[a-zA-Z0-9-]{36})'
2014-08-08 09:48:02 +03:00
_TEST = {
2020-01-22 00:32:36 +02:00
'url': 'https://xboxclips.com/DeeperGnu613/7936bcb9-83fc-4565-979b-8db96bffa460',
'md5': 'e434323563f3ae6f02ab1f5b8f514f28',
'info_dict': {
2020-01-22 00:32:36 +02:00
'id': '7936bcb9-83fc-4565-979b-8db96bffa460',
'ext': 'mp4',
2020-01-22 00:32:36 +02:00
'title': "XboxClips - DeeperGnu613 playing Forza Horizon 4",
'uploader': 'DeeperGnu613'
}
}
2014-08-08 09:48:02 +03:00
def _real_extract(self, url):
2014-12-31 23:59:16 +06:00
video_id = self._match_id(url)
2014-08-08 09:48:02 +03:00
webpage = self._download_webpage(url, video_id)
video_url = self._html_search_regex(
2020-01-22 00:32:36 +02:00
r"<source src=\"(\S+)\"", webpage, 'URL')
title = self._html_search_regex(
2020-01-22 00:32:36 +02:00
r'<title>(.+?)</title>', webpage, 'title')
uploader = self._html_search_regex(
r'<h3>(.+?)</h3>', webpage, 'uploader')
2014-08-08 09:48:02 +03:00
return {
'id': video_id,
'title': title,
2020-01-22 00:32:36 +02:00
'uploader': uploader,
'url': video_url
}