Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/newspicks.py (Python)

Code before:
            'ext': 'mp4',
            'title': '【検証】専門家は、KADOKAWAをどう見るか',
            'cast': 'count:3',
            'description': 'md5:2c2d4bf77484a4333ec995d676f9a91d',
            'release_date': '20240622',
            'release_timestamp': 1719088080,
            'series': 'NPレポート',
            'series_id': '158',
            'thumbnail': r're:https?://resources\.newspicks\.com/.+\.(?:jpe?g|png)',
            'timestamp': 1719086400,
            'upload_date': '20240622',
        },
    }]

    def _real_extract(self, url):
        series_id = self._match_id(url)
        video_id = traverse_obj(parse_qs(url), ('movieId', -1, {str}, {require('movie ID')}))
        webpage = self._download_webpage(url, video_id)

        fragment = self._search_nextjs_data(webpage, video_id)['props']['pageProps']['fragment']
        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("cookies")}', 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')

        return {
            'id': video_id,
            'formats': formats,
            'series': traverse_obj(fragment, ('series', 'title', {str})),
            'series_id': series_id,
            'subtitles': subtitles,
            **traverse_obj(movie, {
                'title': ('title', {str}),
                'cast': ('relatedUsers', ..., 'displayName', {str}, filter, all, filter),
                'description': ('explanation', {clean_html}),
                'release_timestamp': ('onAirStartDate', {parse_iso8601}),
                'thumbnail': (('image', 'coverImageUrl'), {url_or_none}, any),
                'timestamp': ('published', {parse_iso8601}),
            }),
        }


Review comment (suggestion):
`cookies` is the default `method` if `_NETRC_MACHINE` is unset
```suggestion
                f'only the preview is downloaded. {self._login_hint()}', video_id)
```

Code after:
            'ext': 'mp4',
            'title': '【検証】専門家は、KADOKAWAをどう見るか',
            'cast': 'count:3',
            'description': 'md5:2c2d4bf77484a4333ec995d676f9a91d',
            'release_date': '20240622',
            'release_timestamp': 1719088080,
            'series': 'NPレポート',
            'series_id': '158',
            'thumbnail': r're:https?://resources\.newspicks\.com/.+\.(?:jpe?g|png)',
            'timestamp': 1719086400,
            'upload_date': '20240622',
        },
    }]

    def _real_extract(self, url):
        series_id = self._match_id(url)
        video_id = traverse_obj(parse_qs(url), ('movieId', -1, {str}, {require('movie ID')}))
        webpage = self._download_webpage(url, video_id)

        fragment = self._search_nextjs_data(webpage, video_id)['props']['pageProps']['fragment']
        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')

        return {
            'id': video_id,
            'formats': formats,
            'series': traverse_obj(fragment, ('series', 'title', {str})),
            'series_id': series_id,
            'subtitles': subtitles,
            **traverse_obj(movie, {
                'title': ('title', {str}),
                'cast': ('relatedUsers', ..., 'displayName', {str}, filter, all, filter),
                'description': ('explanation', {clean_html}),
                'release_timestamp': ('onAirStartDate', {parse_iso8601}),
                'thumbnail': (('image', 'coverImageUrl'), {url_or_none}, any),
                'timestamp': ('published', {parse_iso8601}),
            }),
        }