]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/manoto.py
1 from .common
import InfoExtractor
9 _API_URL
= 'https://dak1vd5vmi7x6.cloudfront.net/api/v1/publicrole/{}/{}?id={}'
12 class ManotoTVIE(InfoExtractor
):
13 IE_DESC
= 'Manoto TV (Episode)'
14 _VALID_URL
= r
'https?://(?:www\.)?manototv\.com/episode/(?P<id>[0-9]+)'
16 'url': 'https://www.manototv.com/episode/8475',
19 'series': 'خانه های رویایی با برادران اسکات',
22 'episode_id': 'My Dream Home S7: Carol & John',
24 'categories': ['سرگرمی'],
25 'title': 'کارول و جان',
26 'description': 'md5:d0fff1f8ba5c6775d312a00165d1a97e',
27 'thumbnail': r
're:^https?://.*\.(jpeg|png|jpg)$',
31 'skip_download': 'm3u8',
34 'url': 'https://www.manototv.com/episode/12576',
37 'series': 'فیلم های ایرانی',
38 'episode_id': 'Seh Mah Taatili',
41 'categories': ['سرگرمی'],
42 'title': 'سه ماه تعطیلی',
43 'description': 'سه ماه تعطیلی فیلمی به کارگردانی و نویسندگی شاپور قریب ساختهٔ سال ۱۳۵۶ است.',
44 'thumbnail': r
're:^https?://.*\.(jpeg|png|jpg)$',
48 'skip_download': 'm3u8',
52 def _real_extract(self
, url
):
53 video_id
= self
._match
_id
(url
)
54 episode_json
= self
._download
_json
(_API_URL
.format('showmodule', 'episodedetails', video_id
), video_id
)
55 details
= episode_json
.get('details', {})
56 formats
= self
._extract
_m
3u8_formats
(details
.get('videoM3u8Url'), video_id
, 'mp4')
57 self
._sort
_formats
(formats
)
60 'series': details
.get('showTitle'),
61 'season_number': int_or_none(details
.get('analyticsSeasonNumber')),
62 'episode_number': int_or_none(details
.get('episodeNumber')),
63 'episode_id': details
.get('analyticsEpisodeTitle'),
64 'duration': int_or_none(details
.get('durationInMinutes'), invscale
=60),
65 'view_count': details
.get('viewCount'),
66 'categories': [details
.get('videoCategory')],
67 'title': details
.get('episodeTitle'),
68 'description': clean_html(details
.get('episodeDescription')),
69 'thumbnail': details
.get('episodelandscapeImgIxUrl'),
74 class ManotoTVShowIE(InfoExtractor
):
75 IE_DESC
= 'Manoto TV (Show)'
76 _VALID_URL
= r
'https?://(?:www\.)?manototv\.com/show/(?P<id>[0-9]+)'
78 'url': 'https://www.manototv.com/show/2526',
79 'playlist_mincount': 68,
82 'title': 'فیلم های ایرانی',
83 'description': 'مجموعه ای از فیلم های سینمای کلاسیک ایران',
87 def _real_extract(self
, url
):
88 show_id
= self
._match
_id
(url
)
89 show_json
= self
._download
_json
(_API_URL
.format('showmodule', 'details', show_id
), show_id
)
90 show_details
= show_json
.get('details', {})
91 title
= show_details
.get('showTitle')
92 description
= show_details
.get('showSynopsis')
94 series_json
= self
._download
_json
(_API_URL
.format('showmodule', 'serieslist', show_id
), show_id
)
95 playlist_id
= str(traverse_obj(series_json
, ('details', 'list', 0, 'id')))
97 playlist_json
= self
._download
_json
(_API_URL
.format('showmodule', 'episodelist', playlist_id
), playlist_id
)
98 playlist
= traverse_obj(playlist_json
, ('details', 'list')) or []
102 'https://www.manototv.com/episode/%s' % item
['slideID'], ie
=ManotoTVIE
.ie_key(), video_id
=item
['slideID'])
103 for item
in playlist
]
104 return self
.playlist_result(entries
, show_id
, title
, description
)
107 class ManotoTVLiveIE(InfoExtractor
):
108 IE_DESC
= 'Manoto TV (Live)'
109 _VALID_URL
= r
'https?://(?:www\.)?manototv\.com/live/'
111 'url': 'https://www.manototv.com/live/',
114 'title': 'Manoto TV Live',
119 'skip_download': 'm3u8',
123 def _real_extract(self
, url
):
125 json
= self
._download
_json
(_API_URL
.format('livemodule', 'details', ''), video_id
)
126 details
= json
.get('details', {})
127 video_url
= details
.get('liveUrl')
128 formats
= self
._extract
_m
3u8_formats
(video_url
, video_id
, 'mp4', live
=True)
129 self
._sort
_formats
(formats
)
132 'title': 'Manoto TV Live',