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

Code before:
            formats.append({
                'format_note': 'Camera stream',
                'url': str_or_none(data.get('viewMp4Url')),
                'width': int_or_none(traverse_obj(data, ('viewResolvtions', 0))),
                'height': int_or_none(traverse_obj(data, ('viewResolvtions', 1))),
                'format_id': str_or_none(traverse_obj(data, ('recording', 'id'))),
                'ext': 'mp4',
                'filesize_approx': parse_filesize(
                    traverse_obj(data, ('recording', 'fileSizeInMB'), expected_type=str_or_none)),
                'preference': 0
            })

        if data.get('shareMp4Url'):
            formats.append({
                'format_note': 'Screen share stream',
                'url': str_or_none(data.get('shareMp4Url')),
                'width': int_or_none(traverse_obj(data, ('shareResolvtions', 0))),
                'height': int_or_none(traverse_obj(data, ('shareResolvtions', 1))),
                'format_id': str_or_none(traverse_obj(data, ('shareVideo', 'id'))),
                'ext': 'mp4',
                'preference': -1
            })

        return {
            'id': play_id,
            'title': traverse_obj(data, ('meet', 'topic'), expected_type=str_or_none),
            'subtitles': subtitles,
            'formats': formats,
            'http_headers': {
                'Referer': base_url,
            },
        }


Review comment (suggestion):
```suggestion
            'title': str_or_none(traverse_obj(data, ('meet', 'topic'))),
```

Code after:
            formats.append({
                'format_note': 'Camera stream',
                'url': str_or_none(data.get('viewMp4Url')),
                'width': int_or_none(traverse_obj(data, ('viewResolvtions', 0))),
                'height': int_or_none(traverse_obj(data, ('viewResolvtions', 1))),
                'format_id': str_or_none(traverse_obj(data, ('recording', 'id'))),
                'ext': 'mp4',
                'filesize_approx': parse_filesize(str_or_none(traverse_obj(data, ('recording', 'fileSizeInMB')))),
                'preference': 0
            })

        if data.get('shareMp4Url'):
            formats.append({
                'format_note': 'Screen share stream',
                'url': str_or_none(data.get('shareMp4Url')),
                'width': int_or_none(traverse_obj(data, ('shareResolvtions', 0))),
                'height': int_or_none(traverse_obj(data, ('shareResolvtions', 1))),
                'format_id': str_or_none(traverse_obj(data, ('shareVideo', 'id'))),
                'ext': 'mp4',
                'preference': -1
            })

        return {
            'id': play_id,
            'title': str_or_none(traverse_obj(data, ('meet', 'topic'))),
            'subtitles': subtitles,
            'formats': formats,
            'http_headers': {
                'Referer': base_url,
            },
        }
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/hrefli.py (Python)

Code before:
import re

from .common import InfoExtractor


class HrefLiIE(InfoExtractor):
    _VALID_URL = r'https?://href\.li/\?(?P<url>.+)'

    _TESTS = [{
        'url': 'https://href.li/?https://www.reddit.com/r/cats/comments/12bluel/my_cat_helps_me_with_water/?utm_source=share&utm_medium=android_app&utm_name=androidcss&utm_term=1&utm_content=share_button',
        'only_matching': True,
    }]

    def _real_extract(self, url):
        return self.url_result(re.fullmatch(self._VALID_URL, url).group('url'))


Review comment (suggestion):
```suggestion
        return self.url_result(self._match_valid_url(url).group('url'))
```

Code after:
from .common import InfoExtractor


class HrefLiRedirectIE(InfoExtractor):
    IE_NAME = 'href.li'
    IE_DESC = False  # Do not list
    _VALID_URL = r'https?://href\.li/\?(?P<url>.+)'

    _TESTS = [{
        'url': 'https://href.li/?https://www.reddit.com/r/cats/comments/12bluel/my_cat_helps_me_with_water/?utm_source=share&utm_medium=android_app&utm_name=androidcss&utm_term=1&utm_content=share_button',
        'only_matching': True,
    }]

    def _real_extract(self, url):
        return self.url_result(self._match_valid_url(url).group('url'))
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/pornez.py (Python)

Code before:
from .common import InfoExtractor
from ..utils import int_or_none, urljoin


class PornezIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?pornez\.net/(video(?P<id>[0-9]+)|watch)/'
    _TEST = {
        'url': 'https://pornez.net/video344819/mistresst-funny_penis_names-wmv/',
        'md5': '2e19a0a1cff3a5dbea0ef1b9e80bcbbc',
        'info_dict': {
            'id': '344819',
            'ext': 'mp4',
            'title': r'mistresst funny_penis_names wmv',
            'thumbnail': r're:^https?://.*\.jpg$',
            'age_limit': 18,
        }
    }

    def _real_extract(self, url):
        video_id = self._match_id(url)
        webpage = self._download_webpage(url, video_id)
        if video_id is None:
            # For https://pornez.net/watch/leana+lovings+stiff+for+stepdaughter/
            video_id = self._search_regex(
                r"<link rel='shortlink' href='.+pornez.net/\?p=\d+' ?\/>", webpage, 'link', group=0)
            video_id = video_id.split("'")[3].split("=", 1)[1]
        iframe_src = self._html_search_regex(
            r'<iframe[^>]+src="([^"]+)"', webpage, 'iframe', fatal=True)
        iframe_src = urljoin('https://pornez.net', iframe_src)
        title = self._html_search_meta(['name', 'twitter:title', 'og:title'], webpage, 'title', default=None)
        if title is None:

Review comment (suggestion):
```suggestion
    _VALID_URL = r'https?://(?:www\.)?pornez\.net/(?:video(?P<id>[0-9]+)|watch)/'
```

Code after:
from .common import InfoExtractor
from ..utils import (
    clean_html,
    int_or_none,
    get_element_by_class,
    urljoin,
)


class PornezIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?pornez\.net/(?:video(?P<id>\w+)|watch)/'
    _TESTS = [{
        'url': 'https://pornez.net/video344819/mistresst-funny_penis_names-wmv/',
        'info_dict': {
            'id': '344819',
            'ext': 'mp4',
            'title': 'mistresst funny_penis_names wmv',
            'thumbnail': r're:^https?://.*\.jpg$',
            'age_limit': 18,
        },
        'params': {'skip_download': 'm3u8'},
    }, {
        'url': 'https://pornez.net/watch/leana+lovings+stiff+for+stepdaughter/',
        'info_dict': {
            'id': '156161',
            'ext': 'mp4',
            'title': 'Watch leana lovings stiff for stepdaughter porn video.',
            'age_limit': 18,
        },
        'params': {'skip_download': 'm3u8'},
    }, {
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/pornez.py (Python)

Code before:
from .common import InfoExtractor
from ..utils import int_or_none, urljoin


class PornezIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?pornez\.net/(?:video(?P<id>[0-9]+)|watch)/'
    _TEST = {
        'url': 'https://pornez.net/video344819/mistresst-funny_penis_names-wmv/',
        'md5': '2e19a0a1cff3a5dbea0ef1b9e80bcbbc',
        'info_dict': {
            'id': '344819',
            'ext': 'mp4',
            'title': r'mistresst funny_penis_names wmv',
            'thumbnail': r're:^https?://.*\.jpg$',
            'age_limit': 18,
        }
    }

    def _real_extract(self, url):
        video_id = self._match_id(url)
        webpage = self._download_webpage(url, video_id)
        if video_id is None:
            # For https://pornez.net/watch/leana+lovings+stiff+for+stepdaughter/
            video_id = self._search_regex(
                r"<link rel='shortlink' href='.+pornez.net/\?p=\d+' ?\/>", webpage, 'link', group=0)
            video_id = video_id.split("'")[3].split("=", 1)[1]
        iframe_src = self._html_search_regex(
            r'<iframe[^>]+src="([^"]+)"', webpage, 'iframe', fatal=True)
        iframe_src = urljoin('https://pornez.net', iframe_src)
        title = self._html_search_meta(['name', 'twitter:title', 'og:title'], webpage, 'title', default=None)
        if title is None:

Review comment (suggestion):
this fixes #6298 too
```suggestion
    _VALID_URL = r'https?://(?:www\.)?pornez\.net/(?:video(?P<id>\w+)|watch)/'
```
.
you can add this to tests:
```py
    {
        'url': 'https://pornez.net/videovzs27fj/tutor4k-e14-blue-wave-1080p-nbq-tutor4k-e14-blue-wave/',
        'only_matching': True,
    },
```

Code after:
from .common import InfoExtractor
from ..utils import (
    clean_html,
    int_or_none,
    get_element_by_class,
    urljoin,
)


class PornezIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?pornez\.net/(?:video(?P<id>\w+)|watch)/'
    _TESTS = [{
        'url': 'https://pornez.net/video344819/mistresst-funny_penis_names-wmv/',
        'info_dict': {
            'id': '344819',
            'ext': 'mp4',
            'title': 'mistresst funny_penis_names wmv',
            'thumbnail': r're:^https?://.*\.jpg$',
            'age_limit': 18,
        },
        'params': {'skip_download': 'm3u8'},
    }, {
        'url': 'https://pornez.net/watch/leana+lovings+stiff+for+stepdaughter/',
        'info_dict': {
            'id': '156161',
            'ext': 'mp4',
            'title': 'Watch leana lovings stiff for stepdaughter porn video.',
            'age_limit': 18,
        },
        'params': {'skip_download': 'm3u8'},
    }, {
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/whyp.py (Python)

Code before:
            'uploader_id': 1,
            'thumbnail': 'https://cdn.whyp.it/a537bb36-3373-4c61-96c8-27fc1b2f427a.jpg',
            'vcodec': 'none',
        }
    }

    def _real_extract(self, url):
        mobj = self._match_valid_url(url)
        unique_id = mobj.group('number_id')

        webpage = self._download_webpage(url, unique_id)

        data = self._search_nuxt_data(webpage, unique_id)['rawTrack']

        return {
            'url': data['audio_url'],
            'id': unique_id,
            'title': data.get('title'),
            'description': data.get('description'),
            'duration': data.get('duration'),
            'uploader': traverse_obj(data, ('user', 'username')),
            'uploader_id': traverse_obj(data, ('user', 'id')),
            'thumbnail': data.get('artwork_url'),
            'ext': 'mp3',
            'vcodec': 'none',
            # Need referer header otherwise get 403 error from cdn
            'http_headers': {'Referer': 'https://whyp.it/'},
        }


Review comment (suggestion):
this can be inferred from its inclusion imo
```suggestion
```

Code after:
            'title': 'Home Page Example Track',
            'description': 'md5:bd758000fb93f3159339c852b5b9133c',
            'ext': 'mp3',
            'duration': 52.82,
            'uploader': 'Brad',
            'uploader_id': '1',
            'thumbnail': 'https://cdn.whyp.it/a537bb36-3373-4c61-96c8-27fc1b2f427a.jpg',
        },
    }, {
        'url': 'https://www.whyp.it/tracks/18337',
        'only_matching': True,
    }]

    def _real_extract(self, url):
        unique_id = self._match_id(url)
        webpage = self._download_webpage(url, unique_id)
        data = self._search_nuxt_data(webpage, unique_id)['rawTrack']

        return {
            'url': data['audio_url'],
            'id': unique_id,
            **traverse_obj(data, {
                'title': 'title',
                'description': 'description',
                'duration': ('duration', {float_or_none}),
                'uploader': ('user', 'username'),
                'uploader_id': ('user', 'id', {str_or_none}),
                'thumbnail': ('artwork_url', {url_or_none}),
            }),
            'ext': 'mp3',
            'vcodec': 'none',
            'http_headers': {'Referer': 'https://whyp.it/'},
        }
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/whyp.py (Python)

Code before:
from .common import InfoExtractor
from ..utils import traverse_obj, float_or_none, str_or_none, url_or_none


class WhypIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?whyp\.it/tracks/(?P<id>\d+)'
    _TEST = {
        'url': 'https://www.whyp.it/tracks/18337/home-page-example-track-b4kq7',
        'md5': 'c1187b42ebf8605284e3dc92aeb33d16',
        'info_dict': {
            'url': 'https://cdn.whyp.it/50eb17cc-e9ff-4e18-b89b-dc9206a95cb1.mp3',
            'id': '18337',
            'title': 'Home Page Example Track',
            'description': 'Just an example track for the home page!\n\nCredit: https://file-examples.com/index.php/sample-audio-files/sample-mp3-download/',
            'ext': 'mp3',
            'duration': 52.82,
            'uploader': 'Brad',
            'uploader_id': '1',
            'thumbnail': 'https://cdn.whyp.it/a537bb36-3373-4c61-96c8-27fc1b2f427a.jpg',
            'vcodec': 'none',
        }
    }

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

        webpage = self._download_webpage(url, unique_id)

Review comment (suggestion):
sort these
```suggestion
from ..utils import (
    float_or_none,
    str_or_none,
    traverse_obj,
    url_or_none,
)
```

Code after:
from .common import InfoExtractor
from ..utils import (
    float_or_none,
    str_or_none,
    traverse_obj,
    url_or_none,
)


class WhypIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?whyp\.it/tracks/(?P<id>\d+)'
    _TESTS = [{
        'url': 'https://www.whyp.it/tracks/18337/home-page-example-track-b4kq7',
        'md5': 'c1187b42ebf8605284e3dc92aeb33d16',
        'info_dict': {
            'url': 'https://cdn.whyp.it/50eb17cc-e9ff-4e18-b89b-dc9206a95cb1.mp3',
            'id': '18337',
            'title': 'Home Page Example Track',
            'description': 'md5:bd758000fb93f3159339c852b5b9133c',
            'ext': 'mp3',
            'duration': 52.82,
            'uploader': 'Brad',
            'uploader_id': '1',
            'thumbnail': 'https://cdn.whyp.it/a537bb36-3373-4c61-96c8-27fc1b2f427a.jpg',
        },
    }, {
        'url': 'https://www.whyp.it/tracks/18337',
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/whyp.py (Python)

Code before:
from .common import InfoExtractor
from ..utils import traverse_obj, float_or_none, str_or_none, url_or_none


class WhypIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?whyp\.it/tracks/(?P<id>\d+)'
    _TEST = {
        'url': 'https://www.whyp.it/tracks/18337/home-page-example-track-b4kq7',
        'md5': 'c1187b42ebf8605284e3dc92aeb33d16',
        'info_dict': {
            'url': 'https://cdn.whyp.it/50eb17cc-e9ff-4e18-b89b-dc9206a95cb1.mp3',
            'id': '18337',
            'title': 'Home Page Example Track',
            'description': 'Just an example track for the home page!\n\nCredit: https://file-examples.com/index.php/sample-audio-files/sample-mp3-download/',
            'ext': 'mp3',
            'duration': 52.82,
            'uploader': 'Brad',
            'uploader_id': '1',
            'thumbnail': 'https://cdn.whyp.it/a537bb36-3373-4c61-96c8-27fc1b2f427a.jpg',
            'vcodec': 'none',
        }
    }

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

        webpage = self._download_webpage(url, unique_id)

        data = self._search_nuxt_data(webpage, unique_id)['rawTrack']

        return {
            'url': data['audio_url'],
            'id': unique_id,
            **traverse_obj(data, {
                'title': 'title',
                'description': 'description',
                'duration': ('duration', {float_or_none}),
                'uploader': ('user', 'username'),
                'uploader_id': ('user', 'id', {str_or_none}),

Review comment (suggestion):
use md5 for long descriptions or other long metadata strings
```suggestion
            'description': 'md5:bd758000fb93f3159339c852b5b9133c',
```

Code after:
from .common import InfoExtractor
from ..utils import (
    float_or_none,
    str_or_none,
    traverse_obj,
    url_or_none,
)


class WhypIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?whyp\.it/tracks/(?P<id>\d+)'
    _TESTS = [{
        'url': 'https://www.whyp.it/tracks/18337/home-page-example-track-b4kq7',
        'md5': 'c1187b42ebf8605284e3dc92aeb33d16',
        'info_dict': {
            'url': 'https://cdn.whyp.it/50eb17cc-e9ff-4e18-b89b-dc9206a95cb1.mp3',
            'id': '18337',
            'title': 'Home Page Example Track',
            'description': 'md5:bd758000fb93f3159339c852b5b9133c',
            'ext': 'mp3',
            'duration': 52.82,
            'uploader': 'Brad',
            'uploader_id': '1',
            'thumbnail': 'https://cdn.whyp.it/a537bb36-3373-4c61-96c8-27fc1b2f427a.jpg',
        },
    }, {
        'url': 'https://www.whyp.it/tracks/18337',
        'only_matching': True,
    }]

    def _real_extract(self, url):
        unique_id = self._match_id(url)
        webpage = self._download_webpage(url, unique_id)
        data = self._search_nuxt_data(webpage, unique_id)['rawTrack']

        return {
            'url': data['audio_url'],
            'id': unique_id,
            **traverse_obj(data, {
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/gronkh.py (Python)

Code before:
import functools

from .common import InfoExtractor
from ..utils import (
    OnDemandPagedList,
    traverse_obj,
    unified_strdate,
    float_or_none,
)


class GronkhIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?gronkh\.tv/(?:watch/)?streams?/(?P<id>\d+)'

    _TESTS = [{
        'url': 'https://gronkh.tv/streams/657',
        'info_dict': {
            'id': '657',
            'ext': 'mp4',
            'title': 'H.O.R.D.E. - DAS ZWEiTE ZEiTALTER 🎲 Session 1',
            'view_count': int,
            'thumbnail': 'https://01.cdn.vod.farm/preview/9e2555d3a23bf4e5c5b7c6b3b70a9d84.jpg',
            'upload_date': '20221111',
            'chapters': [{'title': 'Just Chatting', 'start_time': 0, 'end_time': 1468}, {'title': 'Special Events', 'start_time': 1468, 'end_time': 5098}, {'title': 'Tabletop RPGs', 'start_time': 5098, 'end_time': 31463}],
            'duration': 31463,
        },
        'params': {'skip_download': True}
    }, {
        'url': 'https://gronkh.tv/stream/536',
        'info_dict': {
            'id': '536',
            'ext': 'mp4',
            'title': 'GTV0536, 2021-10-01 - MARTHA IS DEAD  #FREiAB1830  !FF7 !horde !archiv',

Review comment (suggestion):
```suggestion
    float_or_none,
    traverse_obj,
    unified_strdate,
```

Code after:
import functools

from .common import InfoExtractor
from ..utils import (
    OnDemandPagedList,
    float_or_none,
    traverse_obj,
    unified_strdate,
)


class GronkhIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?gronkh\.tv/(?:watch/)?streams?/(?P<id>\d+)'

    _TESTS = [{
        'url': 'https://gronkh.tv/streams/657',
        'info_dict': {
            'id': '657',
            'ext': 'mp4',
            'title': 'H.O.R.D.E. - DAS ZWEiTE ZEiTALTER 🎲 Session 1',
            'view_count': int,
            'thumbnail': 'https://01.cdn.vod.farm/preview/9e2555d3a23bf4e5c5b7c6b3b70a9d84.jpg',
            'upload_date': '20221111',
            'chapters': 'count:3',
            'duration': 31463,
        },
        'params': {'skip_download': True}
    }, {
        'url': 'https://gronkh.tv/stream/536',
        'info_dict': {
            'id': '536',
            'ext': 'mp4',
            'title': 'GTV0536, 2021-10-01 - MARTHA IS DEAD  #FREiAB1830  !FF7 !horde !archiv',
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/nhk.py (Python)

Code before:
                programme_id, series_meta)

        def entries():
            for headline in traverse_obj(meta, ('detail_list', ..., {dict})):
                yield self._extract_episode_info(headline, programme_id, series_meta)
        return self.playlist_result(
            entries(), programme_id, playlist_description=meta.get('site_detail'), **series_meta)


class NhkRadioNewsPageIE(InfoExtractor):
    _VALID_URL = r'https?://www\.nhk\.or\.jp/radionews/?'
    _TESTS = [{
        'url': 'https://www.nhk.or.jp/radionews/',
        'playlist_mincount': 5,  # airs daily, on-the-hour most hours
        'skip_download': True,
        'info_dict': {
            'id': 'F261_01',
            'thumbnail': 'https://www.nhk.or.jp/radioondemand/json/F261/img/RADIONEWS_640.jpg',
            'description': '日本、そして世界の動きを　わかりやすく、深く多角的にお伝えします。\r\n２４時間３６５日放送を続けるラジオ第１放送。\r\nいざという時には、命を守る情報を最優先でお伝えします。',
            'channel': 'NHKラジオ第1',
            'title': 'NHKラジオニュース',
        }
    }]

    def _real_extract(self, url):
        return self.url_result('https://www.nhk.or.jp/radio/ondemand/detail.html?p=F261_01')


Review comment (suggestion):
```suggestion
        return self.url_result('https://www.nhk.or.jp/radio/ondemand/detail.html?p=F261_01', NhkRadiruIE)
```

Code after:
                    'detail_list', lambda _, v: v['headline_id'] == headline_id), get_all=False),
                programme_id, series_meta)

        def entries():
            for headline in traverse_obj(meta, ('detail_list', ..., {dict})):
                yield self._extract_episode_info(headline, programme_id, series_meta)

        return self.playlist_result(
            entries(), programme_id, playlist_description=meta.get('site_detail'), **series_meta)


class NhkRadioNewsPageIE(InfoExtractor):
    _VALID_URL = r'https?://www\.nhk\.or\.jp/radionews/?(?:$|[?#])'
    _TESTS = [{
        # airs daily, on-the-hour most hours
        'url': 'https://www.nhk.or.jp/radionews/',
        'playlist_mincount': 5,
        'info_dict': {
            'id': 'F261_01',
            'thumbnail': 'https://www.nhk.or.jp/radioondemand/json/F261/img/RADIONEWS_640.jpg',
            'description': 'md5:bf2c5b397e44bc7eb26de98d8f15d79d',
            'channel': 'NHKラジオ第1',
            'title': 'NHKラジオニュース',
        }
    }]

    def _real_extract(self, url):
        return self.url_result('https://www.nhk.or.jp/radio/ondemand/detail.html?p=F261_01', NhkRadiruIE)
Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/sbs.py (Python)

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


class SBSIE(InfoExtractor):
    IE_DESC = 'sbs.com.au'
    _VALID_URL = r'''(?x)
        https?://(?:www\.)?sbs\.com\.au/(?:
            ondemand(?:
                /video/(?:single/)?|
                /(?:movie|tv-program)/[^/]+/|
                /(?:tv|news)-series/(?:[^/]+/){3}|
                .*?\bplay=|/watch/
            )|news/(?:embeds/)?video/
        )(?P<id>[0-9]+)'''
    _EMBED_REGEX = [r'''(?x)]
            (?:
                <meta\s+property="og:video"\s+content=|
                <iframe[^>]+?src=
            )

Review comment (suggestion):
sort class above function
```suggestion
    HEADRequest,
    float_or_none,
```

Code after:
from .common import InfoExtractor
from ..utils import (
    HEADRequest,
    float_or_none,
    int_or_none,
    parse_duration,
    parse_iso8601,
    traverse_obj,
    update_url_query,
    url_or_none,
)


class SBSIE(InfoExtractor):
    IE_DESC = 'sbs.com.au'
    _VALID_URL = r'''(?x)
        https?://(?:www\.)?sbs\.com\.au/(?:
            ondemand(?:
                /video/(?:single/)?|
                /(?:movie|tv-program)/[^/]+/|
                /(?:tv|news)-series/(?:[^/]+/){3}|
                .*?\bplay=|/watch/
            )|news/(?:embeds/)?video/
        )(?P<id>[0-9]+)'''
    _EMBED_REGEX = [r'''(?x)]
            (?:
                <meta\s+property="og:video"\s+content=|
                <iframe[^>]+?src=
            )