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

Code before:
import urllib.parse

from .common import InfoExtractor
from ..utils import (
    determine_ext,
    extract_attributes,
    int_or_none,
    parse_duration,
    try_get,
)


class TV5MondePlusIE(InfoExtractor):
    IE_DESC = 'TV5MONDE+'
    _VALID_URL = r'https?://(?:www\.)?(?:tv5mondeplus|revoir\.tv5monde)\.com/toutes-les-videos/[^/]+/(?P<id>[^/?#]+)'
    _TESTS = [{
        # movie
        'url': 'https://revoir.tv5monde.com/toutes-les-videos/cinema/les-novices',
        'md5': 'c86f60bf8b75436455b1b205f9745955',
        'info_dict': {
            'id': '106971507_6D4BA7b',
            'display_id': 'les-novices',
            'ext': 'mp4',
            'title': 'Les novices',
            'description': 'md5:2e7c33ba3ad48dabfcc2a956b88bde2b',
            'upload_date': '20230821',
            'thumbnail': 'https://revoir.tv5monde.com/uploads/media/video_thumbnail/0738/60/01e952b7ccf36b7c6007ec9131588954ab651de9.jpeg',
            'duration': 5177,
            'episode': 'Les novices',
        },
    }, {
        # series episode
        'url': 'https://revoir.tv5monde.com/toutes-les-videos/series-fictions/opj-les-dents-de-la-terre-2',
        'info_dict': {
            'id': '106990379_6D4BA7b',
            'display_id': 'opj-les-dents-de-la-terre-2',
            'ext': 'mp4',
            'title': "OPJ - Les dents de la Terre (2)",
            'description': 'md5:288f87fd68d993f814e66e60e5302d9d',
            'upload_date': '20230823',
            'series': "OPJ",
            'episode': 'Les dents de la Terre (2)',
            'duration': 2877,
            'thumbnail': 'https://dl-revoir.tv5monde.com/images/1a/5753448.jpg'
        },

Review comment (suggestion):
Don't replace tests. If these tests are dead, add `'skip': '[reason for skipping]'` to the test dict and add new tests

Code after:
import urllib.parse

from .common import InfoExtractor
from ..utils import (
    determine_ext,
    extract_attributes,
    int_or_none,
    parse_duration,
    traverse_obj,
    try_get,
    url_or_none,
)


class TV5MondePlusIE(InfoExtractor):
    IE_DESC = 'TV5MONDE+'
    _VALID_URL = r'https?://(?:www\.)?(?:tv5mondeplus|revoir\.tv5monde)\.com/toutes-les-videos/[^/]+/(?P<id>[^/?#]+)'
    _TESTS = [{
        # movie
        'url': 'https://revoir.tv5monde.com/toutes-les-videos/cinema/les-novices',
        'md5': 'c86f60bf8b75436455b1b205f9745955',
        'info_dict': {
            'id': 'ZX0ipMyFQq_6D4BA7b',
            'display_id': 'les-novices',
            'ext': 'mp4',
            'title': 'Les novices',
            'description': 'md5:2e7c33ba3ad48dabfcc2a956b88bde2b',
            'upload_date': '20230821',
            'thumbnail': 'https://revoir.tv5monde.com/uploads/media/video_thumbnail/0738/60/01e952b7ccf36b7c6007ec9131588954ab651de9.jpeg',
            'duration': 5177,
            'episode': 'Les novices',
        },
    }, {
        # series episode
        'url': 'https://revoir.tv5monde.com/toutes-les-videos/series-fictions/opj-les-dents-de-la-terre-2',
        'info_dict': {
            'id': 'wJ0eeEPozr_6D4BA7b',
            'display_id': 'opj-les-dents-de-la-terre-2',
            'ext': 'mp4',
            'title': "OPJ - Les dents de la Terre (2)",
            'description': 'md5:288f87fd68d993f814e66e60e5302d9d',
            'upload_date': '20230823',
            'series': 'OPJ',
            'episode': 'Les dents de la Terre (2)',
            'duration': 2877,