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

Code before:

        return {
            'id': episode_id,
            'display_id': display_id,
            'formats': formats,
            'series': traverse_obj(self._call_api(series_id), ('Item', 'Title', {clean_html})),
            'series_id': series_id,
            'subtitles': subtitles,
            **traverse_obj(self._call_api(episode_id), ('Item', {
                'title': ('Title', {clean_html}),
                'alt_title': ('Subtitle', {clean_html}, filter),
                'cast': (
                    'Properties', 'ParentProgram', 'Hosts', {clean_html},
                    {lambda x: x.split(';')}, ..., {str.strip}, filter, all, filter),
                'description': ('Description', {clean_html}, filter),
                'duration': ('Actions', 'Play', 'Duration', {int_or_none}),
                'thumbnail': ('Image', {url_or_none}),
                'timestamp': ('Actions', 'Play', 'PublishTime', {parse_iso8601}),
            })),
        }


class TuneInEmbedIE(TuneInBaseIE):
    IE_NAME = 'tunein:embed'
    _VALID_URL = r'https?://tunein\.com/embed/player/(?P<id>[^/?#]+)'
    _EMBED_REGEX = [r'<iframe[^>]+src=["\'](?P<url>(?:https?:)?//tunein\.com/embed/player/[^/?#]+)']
    _TESTS = [{
        'url': 'https://tunein.com/embed/player/s6404/',
        'info_dict': {
            'id': 's6404',
            'ext': 'mp3',
            'title': str,
            'alt_title': 'South Africa\'s News and Information Leader',
            'channel_follower_count': int,
            'live_status': 'is_live',
            'location': 'Johannesburg, South Africa',
            'thumbnail': r're:https?://.+',
        },
        'params': {'skip_download': 'Livestream'},
    }, {
        'url': 'https://tunein.com/embed/player/t236404354/',
        'info_dict': {
            'id': 't236404354',
            'ext': 'mp3',
            'title': '#351 – MrBeast: Future of YouTube, Twitter, TikTok, and Instagram',
            'alt_title': 'Technology Podcasts >',
            'cast': 'count:1',
            'description': 'md5:1029895354ef073ff00f20b82eb6eb71',
            'display_id': '236404354',
            'duration': 8330,
            'series': 'Lex Fridman Podcast',

Review comment (suggestion):
```suggestion
    _EMBED_REGEX = [r'<iframe\b[^>]+\bsrc=["\'](?P<url>(?:https?:)?//tunein\.com/embed/player/[^/?#"/']+)']
```

Code after:

        return {
            'id': episode_id,
            'display_id': display_id,
            'formats': formats,
            'series': traverse_obj(self._call_api(series_id), ('Item', 'Title', {clean_html})),
            'series_id': series_id,
            'subtitles': subtitles,
            **traverse_obj(self._call_api(episode_id), ('Item', {
                'title': ('Title', {clean_html}),
                'alt_title': ('Subtitle', {clean_html}, filter),
                'cast': (
                    'Properties', 'ParentProgram', 'Hosts', {clean_html},
                    {lambda x: x.split(';')}, ..., {str.strip}, filter, all, filter),
                'description': ('Description', {clean_html}, filter),
                'duration': ('Actions', 'Play', 'Duration', {int_or_none}),
                'thumbnail': ('Image', {url_or_none}),
                'timestamp': ('Actions', 'Play', 'PublishTime', {parse_iso8601}),
            })),
        }


class TuneInEmbedIE(TuneInBaseIE):
    IE_NAME = 'tunein:embed'
    _VALID_URL = r'https?://tunein\.com/embed/player/(?P<id>[^/?#]+)'
    _EMBED_REGEX = [r'<iframe\b[^>]+\bsrc=["\'](?P<url>(?:https?:)?//tunein\.com/embed/player/[^/?#"\']+)']
    _TESTS = [{
        'url': 'https://tunein.com/embed/player/s6404/',
        'info_dict': {
            'id': 's6404',
            'ext': 'mp3',
            'title': str,
            'alt_title': 'South Africa\'s News and Information Leader',
            'channel_follower_count': int,
            'live_status': 'is_live',
            'location': 'Johannesburg, South Africa',
            'thumbnail': r're:https?://.+',
        },
        'params': {'skip_download': 'Livestream'},
    }, {
        'url': 'https://tunein.com/embed/player/t236404354/',
        'info_dict': {
            'id': 't236404354',
            'ext': 'mp3',
            'title': '#351 – MrBeast: Future of YouTube, Twitter, TikTok, and Instagram',
            'alt_title': 'Technology Podcasts >',
            'cast': 'count:1',
            'description': 'md5:1029895354ef073ff00f20b82eb6eb71',
            'display_id': '236404354',
            'duration': 8330,
            'series': 'Lex Fridman Podcast',