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

Code before:
import urllib.parse

from .common import InfoExtractor
from ..utils import (
    bool_or_none,
    str_or_none,
    traverse_obj,
    try_call,
    unified_strdate,
)


class MediciIE(InfoExtractor):
    _VALID_URL = r'https?://(?:(?P<sub>www|edu)\.)?medici\.tv/(?:[a-z]{2}/[\w.-]+)/(?P<id>[^/?#&]+)'
    _TESTS = [
        {
            'url': 'https://www.medici.tv/en/operas/thomas-ades-the-exterminating-angel-calixto-bieito-opera-bastille-paris',
            'md5': 'd483f74e7a7a9eac0dbe152ab189050d',
            'expected_warnings': [r'preview'],
            'info_dict': {
                'id': '8032',
                'ext': 'mp4',
                'title': 'Thomas Adès\'s The Exterminating Angel',
                'thumbnail': r're:^https?://medicitv-[abc]\.imgix\.net/movie/[^?]+\.jpg(?:\?[^?]+)?',
                'description': 'md5:708ae6350dadc604225b4a6e32482bab',
                'upload_date': '20240304',
            },
        },
        {
            'url': 'https://edu.medici.tv/en/operas/wagner-lohengrin-paris-opera-kirill-serebrennikov-piotr-beczala-kwangchul-youn-johanni-van-oostrum',
            'md5': '4ef3f4079a6e1c617584463a9eb84f99',
            'expected_warnings': [r'preview'],
            'info_dict': {
                'id': '7900',
                'ext': 'mp4',
                'title': 'Wagner\'s Lohengrin',
                'thumbnail': r're:^https?://medicitv-[abc]\.imgix\.net/movie/[^?]+\.jpg(?:\?[^?]+)?',
                'description': 'md5:a384a62937866101f86902f21752cd89',
                'upload_date': '20231017',

Review comment (suggestion):
```suggestion
    _VALID_URL = r'https?://(?:(?P<sub>www|edu)\.)?medici\.tv/[a-z]{2}/[\w.-]+/(?P<id>[^/?#&]+)'
```

Code after:
import urllib.parse

from .common import InfoExtractor
from ..utils import (
    filter_dict,
    parse_iso8601,
    traverse_obj,
    try_call,
    url_or_none,
)


class MediciIE(InfoExtractor):
    _VALID_URL = r'https?://(?:(?P<sub>www|edu)\.)?medici\.tv/[a-z]{2}/[\w.-]+/(?P<id>[^/?#&]+)'
    _TESTS = [{
        'url': 'https://www.medici.tv/en/operas/thomas-ades-the-exterminating-angel-calixto-bieito-opera-bastille-paris',
        'md5': 'd483f74e7a7a9eac0dbe152ab189050d',
        'info_dict': {
            'id': '8032',
            'ext': 'mp4',
            'title': 'Thomas Adès\'s The Exterminating Angel',
            'description': 'md5:708ae6350dadc604225b4a6e32482bab',
            'thumbnail': r're:https://.+/.+\.jpg',
            'upload_date': '20240304',
            'timestamp': 1709561766,
            'display_id': 'thomas-ades-the-exterminating-angel-calixto-bieito-opera-bastille-paris',
        },
        'expected_warnings': [r'preview'],
    }, {
        'url': 'https://edu.medici.tv/en/operas/wagner-lohengrin-paris-opera-kirill-serebrennikov-piotr-beczala-kwangchul-youn-johanni-van-oostrum',
        'md5': '4ef3f4079a6e1c617584463a9eb84f99',
        'info_dict': {
            'id': '7900',
            'ext': 'mp4',
            'title': 'Wagner\'s Lohengrin',
            'description': 'md5:a384a62937866101f86902f21752cd89',
            'thumbnail': r're:https://.+/.+\.jpg',
            'upload_date': '20231017',
            'timestamp': 1697554771,