]>
Commit | Line | Data |
---|---|---|
e88e1feb | 1 | from .common import InfoExtractor |
2 | from ..utils import ( | |
3 | parse_duration, | |
4 | parse_count, | |
5 | unified_strdate | |
6 | ) | |
7 | ||
8 | ||
9 | class NoodleMagazineIE(InfoExtractor): | |
10 | _VALID_URL = r'https?://(?:www|adult\.)?noodlemagazine\.com/watch/(?P<id>[0-9-_]+)' | |
11 | _TEST = { | |
12 | 'url': 'https://adult.noodlemagazine.com/watch/-67421364_456239604', | |
13 | 'md5': '9e02aa763612929d0b4b850591a9248b', | |
14 | 'info_dict': { | |
15 | 'id': '-67421364_456239604', | |
16 | 'title': 'Aria alexander manojob', | |
17 | 'thumbnail': r're:^https://.*\.jpg', | |
18 | 'ext': 'mp4', | |
19 | 'duration': 903, | |
20 | 'view_count': int, | |
21 | 'like_count': int, | |
22 | 'description': 'Aria alexander manojob', | |
23 | 'tags': ['aria', 'alexander', 'manojob'], | |
24 | 'upload_date': '20190218', | |
25 | 'age_limit': 18 | |
26 | } | |
27 | } | |
28 | ||
29 | def _real_extract(self, url): | |
30 | video_id = self._match_id(url) | |
31 | webpage = self._download_webpage(url, video_id) | |
32 | title = self._og_search_title(webpage) | |
33 | duration = parse_duration(self._html_search_meta('video:duration', webpage, 'duration', default=None)) | |
34 | description = self._og_search_property('description', webpage, default='').replace(' watch online hight quality video', '') | |
35 | tags = self._html_search_meta('video:tag', webpage, default='').split(', ') | |
36 | view_count = parse_count(self._html_search_meta('ya:ovs:views_total', webpage, default=None)) | |
37 | like_count = parse_count(self._html_search_meta('ya:ovs:likes', webpage, default=None)) | |
38 | upload_date = unified_strdate(self._html_search_meta('ya:ovs:upload_date', webpage, default='')) | |
39 | ||
40 | key = self._html_search_regex(rf'/{video_id}\?(?:.*&)?m=([^&"\'\s,]+)', webpage, 'key') | |
41 | playlist_info = self._download_json(f'https://adult.noodlemagazine.com/playlist/{video_id}?m={key}', video_id) | |
42 | thumbnail = self._og_search_property('image', webpage, default=None) or playlist_info.get('image') | |
43 | ||
44 | formats = [{ | |
45 | 'url': source.get('file'), | |
46 | 'quality': source.get('label'), | |
47 | 'ext': source.get('type'), | |
48 | } for source in playlist_info.get('sources')] | |
49 | ||
e88e1feb | 50 | return { |
51 | 'id': video_id, | |
52 | 'formats': formats, | |
53 | 'title': title, | |
54 | 'thumbnail': thumbnail, | |
55 | 'duration': duration, | |
56 | 'description': description, | |
57 | 'tags': tags, | |
58 | 'view_count': view_count, | |
59 | 'like_count': like_count, | |
60 | 'upload_date': upload_date, | |
61 | 'age_limit': 18 | |
62 | } |