ronantakizawa/codereview-bench huggingface dataset:
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/duoplay.py (Python)

Code before:
from .common import InfoExtractor
from ..utils import (
    traverse_obj,
    unified_timestamp,
    strip_or_none,
)


class DuoplayIE(InfoExtractor):
    _VALID_URL = r'https://duoplay\.ee/(?P<id>\d+)/'
    _TESTS = [{
        'note': 'Siberi võmm S02E12',
        'url': 'https://duoplay.ee/4312/siberi-vomm?ep=24',
        'md5': '1ff59d535310ac9c5cf5f287d8f91b2d',
        'info_dict': {
            'id': '4312',
            'ext': 'mp4',
            'title': 'Operatsioon "Öö"',
            'thumbnail': r're:https://.+\.jpg(?:\?c=\d+)?$',
            'description': 'md5:8ef98f38569d6b8b78f3d350ccc6ade8',
            'upload_date': '20170523',
            'timestamp': 1495567800,
            'series': 'Siberi võmm',
            'series_id': 4312,
            'season': 'Season 2',
            'season_number': 2,
            'episode': 'Operatsioon "Öö"',
            'episode_number': 12,
            'episode_id': 24,
        },
    }, {

Review comment (refactor):
To make the other suggestions work, we need a couple more imports
```suggestion
from ..utils import (
    extract_attributes,
    get_element_text_and_html_by_tag,
    int_or_none,
    join_nonempty,
    str_or_none,
    try_call,
    unified_timestamp,
)
from ..utils.traversal import traverse_obj
```

Code after:
from .common import InfoExtractor
from ..utils import (
    ExtractorError,
    extract_attributes,
    get_element_text_and_html_by_tag,
    int_or_none,
    join_nonempty,
    str_or_none,
    try_call,
    unified_timestamp,
)
from ..utils.traversal import traverse_obj


class DuoplayIE(InfoExtractor):
    _VALID_URL = r'https://duoplay\.ee/(?P<id>\d+)/[\w-]+/?(?:\?(?:[^#]+&)?ep=(?P<ep>\d+))?'
    _TESTS = [{
        'note': 'Siberi võmm S02E12',
        'url': 'https://duoplay.ee/4312/siberi-vomm?ep=24',
        'md5': '1ff59d535310ac9c5cf5f287d8f91b2d',
        'info_dict': {
            'id': '4312_24',
            'ext': 'mp4',
            'title': 'Operatsioon "Öö"',
            'thumbnail': r're:https://.+\.jpg(?:\?c=\d+)?$',
            'description': 'md5:8ef98f38569d6b8b78f3d350ccc6ade8',
            'upload_date': '20170523',
            'timestamp': 1495567800,
            'series': 'Siberi võmm',
            'series_id': '4312',
            'season': 'Season 2',
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/duoplay.py (Python)

Code before:
from .common import InfoExtractor
from ..utils import (
    traverse_obj,
    unified_timestamp,
    strip_or_none,
)


class DuoplayIE(InfoExtractor):
    _VALID_URL = r'https://duoplay\.ee/(?P<id>\d+)/'
    _TESTS = [{
        'note': 'Siberi võmm S02E12',
        'url': 'https://duoplay.ee/4312/siberi-vomm?ep=24',
        'md5': '1ff59d535310ac9c5cf5f287d8f91b2d',
        'info_dict': {
            'id': '4312',
            'ext': 'mp4',
            'title': 'Operatsioon "Öö"',
            'thumbnail': r're:https://.+\.jpg(?:\?c=\d+)?$',
            'description': 'md5:8ef98f38569d6b8b78f3d350ccc6ade8',
            'upload_date': '20170523',
            'timestamp': 1495567800,
            'series': 'Siberi võmm',
            'series_id': 4312,
            'season': 'Season 2',
            'season_number': 2,
            'episode': 'Operatsioon "Öö"',
            'episode_number': 12,
            'episode_id': 24,
        },
    }, {
        'note': 'Empty title',
        'url': 'https://duoplay.ee/17/uhikarotid?ep=14',
        'md5': '6aca68be71112314738dd17cced7f8bf',
        'info_dict': {

Review comment (refactor):
The episode number should also be extracted from the URL, with the video_id being constructed from both.
Currently, two different episodes would have the same video_id.
```suggestion
    _VALID_URL = r'https://duoplay\.ee/(?P<id>\d+)/[\w-]+/?(?:\?(?:[^#]+&)?ep=(?P<ep>\d+))?'
```

Code after:
from .common import InfoExtractor
from ..utils import (
    ExtractorError,
    extract_attributes,
    get_element_text_and_html_by_tag,
    int_or_none,
    join_nonempty,
    str_or_none,
    try_call,
    unified_timestamp,
)
from ..utils.traversal import traverse_obj


class DuoplayIE(InfoExtractor):
    _VALID_URL = r'https://duoplay\.ee/(?P<id>\d+)/[\w-]+/?(?:\?(?:[^#]+&)?ep=(?P<ep>\d+))?'
    _TESTS = [{
        'note': 'Siberi võmm S02E12',
        'url': 'https://duoplay.ee/4312/siberi-vomm?ep=24',
        'md5': '1ff59d535310ac9c5cf5f287d8f91b2d',
        'info_dict': {
            'id': '4312_24',
            'ext': 'mp4',
            'title': 'Operatsioon "Öö"',
            'thumbnail': r're:https://.+\.jpg(?:\?c=\d+)?$',
            'description': 'md5:8ef98f38569d6b8b78f3d350ccc6ade8',
            'upload_date': '20170523',
            'timestamp': 1495567800,
            'series': 'Siberi võmm',
            'series_id': '4312',
            'season': 'Season 2',
            'season_number': 2,
            'episode': 'Operatsioon "Öö"',
            'episode_number': 12,
            'episode_id': 24,
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/duoplay.py (Python)

Code before:
from .common import InfoExtractor
from ..utils import (
    extract_attributes,
    get_element_text_and_html_by_tag,
    int_or_none,
    join_nonempty,
    str_or_none,
    try_call,
    unified_timestamp,
)
from ..utils.traversal import traverse_obj


class DuoplayIE(InfoExtractor):
    _VALID_URL = r'https://duoplay\.ee/(?P<id>\d+)/[\w-]+/?(?:\?(?:[^#]+&)?ep=(?P<ep>\d+))?'
    _TESTS = [{
        'note': 'Siberi võmm S02E12',
        'url': 'https://duoplay.ee/4312/siberi-vomm?ep=24',
        'md5': '1ff59d535310ac9c5cf5f287d8f91b2d',
        'info_dict': {
            'id': '4312_24',
            'ext': 'mp4',
            'title': 'Operatsioon "Öö"',
            'thumbnail': r're:https://.+\.jpg(?:\?c=\d+)?$',
            'description': 'md5:8ef98f38569d6b8b78f3d350ccc6ade8',
            'upload_date': '20170523',
            'timestamp': 1495567800,
            'series': 'Siberi võmm',

Review comment (refactor):
```suggestion
from ..utils import (
    ExtractorError,
    extract_attributes,
```

Code after:
from .common import InfoExtractor
from ..utils import (
    ExtractorError,
    extract_attributes,
    get_element_text_and_html_by_tag,
    int_or_none,
    join_nonempty,
    str_or_none,
    try_call,
    unified_timestamp,
)
from ..utils.traversal import traverse_obj


class DuoplayIE(InfoExtractor):
    _VALID_URL = r'https://duoplay\.ee/(?P<id>\d+)/[\w-]+/?(?:\?(?:[^#]+&)?ep=(?P<ep>\d+))?'
    _TESTS = [{
        'note': 'Siberi võmm S02E12',
        'url': 'https://duoplay.ee/4312/siberi-vomm?ep=24',
        'md5': '1ff59d535310ac9c5cf5f287d8f91b2d',
        'info_dict': {
            'id': '4312_24',
            'ext': 'mp4',
            'title': 'Operatsioon "Öö"',
            'thumbnail': r're:https://.+\.jpg(?:\?c=\d+)?$',
            'description': 'md5:8ef98f38569d6b8b78f3d350ccc6ade8',
            'upload_date': '20170523',
            'timestamp': 1495567800,
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/vidly.py (Python)

Code before:
from .common import InfoExtractor
from ..utils import (
    ExtractorError,
    mimetype2ext,
    url_or_none,
)
from ..utils.traversal import traverse_obj


class VidlyIE(InfoExtractor):
    _VALID_URL = r'https?://(?:vid\.ly/|(?:s\.)?vid\.ly/embeded.html\?(?:[^#/]+&)?link=)(?P<id>\w+)'
    _EMBED_REGEX = [r'<script[^>]+\bsrc=[\'"](?P<url>(?:https?:)?//vid\.ly/\w+/embed[^\'"]+)',
                    r'<iframe[^>]+\bsrc=[\'"](?P<url>(?:https?:)?//(?:s\.)?vid\.ly/embeded.html\?(?:[^#/]+&)?link=\w+[^\'"]+)']
    _TESTS = [{
        # JWPlayer 7, Embeds forbidden
        'url': 'https://vid.ly/2i3o9j/embed',
        'info_dict': {
            'id': '2i3o9j',
            'ext': 'mp4',
            'title': '2i3o9j',
            'thumbnail': r're:https://\w+\.cloudfront\.net/',
        },
    }, {
        # JWPlayer 6
        'url': 'http://s.vid.ly/embeded.html?link=jw_test&new=1&autoplay=true&controls=true',
        'info_dict': {
            'id': 'jw_test',
            'ext': 'mp4',
            'title': '2x8m8t',
            'thumbnail': r're:https://\w+\.cloudfront\.net/',
        },
    }, {
        # Vidlyplayer
        'url': 'https://vid.ly/7x0e6l',
        'info_dict': {
            'id': '7x0e6l',
            'ext': 'mp4',
            'title': '7x0e6l',

Review comment (suggestion):
```suggestion
    _VALID_URL = r'https?://(?:vid\.ly/|(?:s\.)?vid\.ly/embeded\.html\?(?:[^#]+&)?link=)(?P<id>\w+)'
    _EMBED_REGEX = [r'<script[^>]+\bsrc=[\'"](?P<url>(?:https?:)?//vid\.ly/\w+/embed[^\'"]+)',
                    r'<iframe[^>]+\bsrc=[\'"](?P<url>(?:https?:)?//(?:s\.)?vid\.ly/embeded\.html\?(?:[^#\'"]+&)?link=\w+[^\'"]+)']
```

Code after:
from .common import InfoExtractor
from ..utils import (
    ExtractorError,
    mimetype2ext,
    url_or_none,
)
from ..utils.traversal import traverse_obj


class VidlyIE(InfoExtractor):
    _VALID_URL = r'https?://(?:vid\.ly/|(?:s\.)?vid\.ly/embeded\.html\?(?:[^#]+&)?link=)(?P<id>\w+)'
    _EMBED_REGEX = [r'<script[^>]+\bsrc=[\'"](?P<url>(?:https?:)?//vid\.ly/\w+/embed[^\'"]+)',
                    r'<iframe[^>]+\bsrc=[\'"](?P<url>(?:https?:)?//(?:s\.)?vid\.ly/embeded\.html\?(?:[^#\'"]+&)?link=\w+[^\'"]+)']
    _TESTS = [{
        # JWPlayer 7, Embeds forbidden
        'url': 'https://vid.ly/2i3o9j/embed',
        'info_dict': {
            'id': '2i3o9j',
            'ext': 'mp4',
            'title': '2i3o9j',
            'thumbnail': r're:https://\w+\.cloudfront\.net/',
        },
    }, {
        # JWPlayer 6
        'url': 'http://s.vid.ly/embeded.html?link=jw_test&new=1&autoplay=true&controls=true',
        'info_dict': {
            'id': 'jw_test',
            'ext': 'mp4',
            'title': '2x8m8t',
            'thumbnail': r're:https://\w+\.cloudfront\.net/',
        },
    }, {
        # Vidlyplayer
        'url': 'https://vid.ly/7x0e6l',
        'info_dict': {
            'id': '7x0e6l',
            'ext': 'mp4',
            'title': '7x0e6l',
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/vidly.py (Python)

Code before:
        player = self._search_json(r'initCallback\(', embed_script, 'player', video_id)

        player_type = player.get('player') or ''
        if player_type.startswith('jwplayer'):
            return self._parse_jwplayer_data(player['config'], video_id)
        elif not player_type.startswith('vidly'):
            raise ExtractorError(f'Unknown player type {player_type!r}')
        formats = []
        ext = mimetype2ext(traverse_obj(player, ('config', 'type')))
        if traverse_obj(player, ('config', 'source', {url_or_none})):
            formats.append({
                'url': player['config']['source'],
                'format_id': 'http-sd',
                'ext': ext,
            })
        if traverse_obj(player, ('config', 'source_hd', {url_or_none})):
            formats.append({
                'url': player['config']['source_hd'],
                'format_id': 'http-hd',
                'ext': ext,
            })
        # Has higher quality formats
        formats.extend(self._extract_m3u8_formats(
            f'https://d3fenhwk93s16g.cloudfront.net/{video_id}/hls.m3u8', video_id,
            fatal=False, note='Trying to guess m3u8 URL') or [])
        return {
            'id': video_id,
            'title': video_id,
            'formats': formats,
        }


Review comment (suggestion):
```suggestion
            fatal=False, note='Requesting higher quality m3u8 formats',
            errnote='No higher quality m3u8 formats found') or [])

        return {
```

Code after:
        player = self._search_json(r'initCallback\(', embed_script, 'player', video_id)

        player_type = player.get('player') or ''
        if player_type.startswith('jwplayer'):
            return self._parse_jwplayer_data(player['config'], video_id)
        elif not player_type.startswith('vidly'):
            raise ExtractorError(f'Unknown player type {player_type!r}')

        formats = []
        ext = mimetype2ext(traverse_obj(player, ('config', 'type')))
        for source, fid in [('source', 'sd'), ('source_hd', 'hd')]:
            if traverse_obj(player, ('config', source, {url_or_none})):
                formats.append({
                    'url': player['config'][source],
                    'format_id': f'http-{fid}',
                    'ext': ext,
                })
        # Has higher quality formats
        formats.extend(self._extract_m3u8_formats(
            f'https://d3fenhwk93s16g.cloudfront.net/{video_id}/hls.m3u8', video_id,
            fatal=False, note='Requesting higher quality m3u8 formats',
            errnote='No higher quality m3u8 formats found') or [])

        return {
            'id': video_id,
            'title': video_id,
            'formats': formats,
        }
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/cloudycdn.py (Python)

Code before:
from .common import InfoExtractor
from ..utils import (
    int_or_none,
    parse_iso8601,
    traverse_obj,
    url_or_none,
)


class CloudyCDNIE(InfoExtractor):
    _VALID_URL = r'https?://embed\.cloudycdn\.services/(?P<site_id>[^/]+)/media/(?P<id>[^?]+)'
    _TESTS = [{
        'url': 'https://embed.cloudycdn.services/ltv/media/46k_d23-6000-105?',
        'md5': '64f72a360ca530d5ed89c77646c9eee5',
        'info_dict': {
            'id': '46k_d23-6000-105',
            'ext': 'mp4',
            'timestamp': 1700589151,
            'duration': 1442,
            'upload_date': '20231121',
            'title': 'D23-6000-105_cetstud',
            'thumbnail': 'https://store.cloudycdn.services/tmsp00060/assets/media/660858/placeholder1700589200.jpg',
        }
    }, {
        'url': 'https://embed.cloudycdn.services/izm/media/26e_lv-8-5-1',
        'md5': '798828a479151e2444d8dcfbec76e482',
        'info_dict': {
            'id': '26e_lv-8-5-1',
            'ext': 'mp4',
            'title': 'LV-8-5-1',
            'timestamp': 1669767167,
            'thumbnail': 'https://store.cloudycdn.services/tmsp00120/assets/media/488306/placeholder1679423604.jpg',
            'duration': 1205,
            'upload_date': '20221130',
        }
    }]

Review comment (suggestion):
We should add embed detection so that sites like https://www.tavaklase.lv/video/es-esmu-mina-um-2/ also work. Please add a `_WEBPAGE_TESTS` for that page.
```suggestion
    _VALID_URL = r'(?:https?:)?//embed\.cloudycdn\.services/(?P<site_id>[^/]+)/media/(?P<id>[\w-]+)'
    _EMBED_REGEX = [rf'<iframe[^>]+\bsrc=[\'"](?P<url>{_VALID_URL})']
```

Code after:
from .common import InfoExtractor
from ..utils import (
    int_or_none,
    parse_iso8601,
    url_or_none,
    urlencode_postdata,
)
from ..utils.traversal import traverse_obj


class CloudyCDNIE(InfoExtractor):
    _VALID_URL = r'(?:https?:)?//embed\.cloudycdn\.services/(?P<site_id>[^/?#]+)/media/(?P<id>[\w-]+)'
    _EMBED_REGEX = [rf'<iframe[^>]+\bsrc=[\'"](?P<url>{_VALID_URL})']
    _TESTS = [{
        'url': 'https://embed.cloudycdn.services/ltv/media/46k_d23-6000-105?',
        'md5': '64f72a360ca530d5ed89c77646c9eee5',
        'info_dict': {
            'id': '46k_d23-6000-105',
            'ext': 'mp4',
            'timestamp': 1700589151,
            'duration': 1442,
            'upload_date': '20231121',
            'title': 'D23-6000-105_cetstud',
            'thumbnail': 'https://store.cloudycdn.services/tmsp00060/assets/media/660858/placeholder1700589200.jpg',
        }
    }, {
        'url': 'https://embed.cloudycdn.services/izm/media/26e_lv-8-5-1',
        'md5': '798828a479151e2444d8dcfbec76e482',
        'info_dict': {
            'id': '26e_lv-8-5-1',
            'ext': 'mp4',
            'title': 'LV-8-5-1',
            'timestamp': 1669767167,
            'thumbnail': 'https://store.cloudycdn.services/tmsp00120/assets/media/488306/placeholder1679423604.jpg',
            'duration': 1205,
            'upload_date': '20221130',
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/lsm.py (Python)

Code before:
import re
import urllib.parse

from .common import InfoExtractor
from ..utils import (
    ExtractorError,
    int_or_none,
    js_to_json,
    parse_iso8601,
    parse_qs,
    traverse_obj,
    url_or_none,
    urljoin,
)


class LSMBaseIE(InfoExtractor):
    def fix_nuxt_data(self, webpage):
        return re.sub(r'Object\.create\(null(?:,(\{.+\}))?\)', lambda m: m.group(1) or 'null', webpage)


class LSMLREmbedIE(InfoExtractor):
    _VALID_URL = r'https?://(?:(?:latvijasradio|lr1|lr2|klasika|lr4|naba|radioteatris)\.lsm|pieci)\.lv/[^/]+/(?:pleijeris|embed)'
    _TESTS = [{
        'url': 'https://latvijasradio.lsm.lv/lv/embed/?theme=black&size=16x9&showCaptions=0&id=183522',
        'md5': '719b33875cd1429846eeeaeec6df2830',
        'info_dict': {
            'id': 'a342781',
            'ext': 'mp3',
            'duration': 1823,
            'title': '#138 Nepilnīgā kompensējamo zāļu sistēma pat mēnešiem dzenā pacientus pa aptiekām',
            'thumbnail': 'https://pic.latvijasradio.lv/public/assets/media/9/d/gallery_fd4675ac.jpg',
        }
    }, {
        'url': 'https://radioteatris.lsm.lv/lv/embed/?id=&show=1270&theme=white&size=16x9',
        'info_dict': {
            'id': 1270,
        },
        'playlist_count': 3,

Review comment (suggestion):
```suggestion
    url_or_none,
    urljoin,
)
from ..utils.traversal import traverse_obj
```

Code after:
import re
import urllib.parse

from .common import InfoExtractor
from ..utils import (
    ExtractorError,
    determine_ext,
    int_or_none,
    js_to_json,
    parse_iso8601,
    parse_qs,
    str_or_none,
    url_or_none,
    urljoin,
)
from ..utils.traversal import traverse_obj


class LSMLREmbedIE(InfoExtractor):
    _VALID_URL = r'''(?x)
        https?://(?:
            (?:latvijasradio|lr1|lr2|klasika|lr4|naba|radioteatris)\.lsm|
            pieci
        )\.lv/[^/?#]+/(?:
            pleijeris|embed
        )/?\?(?:[^#]+&)?(?:show|id)=(?P<id>\d+)'''
    _TESTS = [{
        'url': 'https://latvijasradio.lsm.lv/lv/embed/?theme=black&size=16x9&showCaptions=0&id=183522',
        'md5': '719b33875cd1429846eeeaeec6df2830',
        'info_dict': {
            'id': 'a342781',
            'ext': 'mp3',
            'duration': 1823,
            'title': '#138 Nepilnīgā kompensējamo zāļu sistēma pat mēnešiem dzenā pacientus pa aptiekām',
            'thumbnail': 'https://pic.latvijasradio.lv/public/assets/media/9/d/gallery_fd4675ac.jpg',
        }
    }, {
        'url': 'https://radioteatris.lsm.lv/lv/embed/?id=&show=1270&theme=white&size=16x9',
        'info_dict': {
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/cloudycdn.py (Python)

Code before:
from .common import InfoExtractor
from ..utils import (
    int_or_none,
    parse_iso8601,
    traverse_obj,
    url_or_none,
    urlencode_postdata,
)


class CloudyCDNIE(InfoExtractor):
    _VALID_URL = r'(?:https?:)?//embed\.cloudycdn\.services/(?P<site_id>[^/]+)/media/(?P<id>[\w-]+)'
    _EMBED_REGEX = [rf'<iframe[^>]+\bsrc=[\'"](?P<url>{_VALID_URL})']
    _TESTS = [{
        'url': 'https://embed.cloudycdn.services/ltv/media/46k_d23-6000-105?',
        'md5': '64f72a360ca530d5ed89c77646c9eee5',
        'info_dict': {
            'id': '46k_d23-6000-105',
            'ext': 'mp4',
            'timestamp': 1700589151,
            'duration': 1442,
            'upload_date': '20231121',
            'title': 'D23-6000-105_cetstud',
            'thumbnail': 'https://store.cloudycdn.services/tmsp00060/assets/media/660858/placeholder1700589200.jpg',
        }
    }, {
        'url': 'https://embed.cloudycdn.services/izm/media/26e_lv-8-5-1',
        'md5': '798828a479151e2444d8dcfbec76e482',
        'info_dict': {
            'id': '26e_lv-8-5-1',
            'ext': 'mp4',
            'title': 'LV-8-5-1',
            'timestamp': 1669767167,

Review comment (suggestion):
```suggestion
    url_or_none,
    urlencode_postdata,
)
from ..utils.traversal import traverse_obj
```

Code after:
from .common import InfoExtractor
from ..utils import (
    int_or_none,
    parse_iso8601,
    url_or_none,
    urlencode_postdata,
)
from ..utils.traversal import traverse_obj


class CloudyCDNIE(InfoExtractor):
    _VALID_URL = r'(?:https?:)?//embed\.cloudycdn\.services/(?P<site_id>[^/?#]+)/media/(?P<id>[\w-]+)'
    _EMBED_REGEX = [rf'<iframe[^>]+\bsrc=[\'"](?P<url>{_VALID_URL})']
    _TESTS = [{
        'url': 'https://embed.cloudycdn.services/ltv/media/46k_d23-6000-105?',
        'md5': '64f72a360ca530d5ed89c77646c9eee5',
        'info_dict': {
            'id': '46k_d23-6000-105',
            'ext': 'mp4',
            'timestamp': 1700589151,
            'duration': 1442,
            'upload_date': '20231121',
            'title': 'D23-6000-105_cetstud',
            'thumbnail': 'https://store.cloudycdn.services/tmsp00060/assets/media/660858/placeholder1700589200.jpg',
        }
    }, {
        'url': 'https://embed.cloudycdn.services/izm/media/26e_lv-8-5-1',
        'md5': '798828a479151e2444d8dcfbec76e482',
        'info_dict': {
            'id': '26e_lv-8-5-1',
            'ext': 'mp4',
            'title': 'LV-8-5-1',
            'timestamp': 1669767167,
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/cloudycdn.py (Python)

Code before:
from .common import InfoExtractor
from ..utils import (
    int_or_none,
    parse_iso8601,
    url_or_none,
    urlencode_postdata,
)
from ..utils.traversal import traverse_obj


class CloudyCDNIE(InfoExtractor):
    _VALID_URL = r'(?:https?:)?//embed\.cloudycdn\.services/(?P<site_id>[^/]+)/media/(?P<id>[\w-]+)'
    _EMBED_REGEX = [rf'<iframe[^>]+\bsrc=[\'"](?P<url>{_VALID_URL})']
    _TESTS = [{
        'url': 'https://embed.cloudycdn.services/ltv/media/46k_d23-6000-105?',
        'md5': '64f72a360ca530d5ed89c77646c9eee5',
        'info_dict': {
            'id': '46k_d23-6000-105',
            'ext': 'mp4',
            'timestamp': 1700589151,
            'duration': 1442,
            'upload_date': '20231121',
            'title': 'D23-6000-105_cetstud',
            'thumbnail': 'https://store.cloudycdn.services/tmsp00060/assets/media/660858/placeholder1700589200.jpg',
        }
    }, {
        'url': 'https://embed.cloudycdn.services/izm/media/26e_lv-8-5-1',
        'md5': '798828a479151e2444d8dcfbec76e482',
        'info_dict': {
            'id': '26e_lv-8-5-1',
            'ext': 'mp4',
            'title': 'LV-8-5-1',
            'timestamp': 1669767167,
            'thumbnail': 'https://store.cloudycdn.services/tmsp00120/assets/media/488306/placeholder1679423604.jpg',
            'duration': 1205,
            'upload_date': '20221130',
        }

Review comment (suggestion):
```suggestion
    _VALID_URL = r'(?:https?:)?//embed\.cloudycdn\.services/(?P<site_id>[^/?#]+)/media/(?P<id>[\w-]+)'
```

Code after:
from .common import InfoExtractor
from ..utils import (
    int_or_none,
    parse_iso8601,
    url_or_none,
    urlencode_postdata,
)
from ..utils.traversal import traverse_obj


class CloudyCDNIE(InfoExtractor):
    _VALID_URL = r'(?:https?:)?//embed\.cloudycdn\.services/(?P<site_id>[^/?#]+)/media/(?P<id>[\w-]+)'
    _EMBED_REGEX = [rf'<iframe[^>]+\bsrc=[\'"](?P<url>{_VALID_URL})']
    _TESTS = [{
        'url': 'https://embed.cloudycdn.services/ltv/media/46k_d23-6000-105?',
        'md5': '64f72a360ca530d5ed89c77646c9eee5',
        'info_dict': {
            'id': '46k_d23-6000-105',
            'ext': 'mp4',
            'timestamp': 1700589151,
            'duration': 1442,
            'upload_date': '20231121',
            'title': 'D23-6000-105_cetstud',
            'thumbnail': 'https://store.cloudycdn.services/tmsp00060/assets/media/660858/placeholder1700589200.jpg',
        }
    }, {
        'url': 'https://embed.cloudycdn.services/izm/media/26e_lv-8-5-1',
        'md5': '798828a479151e2444d8dcfbec76e482',
        'info_dict': {
            'id': '26e_lv-8-5-1',
            'ext': 'mp4',
            'title': 'LV-8-5-1',
            'timestamp': 1669767167,
            'thumbnail': 'https://store.cloudycdn.services/tmsp00120/assets/media/488306/placeholder1679423604.jpg',
            'duration': 1205,
            'upload_date': '20221130',
        }