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

Code before:
        player = self._download_webpage(embed_url, video_id, 'Downloading player page')
        if 'MESSAGE_GEOBLOCKED' in player:
            self.raise_geo_restricted(countries=self._GEO_COUNTRIES)

        formats, subtitles = self._extract_m3u8_formats_and_subtitles(
            self._html_search_regex(r'["\']?source["\']?:\s*["\']([^"\']+\.m3u8)', player, 'm3u8 url'),
            video_id, 'mp4', m3u8_id='hls')

        if dv_source := self._html_search_regex(r'dvSource:\s*\'([^\']+)', player, 'dv', default=None):
            fmts, subs = self._extract_m3u8_formats_and_subtitles(
                dv_source, video_id, 'mp4', m3u8_id='dv', preference=-2, fatal=False)
            for fmt in fmts:
                fmt['format_note'] = 'described video'
            formats.extend(fmts)
            self._merge_subtitles(subs, target=subtitles)

        info = {
            'id': video_id,
            'title': self._html_search_regex(
                r'["\']nfb_version_title["\']\s*:\s*["\']([^"\']+)',
                webpage, 'title', default=None),
            'description': self._html_search_regex(
                r'<[^>]+\bid=["\']tabSynopsis["\'][^>]*>\s*<p[^>]*>\s*([^<]+)',
                webpage, 'description', default=None),
            'thumbnail': self._html_search_regex(
                r'poster:\s*\'([^\']+)', player, 'thumbnail', default=None),
            'uploader': self._html_search_regex(
                r'<[^>]+\bitemprop=["\']director["\'][^>]*>([^<]+)', webpage, 'uploader', default=None),
            'release_year': int_or_none(self._html_search_regex(
                r'["\']nfb_version_year["\']\s*:\s*["\']([^"\']+)',
                webpage, 'release_year', default=None)),
        } if type_ == 'film' else self._extract_ep_info(self._extract_ep_data(webpage, video_id, slug), video_id)

        return merge_dicts({
            'formats': formats,
            'subtitles': subtitles,
        }, info, self._search_json_ld(webpage, video_id, default={}))


class NFBSeriesIE(NFBBaseIE):
    IE_NAME = 'nfb:series'
    IE_DESC = 'nfb.ca and onf.ca series'
    _VALID_URL = rf'{NFBBaseIE._VALID_URL_BASE}/(?P<type>series?)/(?P<id>[^/?#&]+)/?(?:[?#]|$)'
    _TESTS = [{
        'url': 'https://www.nfb.ca/series/true-north-inside-the-rise-of-toronto-basketball/',
        'playlist_mincount': 9,
        'info_dict': {
            'id': 'true-north-inside-the-rise-of-toronto-basketball',
        },
    }, {
        'url': 'https://www.onf.ca/serie/la-liste-des-choses-qui-existent-serie/',

Review comment (suggestion):
```suggestion
            'thumbnail': url_or_none(player_data.get('poster')),
```

Code after:
        formats, subtitles = self._extract_m3u8_formats_and_subtitles(
            player_data['source'], video_id, 'mp4', m3u8_id='hls')

        if dv_source := url_or_none(player_data.get('dvSource')):
            fmts, subs = self._extract_m3u8_formats_and_subtitles(
                dv_source, video_id, 'mp4', m3u8_id='dv', preference=-2, fatal=False)
            for fmt in fmts:
                fmt['format_note'] = 'described video'
            formats.extend(fmts)
            self._merge_subtitles(subs, target=subtitles)

        info = {
            'id': video_id,
            'title': self._html_search_regex(
                r'["\']nfb_version_title["\']\s*:\s*["\']([^"\']+)',
                webpage, 'title', default=None),
            'description': self._html_search_regex(
                r'<[^>]+\bid=["\']tabSynopsis["\'][^>]*>\s*<p[^>]*>\s*([^<]+)',
                webpage, 'description', default=None),
            'thumbnail': url_or_none(player_data.get('poster')),
            'uploader': self._html_search_regex(
                r'<[^>]+\bitemprop=["\']director["\'][^>]*>([^<]+)', webpage, 'uploader', default=None),
            'release_year': int_or_none(self._html_search_regex(
                r'["\']nfb_version_year["\']\s*:\s*["\']([^"\']+)',
                webpage, 'release_year', default=None)),
        } if type_ == 'film' else self._extract_ep_info(self._extract_ep_data(webpage, video_id, slug), video_id)

        return merge_dicts({
            'formats': formats,
            'subtitles': subtitles,
        }, info, self._search_json_ld(webpage, video_id, default={}))


class NFBSeriesIE(NFBBaseIE):
    IE_NAME = 'nfb:series'
    IE_DESC = 'nfb.ca and onf.ca series'
    _VALID_URL = rf'{NFBBaseIE._VALID_URL_BASE}/(?P<type>series?)/(?P<id>[^/?#&]+)/?(?:[?#]|$)'
    _TESTS = [{
        'url': 'https://www.nfb.ca/series/true-north-inside-the-rise-of-toronto-basketball/',
        'playlist_mincount': 9,
        'info_dict': {
            'id': 'true-north-inside-the-rise-of-toronto-basketball',
        },
    }, {
        'url': 'https://www.onf.ca/serie/la-liste-des-choses-qui-existent-serie/',
        'playlist_mincount': 26,
        'info_dict': {
            'id': 'la-liste-des-choses-qui-existent-serie',
        },
    }]