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

Code before:

class WASDTVRecordIE(WASDTVBaseIE):
    IE_NAME = 'wasdtv:record'
    _VALID_URL = r'https?://wasd\.tv/[^/#?]+/videos\?record=(?P<id>\d+)$'
    _TESTS = [{
        'url': 'https://wasd.tv/spacemita/videos?record=907755',
        'md5': 'c9899dd85be4cc997816ff9f9ca516ce',
        'info_dict': {
            'id': '906825',
            'ext': 'mp4',
            'title': 'Музыкальный',
            'description': 'md5:f510388d929ff60ae61d4c3cab3137cc',
            'timestamp': 1645812079,
            'upload_date': '20220225',
            'thumbnail': r're:^https?://.+\.jpg',
            'is_live': False,
            'view_count': int,
        },
    }]

    def _get_container(self, url):
        container_id = self._match_id(url)
        return self._fetch(
            f'v2/media-containers/{container_id}',
            video_id=container_id,
            description='media container')

    def _get_media_url(self, media_meta):
        media_archive_url = media_meta.get('media_archive_url')
        if media_archive_url:
            return media_archive_url, False
        return media_meta['media_url'], True


class WASDTVClipIE(WASDTVBaseIE):
    IE_NAME = 'wasdtv:clip'
    _VALID_URL = r'https?://wasd\.tv/[^/#?]+/clips\?clip=(?P<id>\d+)$'
    _TESTS = [{
        'url': 'https://wasd.tv/spacemita/clips?clip=26804',
        'md5': '818885e720143d7a4e776ff66fcff148',
        'info_dict': {
            'id': '26804',
            'ext': 'mp4',
            'title': 'Пуш флексит на голове стримера',
            'timestamp': 1646682908,
            'upload_date': '20220307',
            'thumbnail': r're:^https?://.+\.jpg',
            'view_count': int,
        },
    }]


Review comment (suggestion):
```suggestion
        return self._fetch(
            f'v2/media-containers/{container_id}', container_id, 'media container')
```

Code after:
    IE_NAME = 'wasdtv:record'
    _VALID_URL = r'https?://wasd\.tv/[^/#?]+/videos\?record=(?P<id>\d+)$'
    _TESTS = [{
        'url': 'https://wasd.tv/spacemita/videos?record=907755',
        'md5': 'c9899dd85be4cc997816ff9f9ca516ce',
        'info_dict': {
            'id': '906825',
            'ext': 'mp4',
            'title': 'Музыкальный',
            'description': 'md5:f510388d929ff60ae61d4c3cab3137cc',
            'timestamp': 1645812079,
            'upload_date': '20220225',
            'thumbnail': r're:^https?://.+\.jpg',
            'is_live': False,
            'view_count': int,
        },
    }]

    def _get_container(self, url):
        container_id = self._match_id(url)
        return self._fetch(
            f'v2/media-containers/{container_id}', container_id, 'media container')

    def _get_media_url(self, media_meta):
        media_archive_url = media_meta.get('media_archive_url')
        if media_archive_url:
            return media_archive_url, False
        return media_meta['media_url'], True


class WASDTVClipIE(WASDTVBaseIE):
    IE_NAME = 'wasdtv:clip'
    _VALID_URL = r'https?://wasd\.tv/[^/#?]+/clips\?clip=(?P<id>\d+)$'
    _TESTS = [{
        'url': 'https://wasd.tv/spacemita/clips?clip=26804',
        'md5': '818885e720143d7a4e776ff66fcff148',
        'info_dict': {
            'id': '26804',
            'ext': 'mp4',
            'title': 'Пуш флексит на голове стримера',
            'timestamp': 1646682908,
            'upload_date': '20220307',
            'thumbnail': r're:^https?://.+\.jpg',
            'view_count': int,
        },
    }]

    def _real_extract(self, url):
        clip_id = self._match_id(url)
        clip = self._fetch(f'v2/clips/{clip_id}', video_id=clip_id, description='clip')
        clip_data = clip.get('clip_data')