]>
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')
59 'series': details
.get('showTitle'),
60 'season_number': int_or_none(details
.get('analyticsSeasonNumber')),
61 'episode_number': int_or_none(details
.get('episodeNumber')),
62 'episode_id': details
.get('analyticsEpisodeTitle'),
63 'duration': int_or_none(details
.get('durationInMinutes'), invscale
=60),
64 'view_count': details
.get('viewCount'),
65 'categories': [details
.get('videoCategory')],
66 'title': details
.get('episodeTitle'),
67 'description': clean_html(details
.get('episodeDescription')),
68 'thumbnail': details
.get('episodelandscapeImgIxUrl'),
73 class ManotoTVShowIE(InfoExtractor
):
74 IE_DESC
= 'Manoto TV (Show)'
75 _VALID_URL
= r
'https?://(?:www\.)?manototv\.com/show/(?P<id>[0-9]+)'
77 'url': 'https://www.manototv.com/show/2526',
78 'playlist_mincount': 68,
81 'title': 'فیلم های ایرانی',
82 'description': 'مجموعه ای از فیلم های سینمای کلاسیک ایران',
86 def _real_extract(self
, url
):
87 show_id
= self
._match
_id
(url
)
88 show_json
= self
._download
_json
(_API_URL
.format('showmodule', 'details', show_id
), show_id
)
89 show_details
= show_json
.get('details', {})
90 title
= show_details
.get('showTitle')
91 description
= show_details
.get('showSynopsis')
93 series_json
= self
._download
_json
(_API_URL
.format('showmodule', 'serieslist', show_id
), show_id
)
94 playlist_id
= str(traverse_obj(series_json
, ('details', 'list', 0, 'id')))
96 playlist_json
= self
._download
_json
(_API_URL
.format('showmodule', 'episodelist', playlist_id
), playlist_id
)
97 playlist
= traverse_obj(playlist_json
, ('details', 'list')) or []
101 'https://www.manototv.com/episode/%s' % item
['slideID'], ie
=ManotoTVIE
.ie_key(), video_id
=item
['slideID'])
102 for item
in playlist
]
103 return self
.playlist_result(entries
, show_id
, title
, description
)
106 class ManotoTVLiveIE(InfoExtractor
):
107 IE_DESC
= 'Manoto TV (Live)'
108 _VALID_URL
= r
'https?://(?:www\.)?manototv\.com/live/'
110 'url': 'https://www.manototv.com/live/',
113 'title': 'Manoto TV Live',
118 'skip_download': 'm3u8',
122 def _real_extract(self
, url
):
124 json
= self
._download
_json
(_API_URL
.format('livemodule', 'details', ''), video_id
)
125 details
= json
.get('details', {})
126 video_url
= details
.get('liveUrl')
127 formats
= self
._extract
_m
3u8_formats
(video_url
, video_id
, 'mp4', live
=True)
130 'title': 'Manoto TV Live',