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

Code before:
            'timestamp': 1665507240,
            'upload_date': '20221011',
            'release_year': 2025,
        },
    }, {
        'url': 'http://www.raiplay.it/video/2016/11/gazebotraindesi-efebe701-969c-4593-92f3-285f0d1ce750.html?',
        'only_matching': True,
    }, {
        # subtitles at 'subtitlesArray' key (see #27698)
        'url': 'https://www.raiplay.it/video/2020/12/Report---04-01-2021-2e90f1de-8eee-4de4-ac0e-78d21db5b600.html',
        'only_matching': True,
    }, {
        # DRM protected
        'url': 'https://www.raiplay.it/video/2021/06/Lo-straordinario-mondo-di-Zoey-S2E1-Lo-straordinario-ritorno-di-Zoey-3ba992de-2332-41ad-9214-73e32ab209f4.html',
        'only_matching': True,
    }]

    def _real_extract(self, url):
        base, video_id = self._match_valid_url(url).groups()

        media = self._download_json(
            f'{base}.json', video_id, 'Downloading video JSON')

        if not self.get_param('allow_unplayable_formats'):
            if traverse_obj(media, ('rights_management', 'rights', 'drm')):
                self.report_drm(video_id)

        video = media['video']
        relinker_info = self._extract_relinker_info(video['content_url'], video_id)
        date_published = join_nonempty(
            media.get('date_published'), media.get('time_published'), delim=' ')
        season = media.get('season')
        alt_title = join_nonempty(media.get('subtitle'), media.get('toptitle'), delim=' - ')

        return {
            'id': remove_start(media.get('id'), 'ContentItem-') or video_id,
            'display_id': video_id,
            'title': media.get('name'),
            'alt_title': strip_or_none(alt_title or None),
            'description': media.get('description'),
            'uploader': strip_or_none(
                traverse_obj(media, ('program_info', 'channel'))
                or media.get('channel') or None),
            'creator': strip_or_none(
                traverse_obj(media, ('program_info', 'editor'))
                or media.get('editor') or None),
            'duration': parse_duration(video.get('duration')),
            'timestamp': unified_timestamp(date_published),
            'thumbnails': self._get_thumbnails_list(media.get('images'), url),
            'series': traverse_obj(media, ('program_info', 'name')),
            'season_number': int_or_none(season),

Review comment (suggestion):
can we do this please
```diff
-        if not self.get_param('allow_unplayable_formats'):
-            if traverse_obj(media, ('rights_management', 'rights', 'drm')):
-                self.report_drm(video_id)
+        if traverse_obj(media, ('rights_management', 'rights', 'drm')):
+            self.report_drm(video_id)
````

Code after:
            'episode': 'Ad ogni costo',
            'timestamp': 1665507240,
            'upload_date': '20221011',
            'release_year': 2025,
        },
    }, {
        'url': 'http://www.raiplay.it/video/2016/11/gazebotraindesi-efebe701-969c-4593-92f3-285f0d1ce750.html?',
        'only_matching': True,
    }, {
        # subtitles at 'subtitlesArray' key (see #27698)
        'url': 'https://www.raiplay.it/video/2020/12/Report---04-01-2021-2e90f1de-8eee-4de4-ac0e-78d21db5b600.html',
        'only_matching': True,
    }, {
        # DRM protected
        'url': 'https://www.raiplay.it/video/2021/06/Lo-straordinario-mondo-di-Zoey-S2E1-Lo-straordinario-ritorno-di-Zoey-3ba992de-2332-41ad-9214-73e32ab209f4.html',
        'only_matching': True,
    }]

    def _real_extract(self, url):
        base, video_id = self._match_valid_url(url).groups()

        media = self._download_json(
            f'{base}.json', video_id, 'Downloading video JSON')

        if traverse_obj(media, ('rights_management', 'rights', 'drm')):
            self.report_drm(video_id)

        video = media['video']
        relinker_info = self._extract_relinker_info(video['content_url'], video_id)
        date_published = join_nonempty(
            media.get('date_published'), media.get('time_published'), delim=' ')
        season = media.get('season')
        alt_title = join_nonempty(media.get('subtitle'), media.get('toptitle'), delim=' - ')

        return {
            'id': remove_start(media.get('id'), 'ContentItem-') or video_id,
            'display_id': video_id,
            'title': media.get('name'),
            'alt_title': strip_or_none(alt_title or None),
            'description': media.get('description'),
            'uploader': strip_or_none(
                traverse_obj(media, ('program_info', 'channel'))
                or media.get('channel') or None),
            'creator': strip_or_none(
                traverse_obj(media, ('program_info', 'editor'))
                or media.get('editor') or None),
            'duration': parse_duration(video.get('duration')),
            'timestamp': unified_timestamp(date_published),
            'thumbnails': self._get_thumbnails_list(media.get('images'), url),
            'series': traverse_obj(media, ('program_info', 'name')),
            'season_number': int_or_none(season),