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

Code before:
from .common import InfoExtractor
from ..utils import clean_html
from ..utils.traversal import find_element, traverse_obj


class UMGDeIE(InfoExtractor):
    IE_NAME = 'umg:de'
    IE_DESC = 'Universal Music Deutschland'

    _VALID_URL = r'https?://(?:www\.)?universal-music\.de/[^/]+/videos/(?P<id>[^/?#]+)'
    _TESTS = [{
        'url': 'https://www.universal-music.de/sido/videos/jedes-wort-ist-gold-wert-457803',
        'info_dict': {
            'id': '457803',
            'ext': 'mp4',
            'title': 'Jedes Wort ist Gold wert',
            'artists': ['Sido'],
            'description': 'md5:df2dbffcff1a74e0a7c9bef4b497aeec',
            'display_id': 'jedes-wort-ist-gold-wert-457803',
            'duration': 210.0,
            'thumbnail': r're:https?://images\.universal-music\.de/img/assets/.+\.jpg',
            'timestamp': 1513591800,
            'upload_date': '20171218',
            'view_count': int,
        },
    }, {
        'url': 'https://www.universal-music.de/alexander-eder/videos/der-doktor-hat-gesagt-609533',
        'info_dict': {
            'id': '609533',
            'ext': 'mp4',
            'title': 'Der Doktor hat gesagt',
            'artists': ['Alexander Eder'],
            'display_id': 'der-doktor-hat-gesagt-609533',
            'duration': 146.0,
            'thumbnail': r're:https?://images\.universal-music\.de/img/assets/.+\.jpg',

Review comment (performance):
It's better to match the video `id` directly from the URL when possible, since this makes download archive functionality more efficient (extraction can be skipped altogether if the `id` is already recorded in the archive)

```suggestion
    _VALID_URL = r'https?://(?:www\.)?universal-music\.de/[^/?#]+/videos/(?P<slug>[^/?#]+-(?P<id>\d+))'
```

Code after:
from .common import InfoExtractor
from ..utils import clean_html
from ..utils.traversal import find_element, traverse_obj


class UMGDeIE(InfoExtractor):
    IE_NAME = 'umg:de'
    IE_DESC = 'Universal Music Deutschland'
    _VALID_URL = r'https?://(?:www\.)?universal-music\.de/[^/?#]+/videos/(?P<slug>[^/?#]+-(?P<id>\d+))'
    _TESTS = [{
        'url': 'https://www.universal-music.de/sido/videos/jedes-wort-ist-gold-wert-457803',
        'info_dict': {
            'id': '457803',
            'ext': 'mp4',
            'title': 'Jedes Wort ist Gold wert',
            'artists': ['Sido'],
            'description': 'md5:df2dbffcff1a74e0a7c9bef4b497aeec',
            'display_id': 'jedes-wort-ist-gold-wert-457803',
            'duration': 210.0,
            'thumbnail': r're:https?://images\.universal-music\.de/img/assets/.+\.jpg',
            'timestamp': 1513591800,
            'upload_date': '20171218',
            'view_count': int,
        },
    }, {
        'url': 'https://www.universal-music.de/alexander-eder/videos/der-doktor-hat-gesagt-609533',
        'info_dict': {
            'id': '609533',
            'ext': 'mp4',
            'title': 'Der Doktor hat gesagt',
            'artists': ['Alexander Eder'],
            'display_id': 'der-doktor-hat-gesagt-609533',
            'duration': 146.0,
            'thumbnail': r're:https?://images\.universal-music\.de/img/assets/.+\.jpg',
            'timestamp': 1742982100,