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

Code before:
from .common import InfoExtractor
from ..utils import (
    js_to_json,
    urlencode_postdata,
    urljoin,
)


class JioSaavnBaseInfoExtractor(InfoExtractor):
    def _extract_initial_data(self, url, audio_id):
        webpage = self._download_webpage(url, audio_id)
        return self._search_json(
            r'window\.__INITIAL_DATA__\s*=', webpage,
            'init json', audio_id, transform_source=js_to_json)


class JioSaavnSongIE(JioSaavnBaseInfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?(?:jiosaavn\.com/song/[^/?#]+/|saavn\.com/s/song/(?:[^/?#]+/){3})(?P<id>[^/?#]+)'
    _TESTS = [{
        'url': 'https://www.jiosaavn.com/song/leja-re/OQsEfQFVUXk',
        'md5': '7b1f70de088ede3a152ea34aece4df42',
        'info_dict': {
            'id': 'OQsEfQFVUXk',
            'ext': 'mp3',
            'title': 'Leja Re',
            'album': 'Leja Re',
            'thumbnail': 'https://c.saavncdn.com/258/Leja-Re-Hindi-2018-20181124024539-500x500.jpg',
        },
    }, {
        'url': 'https://www.saavn.com/s/song/hindi/Saathiya/O-Humdum-Suniyo-Re/KAMiazoCblU',
        'only_matching': True,
    }]

    def _real_extract(self, url):

Review comment (refactor):
```suggestion
class JioSaavnBaseIE(InfoExtractor):
```

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


class JioSaavnBaseIE(InfoExtractor):
    def _extract_initial_data(self, url, audio_id):
        webpage = self._download_webpage(url, audio_id)
        return self._search_json(
            r'window\.__INITIAL_DATA__\s*=', webpage,
            'init json', audio_id, transform_source=js_to_json)


class JioSaavnSongIE(JioSaavnBaseIE):
    _VALID_URL = r'https?://(?:www\.)?(?:jiosaavn\.com/song/[^/?#]+/|saavn\.com/s/song/(?:[^/?#]+/){3})(?P<id>[^/?#]+)'
    _TESTS = [{
        'url': 'https://www.jiosaavn.com/song/leja-re/OQsEfQFVUXk',
        'md5': '7b1f70de088ede3a152ea34aece4df42',
        'info_dict': {
            'id': 'OQsEfQFVUXk',
            'ext': 'mp3',
            'title': 'Leja Re',
            'album': 'Leja Re',
            'thumbnail': 'https://c.saavncdn.com/258/Leja-Re-Hindi-2018-20181124024539-500x500.jpg',
        },
    }, {
        'url': 'https://www.saavn.com/s/song/hindi/Saathiya/O-Humdum-Suniyo-Re/KAMiazoCblU',
        'only_matching': True,
    }]
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/jiosaavn.py (Python)

Code before:
from .common import InfoExtractor
from ..utils import (
    js_to_json,
    urlencode_postdata,
    urljoin,
)


class JioSaavnBaseIE(InfoExtractor):
    def _extract_initial_data(self, url, audio_id):
        webpage = self._download_webpage(url, audio_id)
        return self._search_json(
            r'window\.__INITIAL_DATA__\s*=', webpage,
            'init json', audio_id, transform_source=js_to_json)


class JioSaavnSongIE(JioSaavnBaseIE):
    _VALID_URL = r'https?://(?:www\.)?(?:jiosaavn\.com/song/[^/?#]+/|saavn\.com/s/song/(?:[^/?#]+/){3})(?P<id>[^/?#]+)'
    _TESTS = [{
        'url': 'https://www.jiosaavn.com/song/leja-re/OQsEfQFVUXk',
        'md5': '7b1f70de088ede3a152ea34aece4df42',
        'info_dict': {
            'id': 'OQsEfQFVUXk',
            'ext': 'mp3',
            'title': 'Leja Re',
            'album': 'Leja Re',
            'thumbnail': 'https://c.saavncdn.com/258/Leja-Re-Hindi-2018-20181124024539-500x500.jpg',
        },
    }, {
        'url': 'https://www.saavn.com/s/song/hindi/Saathiya/O-Humdum-Suniyo-Re/KAMiazoCblU',
        'only_matching': True,
    }]

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

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


class JioSaavnBaseIE(InfoExtractor):
    def _extract_initial_data(self, url, audio_id):
        webpage = self._download_webpage(url, audio_id)
        return self._search_json(
            r'window\.__INITIAL_DATA__\s*=', webpage,
            'init json', audio_id, transform_source=js_to_json)


class JioSaavnSongIE(JioSaavnBaseIE):
    _VALID_URL = r'https?://(?:www\.)?(?:jiosaavn\.com/song/[^/?#]+/|saavn\.com/s/song/(?:[^/?#]+/){3})(?P<id>[^/?#]+)'
    _TESTS = [{
        'url': 'https://www.jiosaavn.com/song/leja-re/OQsEfQFVUXk',
        'md5': '7b1f70de088ede3a152ea34aece4df42',
        'info_dict': {
            'id': 'OQsEfQFVUXk',
            'ext': 'mp3',
            'title': 'Leja Re',
            'album': 'Leja Re',
            'thumbnail': 'https://c.saavncdn.com/258/Leja-Re-Hindi-2018-20181124024539-500x500.jpg',
        },
    }, {
        'url': 'https://www.saavn.com/s/song/hindi/Saathiya/O-Humdum-Suniyo-Re/KAMiazoCblU',
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/jiosaavn.py (Python)

Code before:
from .common import InfoExtractor
from ..utils import (
    js_to_json,
    urlencode_postdata,
    urljoin,
)
from ..utils.traversal import traverse_obj


class JioSaavnBaseIE(InfoExtractor):
    def _extract_initial_data(self, url, audio_id):
        webpage = self._download_webpage(url, audio_id)
        return self._search_json(
            r'window\.__INITIAL_DATA__\s*=', webpage,
            'init json', audio_id, transform_source=js_to_json)


class JioSaavnSongIE(JioSaavnBaseIE):
    _VALID_URL = r'https?://(?:www\.)?(?:jiosaavn\.com/song/[^/?#]+/|saavn\.com/s/song/(?:[^/?#]+/){3})(?P<id>[^/?#]+)'
    _TESTS = [{
        'url': 'https://www.jiosaavn.com/song/leja-re/OQsEfQFVUXk',
        'md5': '7b1f70de088ede3a152ea34aece4df42',
        'info_dict': {
            'id': 'OQsEfQFVUXk',
            'ext': 'mp3',
            'title': 'Leja Re',
            'album': 'Leja Re',
            'thumbnail': 'https://c.saavncdn.com/258/Leja-Re-Hindi-2018-20181124024539-500x500.jpg',
        },

Review comment (suggestion):
```suggestion
    js_to_json,
    url_or_none,
    urlencode_postdata,
```

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


class JioSaavnBaseIE(InfoExtractor):
    def _extract_initial_data(self, url, audio_id):
        webpage = self._download_webpage(url, audio_id)
        return self._search_json(
            r'window\.__INITIAL_DATA__\s*=', webpage,
            'init json', audio_id, transform_source=js_to_json)


class JioSaavnSongIE(JioSaavnBaseIE):
    _VALID_URL = r'https?://(?:www\.)?(?:jiosaavn\.com/song/[^/?#]+/|saavn\.com/s/song/(?:[^/?#]+/){3})(?P<id>[^/?#]+)'
    _TESTS = [{
        'url': 'https://www.jiosaavn.com/song/leja-re/OQsEfQFVUXk',
        'md5': '7b1f70de088ede3a152ea34aece4df42',
        'info_dict': {
            'id': 'OQsEfQFVUXk',
            'ext': 'mp3',
            'title': 'Leja Re',
            'album': 'Leja Re',
            'thumbnail': 'https://c.saavncdn.com/258/Leja-Re-Hindi-2018-20181124024539-500x500.jpg',
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/mbn.py (Python)

Code before:
import re

from .common import InfoExtractor
from ..utils import (
    int_or_none,
    unified_strdate,
)


class MBNIE(InfoExtractor):
    IE_DESC = 'mbn.co.kr (매일방송)'
    _VALID_URL = r'https?://(?:www\.)?mbn\.co\.kr/vod/programContents/(?:previewlist|preview)/[0-9]+/[0-9]+/(?P<id>[0-9]+)'
    _TESTS = [{
        'url': 'https://mbn.co.kr/vod/programContents/previewlist/861/5433/1276155',
        'md5': '85e1694e5b247c04d1386b7e3c90fd76',
        'info_dict': {
            'id': '1276155',
            'ext': 'mp4',
            'title': '결국 사로잡힌 권유리, 그녀를 목숨 걸고 구하려는 정일우!',
            'duration': 3891,
            'release_date': '20210703',
            'thumbnail': 'http://img.vod.mbn.co.kr/mbnvod2img/861/2021/07/03/20210703230811_20_861_1276155_360_7_0.jpg',
            'series': '보쌈 - 운명을 훔치다',
            'episode': 'Episode 19',
            'episode_number': 19,
        },
    }, {
        'url': 'https://www.mbn.co.kr/vod/programContents/previewlist/835/5294/1084744',
        'md5': 'fc65d3aac85e85e0b5056f4ef99cde4a',
        'info_dict': {
            'id': '1084744',
            'ext': 'mp4',
            'title': '김정은♥최원영, 제자리를 찾은 위험한 부부! ＂결혼은 투쟁이면서, 어려운 방식이야..＂',
            'duration': 93,
            'release_date': '20201124',
            'thumbnail': 'http://img.vod.mbn.co.kr/mbnvod2img/835/2020/11/25/20201125000221_21_835_1084744_360_7_0.jpg',
            'series': '나의 위험한 아내',

Review comment (suggestion):
we can shorten this a bit
```suggestion
    _VALID_URL = r'https?://(?:www\.)?mbn\.co\.kr/vod/programContents/preview(?:list)?/\d+/\d+/(?P<id>\d+)'
```

Code after:
import re

from .common import InfoExtractor
from ..utils import (
    int_or_none,
    unified_strdate,
    url_or_none,
)
from ..utils.traversal import traverse_obj


class MBNIE(InfoExtractor):
    IE_DESC = 'mbn.co.kr (매일방송)'
    _VALID_URL = r'https?://(?:www\.)?mbn\.co\.kr/vod/programContents/preview(?:list)?/\d+/\d+/(?P<id>\d+)'
    _TESTS = [{
        'url': 'https://mbn.co.kr/vod/programContents/previewlist/861/5433/1276155',
        'md5': '85e1694e5b247c04d1386b7e3c90fd76',
        'info_dict': {
            'id': '1276155',
            'ext': 'mp4',
            'title': '결국 사로잡힌 권유리, 그녀를 목숨 걸고 구하려는 정일우!',
            'duration': 3891,
            'release_date': '20210703',
            'thumbnail': 'http://img.vod.mbn.co.kr/mbnvod2img/861/2021/07/03/20210703230811_20_861_1276155_360_7_0.jpg',
            'series': '보쌈 - 운명을 훔치다',
            'episode': 'Episode 19',
            'episode_number': 19,
        },
    }, {
        'url': 'https://www.mbn.co.kr/vod/programContents/previewlist/835/5294/1084744',
        'md5': 'fc65d3aac85e85e0b5056f4ef99cde4a',
        'info_dict': {
            'id': '1084744',
            'ext': 'mp4',
            'title': '김정은♥최원영, 제자리를 찾은 위험한 부부! ＂결혼은 투쟁이면서, 어려운 방식이야..＂',
            'duration': 93,
            'release_date': '20201124',
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/jtbc.py (Python)

Code before:
import re

from .common import InfoExtractor
from ..utils import (
    parse_duration,
    traverse_obj,
)


class JTBCIE(InfoExtractor):
    IE_DESC = 'jtbc.co.kr'
    _VALID_URL = r'https?://(?:vod\.jtbc\.co\.kr/player/(?:program|clip)|tv\.jtbc\.co\.kr/(?:replay|trailer|clip)/pr[0-9]+/pm[0-9]+)/(?P<id>(?:ep|vo)[0-9]+)'
    _GEO_COUNTRIES = ['KR']

    _TESTS = [{
        'url': 'https://tv.jtbc.co.kr/replay/pr10011629/pm10067930/ep20216321/view',
        'md5': 'e6ade71d8c8685bbfd6e6ce4167c6a6c',
        'info_dict': {
            'id': 'ep20216321',
            'ext': 'mp4',
            'title': '힘쎈여자 강남순 2회 다시보기',
            'description': 'md5:043c1d9019100ce271dba09995dbd1e2',
            'duration': 3770.0,
            'release_date': '20231008',
            'age_limit': 15,
            'thumbnail': 'https://fs.jtbc.co.kr//joydata/CP00000001/prog/drama/stronggirlnamsoon/img/20231008_163541_522_1.jpg',
            'series': '힘쎈여자 강남순',
        },
    }, {
        'url': 'https://vod.jtbc.co.kr/player/program/ep20216733',
        'md5': '217a6d190f115a75e4bda0ceaa4cd7f4',
        'info_dict': {
            'id': 'ep20216733',
            'ext': 'mp4',
            'title': '헬로 마이 닥터 친절한 진료실 149회 다시보기',
            'description': 'md5:1d70788a982dd5de26874a92fcffddb8',
            'duration': 2720.0,

Review comment (suggestion):
```suggestion
    _VALID_URL = r'''(?x)
        https?://(?:
            vod\.jtbc\.co\.kr/player/(?:program|clip)
            |tv\.jtbc\.co\.kr/(?:replay|trailer|clip)/pr\d+/pm\d+
        )/(?P<id>(?:ep|vo)\d+)'''
```

Code after:
import re

from .common import InfoExtractor
from ..utils import (
    int_or_none,
    parse_duration,
    url_or_none,
)
from ..utils.traversal import traverse_obj


class JTBCIE(InfoExtractor):
    IE_DESC = 'jtbc.co.kr'
    _VALID_URL = r'''(?x)
        https?://(?:
            vod\.jtbc\.co\.kr/player/(?:program|clip)
            |tv\.jtbc\.co\.kr/(?:replay|trailer|clip)/pr\d+/pm\d+
        )/(?P<id>(?:ep|vo)\d+)'''
    _GEO_COUNTRIES = ['KR']

    _TESTS = [{
        'url': 'https://tv.jtbc.co.kr/replay/pr10011629/pm10067930/ep20216321/view',
        'md5': 'e6ade71d8c8685bbfd6e6ce4167c6a6c',
        'info_dict': {
            'id': 'VO10721192',
            'display_id': 'ep20216321',
            'ext': 'mp4',
            'title': '힘쎈여자 강남순 2회 다시보기',
            'description': 'md5:043c1d9019100ce271dba09995dbd1e2',
            'duration': 3770.0,
            'release_date': '20231008',
            'age_limit': 15,
            'thumbnail': 'https://fs.jtbc.co.kr//joydata/CP00000001/prog/drama/stronggirlnamsoon/img/20231008_163541_522_1.jpg',
            'series': '힘쎈여자 강남순',
        },
    }, {
        'url': 'https://vod.jtbc.co.kr/player/program/ep20216733',
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/jtbc.py (Python)

Code before:
    _TESTS = [{
        'url': 'https://tv.jtbc.co.kr/replay/pr10010392/pm10032710',
        'info_dict': {
            '_type': 'playlist',
            'id': 'pr10010392',
        },
        'playlist_count': 398,
    }, {
        'url': 'https://vod.jtbc.co.kr/program/pr10011491/replay',
        'info_dict': {
            '_type': 'playlist',
            'id': 'pr10011491',
        },
        'playlist_count': 59,
    }]

    def _real_extract(self, url):
        program_id = self._match_id(url)

        vod_list = self._download_json(
            f'https://now-api.jtbc.co.kr/v1/vodClip/programHome/programReplayVodList?programId={program_id}&rowCount=10000',
            program_id, note='Downloading program replay list')

        entries = [self.url_result(
            'https://vod.jtbc.co.kr/player/program/' + video.get('episodeId'), JTBCIE.ie_key()
        ) for video in vod_list.get('programReplayVodList', [])]

        return self.playlist_result(entries, program_id)


Review comment (suggestion):
```suggestion
        entries = [self.url_result(f'https://vod.jtbc.co.kr/player/program/{video_id}', JTBCIE, video_id)
                   for video_id in traverse_obj(vod_list, ('programReplayVodList', ... 'episodeId'))]
```

Code after:
                'description': 'episodeContents',
                'thumbnail': ('imgFileUrl', {url_or_none}),
            })),
            'duration': parse_duration(playback_data.get('playTime')),
            'formats': formats,
            'subtitles': subtitles,
        }


class JTBCProgramIE(InfoExtractor):
    IE_NAME = 'JTBC:program'
    _VALID_URL = r'https?://(?:vod\.jtbc\.co\.kr/program|tv\.jtbc\.co\.kr/replay)/(?P<id>pr\d+)/(?:replay|pm\d+)/?(?:$|[?#])'

    _TESTS = [{
        'url': 'https://tv.jtbc.co.kr/replay/pr10010392/pm10032710',
        'info_dict': {
            '_type': 'playlist',
            'id': 'pr10010392',
        },
        'playlist_count': 398,
    }, {
        'url': 'https://vod.jtbc.co.kr/program/pr10011491/replay',
        'info_dict': {
            '_type': 'playlist',
            'id': 'pr10011491',
        },
        'playlist_count': 59,
    }]

    def _real_extract(self, url):
        program_id = self._match_id(url)

        vod_list = self._download_json(
            'https://now-api.jtbc.co.kr/v1/vodClip/programHome/programReplayVodList', program_id,
            note='Downloading program replay list', query={
                'programId': program_id,
                'rowCount': '10000',
            })

        entries = [self.url_result(f'https://vod.jtbc.co.kr/player/program/{video_id}', JTBCIE, video_id)
                   for video_id in traverse_obj(vod_list, ('programReplayVodList', ..., 'episodeId'))]
        return self.playlist_result(entries, program_id)
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/jtbc.py (Python)

Code before:
        'info_dict': {
            '_type': 'playlist',
            'id': 'pr10010392',
        },
        'playlist_count': 398,
    }, {
        'url': 'https://vod.jtbc.co.kr/program/pr10011491/replay',
        'info_dict': {
            '_type': 'playlist',
            'id': 'pr10011491',
        },
        'playlist_count': 59,
    }]

    def _real_extract(self, url):
        program_id = self._match_id(url)

        vod_list = self._download_json(
            'https://now-api.jtbc.co.kr/v1/vodClip/programHome/programReplayVodList', program_id,
            note='Downloading program replay list', query={
                'programId': program_id,
                'rowCount': '10000',
            })

        entries = [self.url_result(f'https://vod.jtbc.co.kr/player/program/{video_id}', JTBCIE, video_id)
                   for video_id in traverse_obj(vod_list, ('programReplayVodList', ... 'episodeId'))]

        return self.playlist_result(entries, program_id)


Review comment (suggestion):
oops, I think this was my typo
```suggestion
                   for video_id in traverse_obj(vod_list, ('programReplayVodList', ..., 'episodeId'))]
```

Code after:


class JTBCProgramIE(InfoExtractor):
    IE_NAME = 'JTBC:program'
    _VALID_URL = r'https?://(?:vod\.jtbc\.co\.kr/program|tv\.jtbc\.co\.kr/replay)/(?P<id>pr\d+)/(?:replay|pm\d+)/?(?:$|[?#])'

    _TESTS = [{
        'url': 'https://tv.jtbc.co.kr/replay/pr10010392/pm10032710',
        'info_dict': {
            '_type': 'playlist',
            'id': 'pr10010392',
        },
        'playlist_count': 398,
    }, {
        'url': 'https://vod.jtbc.co.kr/program/pr10011491/replay',
        'info_dict': {
            '_type': 'playlist',
            'id': 'pr10011491',
        },
        'playlist_count': 59,
    }]

    def _real_extract(self, url):
        program_id = self._match_id(url)

        vod_list = self._download_json(
            'https://now-api.jtbc.co.kr/v1/vodClip/programHome/programReplayVodList', program_id,
            note='Downloading program replay list', query={
                'programId': program_id,
                'rowCount': '10000',
            })

        entries = [self.url_result(f'https://vod.jtbc.co.kr/player/program/{video_id}', JTBCIE, video_id)
                   for video_id in traverse_obj(vod_list, ('programReplayVodList', ..., 'episodeId'))]
        return self.playlist_result(entries, program_id)
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/sbscokr.py (Python)

Code before:
    _TESTS = [{
        'url': 'https://programs.sbs.co.kr/culture/morningwide/vods/65007',
        'info_dict': {
            '_type': 'playlist',
            'id': '00000210215',
        },
        'playlist_mincount': 9782,
    }, {
        'url': 'https://programs.sbs.co.kr/enter/dongsang2/vods/52006',
        'info_dict': {
            '_type': 'playlist',
            'id': '22000010476',
        },
        'playlist_mincount': 312,
    }]

    def _real_extract(self, url):
        program_slug = self._match_id(url)

        menu_data = self._download_json(
            f'https://static.apis.sbs.co.kr/program-api/1.0/menu/{program_slug}', program_slug,
            note='Downloading program menu data')

        return self.url_result(
            'https://allvod.sbs.co.kr/allvod/vodProgramDetail.do?pgmId=' + traverse_obj(
                menu_data, ('program', 'programid')), SBSCoKrAllvodProgramIE)


Review comment (suggestion):
IMO if/when this breaks, a keyerror would be cleaner than returning a url_result with a malformed url
```suggestion
        program_id = self._download_json(
            f'https://static.apis.sbs.co.kr/program-api/1.0/menu/{program_slug}', program_slug,
            note='Downloading program menu data')['program']['programid']

        return self.url_result(
            f'https://allvod.sbs.co.kr/allvod/vodProgramDetail.do?pgmId={program_id}', SBSCoKrAllvodProgramIE)
```

Code after:

    _TESTS = [{
        'url': 'https://programs.sbs.co.kr/culture/morningwide/vods/65007',
        'info_dict': {
            '_type': 'playlist',
            'id': '00000210215',
        },
        'playlist_mincount': 9782,
    }, {
        'url': 'https://programs.sbs.co.kr/enter/dongsang2/vods/52006',
        'info_dict': {
            '_type': 'playlist',
            'id': '22000010476',
        },
        'playlist_mincount': 312,
    }]

    def _real_extract(self, url):
        program_slug = self._match_id(url)

        program_id = self._download_json(
            f'https://static.apis.sbs.co.kr/program-api/1.0/menu/{program_slug}', program_slug,
            note='Downloading program menu data')['program']['programid']

        return self.url_result(
            f'https://allvod.sbs.co.kr/allvod/vodProgramDetail.do?pgmId={program_id}', SBSCoKrAllvodProgramIE)
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/maariv.py (Python)

Code before:
from yt_dlp.extractor.common import InfoExtractor
import re


class MaarivIE(InfoExtractor):
    IE_NAME = 'maariv.co.il'
    _VALID_URL = r'(https?://)?(www\.)?(m\.)?maariv\.co\.il(?:/[^/]+)*/Article-(?P<id>\d{7})'
    _TESTS = [
        {
            'url': 'https://www.maariv.co.il/news/law/Article-1044008',
            'info_dict': {
                'id': '1044008',
                'title': '.*',
            },
        }
    ]

    @staticmethod
    def extract_resolution(url):
        pattern = r'(\d{2,4}x\d{2,4})\.mp4$'
        match = re.search(pattern, url)
        return match.group(1) if match else None

    def _real_extract(self, url):
        video_id = self._match_id(url)
        webpage = self._download_webpage(url, video_id)

Review comment (refactor):
```suggestion
from .common import InfoExtractor
```

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


class MaarivIE(InfoExtractor):
    IE_NAME = 'maariv.co.il'
    _VALID_URL = r'https?://player\.maariv\.co\.il/public/player\.html\?(?:[^#]+&)?media=(?P<id>\d+)'
    _EMBED_REGEX = [rf'<iframe[^>]+\bsrc=[\'"](?P<url>{_VALID_URL})']
    _TESTS = [{
        'url': 'https://player.maariv.co.il/public/player.html?player=maariv-desktop&media=3611585',
        'info_dict': {
            'id': '3611585',
            'duration': 75,
            'ext': 'mp4',
            'upload_date': '20231009',
            'title': 'מבצע חרבות ברזל',
            'timestamp': 1696851301,
        },
    }]
    _WEBPAGE_TESTS = [{