[ie/dropbox] Fix password-protected video extraction (#11636)
[yt-dlp3.git] / yt_dlp / extractor / ku6.py
blob00e814cc01adbc23a6af7f6cd860837566232313
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 data_url = f'http://v.ku6.com/fetchVideo4Player/{video_id}.html'
23 json_data = self._download_json(data_url, video_id)
24 download_url = json_data['data']['f']
26 return {
27 'id': video_id,
28 'title': title,
29 'url': download_url,