[cleanup] Misc (#8968)
[yt-dlp.git] / yt_dlp / extractor / ku6.py
blob31b4ea0c609925380880b0a145f0bb1bb3baa318
1 from .common import InfoExtractor
4 class Ku6IE(InfoExtractor):
5 _VALID_URL = r'https?://v\.ku6\.com/show/(?P<id>[a-zA-Z0-9\-\_]+)(?:\.)*html'
6 _TEST = {
7 'url': 'http://v.ku6.com/show/JG-8yS14xzBr4bCn1pu0xw...html',
8 'md5': '01203549b9efbb45f4b87d55bdea1ed1',
9 'info_dict': {
10 'id': 'JG-8yS14xzBr4bCn1pu0xw',
11 'ext': 'f4v',
12 'title': 'techniques test',
16 def _real_extract(self, url):
17 video_id = self._match_id(url)
18 webpage = self._download_webpage(url, video_id)
20 title = self._html_search_regex(
21 r'<h1 title=.*>(.*?)</h1>', webpage, 'title')
22 dataUrl = 'http://v.ku6.com/fetchVideo4Player/%s.html' % video_id
23 jsonData = self._download_json(dataUrl, video_id)
24 downloadUrl = jsonData['data']['f']
26 return {
27 'id': video_id,
28 'title': title,
29 'url': downloadUrl