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

Code before:
import urllib.parse

from .common import InfoExtractor
from ..networking.exceptions import HTTPError
from ..utils import (
    ExtractorError,
    float_or_none,
    int_or_none,
    parse_age_limit,
    url_or_none,
    urlencode_postdata,
)
from ..utils.traversal import traverse_obj


class AtresPlayerIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?atresplayer\.com/[^/?#]+/[^/?#]+/[^/?#]+/[^/?#]+/(?P<display_id>.+?)_(?P<id>[0-9a-f]{24})'
    _NETRC_MACHINE = 'atresplayer'
    _TESTS = [{
        'url': 'https://www.atresplayer.com/lasexta/programas/el-objetivo/clips/mbappe-describe-como-entrenador-a-carlo-ancelotti-sabe-cuando-tiene-que-ser-padre-jefe-amigo-entrenador_67f2dfb2fb6ab0e4c7203849/',
        'info_dict': {
            'ext': 'mp4',
            'id': '67f2dfb2fb6ab0e4c7203849',
            'display_id': 'md5:c203f8d4e425ed115ba56a1c6e4b3e6c',
            'title': 'Mbappé describe como entrenador a Carlo Ancelotti: "Sabe cuándo tiene que ser padre, jefe, amigo, entrenador..."',
            'channel': 'laSexta',
            'duration': 31,
            'thumbnail': 'https://imagenes.atresplayer.com/atp/clipping/cmsimages02/2025/04/06/B02DBE1E-D59B-4683-8404-1A9595D15269/1920x1080.jpg',
            'tags': ['Entrevista informativa', 'Actualidad', 'Debate informativo', 'Política', 'Economía', 'Sociedad', 'Cara a cara', 'Análisis', 'Más periodismo'],
            'series': 'El Objetivo',
            'season': 'Temporada 12',
            'timestamp': 1743970079.052,
            'upload_date': '20250406',
        },
    }, {
        'url': 'https://www.atresplayer.com/antena3/programas/el-hormiguero/clips/revive-la-entrevista-completa-a-miguel-bose-en-el-hormiguero_67f836baa4a5b0e4147ca59a/',
        'info_dict': {
            'ext': 'mp4',
            'id': '67f836baa4a5b0e4147ca59a',
            'display_id': 'revive-la-entrevista-completa-a-miguel-bose-en-el-hormiguero',
            'title': 'Revive la entrevista completa a Miguel Bosé en El Hormiguero',
            'description': 'md5:c6d2b591408d45a7bc2986dfb938eb72',

Review comment (suggestion):
```suggestion
    _VALID_URL = r'https?://(?:www\.)?atresplayer\.com/(?:[^/?#]+/){4}(?P<display_id>.+?)_(?P<id>[0-9a-f]{24})'
```

Code after:
import urllib.parse

from .common import InfoExtractor
from ..networking.exceptions import HTTPError
from ..utils import (
    ExtractorError,
    int_or_none,
    parse_age_limit,
    url_or_none,
    urlencode_postdata,
)
from ..utils.traversal import traverse_obj


class AtresPlayerIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?atresplayer\.com/(?:[^/?#]+/){4}(?P<display_id>.+?)_(?P<id>[0-9a-f]{24})'
    _NETRC_MACHINE = 'atresplayer'
    _TESTS = [{
        'url': 'https://www.atresplayer.com/lasexta/programas/el-objetivo/clips/mbappe-describe-como-entrenador-a-carlo-ancelotti-sabe-cuando-tiene-que-ser-padre-jefe-amigo-entrenador_67f2dfb2fb6ab0e4c7203849/',
        'info_dict': {
            'ext': 'mp4',
            'id': '67f2dfb2fb6ab0e4c7203849',
            'display_id': 'md5:c203f8d4e425ed115ba56a1c6e4b3e6c',
            'title': 'Mbappé describe como entrenador a Carlo Ancelotti: "Sabe cuándo tiene que ser padre, jefe, amigo, entrenador..."',
            'channel': 'laSexta',
            'duration': 31,
            'thumbnail': 'https://imagenes.atresplayer.com/atp/clipping/cmsimages02/2025/04/06/B02DBE1E-D59B-4683-8404-1A9595D15269/1920x1080.jpg',
            'tags': ['Entrevista informativa', 'Actualidad', 'Debate informativo', 'Política', 'Economía', 'Sociedad', 'Cara a cara', 'Análisis', 'Más periodismo'],
            'series': 'El Objetivo',
            'season': 'Temporada 12',
            'timestamp': 1743970079,
            'upload_date': '20250406',
        },
    }, {
        'url': 'https://www.atresplayer.com/antena3/programas/el-hormiguero/clips/revive-la-entrevista-completa-a-miguel-bose-en-el-hormiguero_67f836baa4a5b0e4147ca59a/',
        'info_dict': {
            'ext': 'mp4',
            'id': '67f836baa4a5b0e4147ca59a',
            'display_id': 'revive-la-entrevista-completa-a-miguel-bose-en-el-hormiguero',
            'title': 'Revive la entrevista completa a Miguel Bosé en El Hormiguero',
            'description': 'md5:c6d2b591408d45a7bc2986dfb938eb72',
            'channel': 'Antena 3',