]>
Commit | Line | Data |
---|---|---|
1 | from .common import InfoExtractor | |
2 | from ..utils import traverse_obj | |
3 | ||
4 | ||
5 | class FuyinTVIE(InfoExtractor): | |
6 | _VALID_URL = r'https?://(?:www\.)?fuyin\.tv/html/(?:\d+)/(?P<id>\d+)\.html' | |
7 | _TESTS = [{ | |
8 | 'url': 'https://www.fuyin.tv/html/2733/44129.html', | |
9 | 'info_dict': { | |
10 | 'id': '44129', | |
11 | 'ext': 'mp4', | |
12 | 'title': '第1集', | |
13 | 'description': 'md5:21a3d238dc8d49608e1308e85044b9c3', | |
14 | }, | |
15 | }] | |
16 | ||
17 | def _real_extract(self, url): | |
18 | video_id = self._match_id(url) | |
19 | json_data = self._download_json( | |
20 | 'https://www.fuyin.tv/api/api/tv.movie/url', | |
21 | video_id, query={'urlid': f'{video_id}'}) | |
22 | webpage = self._download_webpage(url, video_id, fatal=False) | |
23 | ||
24 | return { | |
25 | 'id': video_id, | |
26 | 'title': traverse_obj(json_data, ('data', 'title')), | |
27 | 'url': json_data['data']['url'], | |
28 | 'ext': 'mp4', | |
29 | 'description': self._html_search_meta('description', webpage), | |
30 | } |