mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-10-14 14:28:34 +00:00
[ie/newspicks] Warn when only preview is available (#14197)
Closes #14137 Authored by: doe1080
This commit is contained in:
parent
679587dac7
commit
9def9a4b0e
@ -50,7 +50,14 @@ def _real_extract(self, url):
|
|||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
fragment = self._search_nextjs_data(webpage, video_id)['props']['pageProps']['fragment']
|
fragment = self._search_nextjs_data(webpage, video_id)['props']['pageProps']['fragment']
|
||||||
m3u8_url = traverse_obj(fragment, ('movie', 'movieUrl', {url_or_none}, {require('m3u8 URL')}))
|
movie = fragment['movie']
|
||||||
|
|
||||||
|
if traverse_obj(movie, ('viewable', {str})) == 'PARTIAL_FREE' and not traverse_obj(movie, ('canWatch', {bool})):
|
||||||
|
self.report_warning(
|
||||||
|
'Full video is for Premium members. Without cookies, '
|
||||||
|
f'only the preview is downloaded. {self._login_hint()}', video_id)
|
||||||
|
|
||||||
|
m3u8_url = traverse_obj(movie, ('movieUrl', {url_or_none}, {require('m3u8 URL')}))
|
||||||
formats, subtitles = self._extract_m3u8_formats_and_subtitles(m3u8_url, video_id, 'mp4')
|
formats, subtitles = self._extract_m3u8_formats_and_subtitles(m3u8_url, video_id, 'mp4')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -59,12 +66,12 @@ def _real_extract(self, url):
|
|||||||
'series': traverse_obj(fragment, ('series', 'title', {str})),
|
'series': traverse_obj(fragment, ('series', 'title', {str})),
|
||||||
'series_id': series_id,
|
'series_id': series_id,
|
||||||
'subtitles': subtitles,
|
'subtitles': subtitles,
|
||||||
**traverse_obj(fragment, ('movie', {
|
**traverse_obj(movie, {
|
||||||
'title': ('title', {str}),
|
'title': ('title', {str}),
|
||||||
'cast': ('relatedUsers', ..., 'displayName', {str}, filter, all, filter),
|
'cast': ('relatedUsers', ..., 'displayName', {str}, filter, all, filter),
|
||||||
'description': ('explanation', {clean_html}),
|
'description': ('explanation', {clean_html}),
|
||||||
'release_timestamp': ('onAirStartDate', {parse_iso8601}),
|
'release_timestamp': ('onAirStartDate', {parse_iso8601}),
|
||||||
'thumbnail': (('image', 'coverImageUrl'), {url_or_none}, any),
|
'thumbnail': (('image', 'coverImageUrl'), {url_or_none}, any),
|
||||||
'timestamp': ('published', {parse_iso8601}),
|
'timestamp': ('published', {parse_iso8601}),
|
||||||
})),
|
}),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user