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

Code before:
            url, display_id, self._API_URL, 'go', 'us')


class ScienceChannelIE(DiscoveryPlusIE):
    _VALID_URL = r'https?://(?:www\.)?sciencechannel\.com/video' + DPlayIE._PATH_REGEX
    _TESTS = [{
        'url': 'https://www.sciencechannel.com/video/strangest-things-science-atve-us/nazi-mystery-machine',
        'info_dict': {
            'id': '2842849',
            'display_id': 'strangest-things-science-atve-us/nazi-mystery-machine',
            'ext': 'mp4',
            'title': 'Nazi Mystery Machine',
            'description': 'Experts investigate the secrets of a revolutionary encryption machine.',
            'season_number': 1,
            'episode_number': 1,
        },
        'skip': 'Available for Premium users',
    }]

    _PRODUCT = 'sci'
    _API_URL = 'us1-prod-direct.sciencechannel.com'


class DIYNetworkIE(DiscoveryPlusIE):
    _VALID_URL = r'https?://(?:www\.|watch\.)?diynetwork\.com/video' + DPlayIE._PATH_REGEX
    _TESTS = [{
        'url': 'https://watch.diynetwork.com/video/pool-kings-diy-network/bringing-beach-life-to-texas',
        'info_dict': {
            'id': '2309730',
            'display_id': 'pool-kings-diy-network/bringing-beach-life-to-texas',
            'ext': 'mp4',
            'title': 'Bringing Beach Life to Texas',
            'description': 'The Pool Kings give a family a day at the beach in their own backyard.',
            'season_number': 10,
            'episode_number': 2,
        },
        'skip': 'Available for Premium users',
    }]

    _PRODUCT = 'diy'
    _API_URL = 'us1-prod-direct.watch.diynetwork.com'


Review comment (bug):
Add an `only_matching` test for `www.` version. When you do, the test will fail. You'll need to remove that URL pattern from the `ScrippsNetworksIE` to fix it

Code after:
            url, display_id, self._API_URL, 'go', 'us')


class ScienceChannelIE(DiscoveryPlusIE):
    _VALID_URL = r'https?://(?:www\.)?sciencechannel\.com/video' + DPlayIE._PATH_REGEX
    _TESTS = [{
        'url': 'https://www.sciencechannel.com/video/strangest-things-science-atve-us/nazi-mystery-machine',
        'info_dict': {
            'id': '2842849',
            'display_id': 'strangest-things-science-atve-us/nazi-mystery-machine',
            'ext': 'mp4',
            'title': 'Nazi Mystery Machine',
            'description': 'Experts investigate the secrets of a revolutionary encryption machine.',
            'season_number': 1,
            'episode_number': 1,
        },
        'skip': 'Available for Premium users',
    }]

    _PRODUCT = 'sci'
    _API_URL = 'us1-prod-direct.sciencechannel.com'


class DIYNetworkIE(DiscoveryPlusIE):
    _VALID_URL = r'https?://(?:watch\.)?diynetwork\.com/video' + DPlayIE._PATH_REGEX
    _TESTS = [{
        'url': 'https://watch.diynetwork.com/video/pool-kings-diy-network/bringing-beach-life-to-texas',
        'info_dict': {
            'id': '2309730',
            'display_id': 'pool-kings-diy-network/bringing-beach-life-to-texas',
            'ext': 'mp4',
            'title': 'Bringing Beach Life to Texas',
            'description': 'The Pool Kings give a family a day at the beach in their own backyard.',
            'season_number': 10,
            'episode_number': 2,
        },
        'skip': 'Available for Premium users',
    }]

    _PRODUCT = 'diy'
    _API_URL = 'us1-prod-direct.watch.diynetwork.com'