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

Code before:
    ]

    def _real_initialize(self):
        homepage = self._download_webpage(
            'https://murrtube.net', None, note='Getting session token')
        data = self._hidden_inputs(homepage)
        self._download_webpage(
            'https://murrtube.net/accept_age_check', None, 'Set age cookie', data=urlencode_postdata(data))

    def _real_extract(self, url):
        video_id = self._match_valid_url(url)
        video_page = self._download_webpage(url, video_id)
        video_attrs = extract_attributes(self._search_regex(r'(<video[^>]+>)', video_page, 'video'))
        playlist = video_attrs['data-url'].split('?')[0]
        video_id = self._search_regex(r'https://storage.murrtube.net/murrtube-production/.+/(?P<id>.+)/index.m3u8', playlist, 'id', default=None)
        formats = self._extract_m3u8_formats(playlist, video_id, 'mp4', entry_protocol='m3u8_native', fatal=False)
        view_str = self._search_regex(r'(?P<views>[\d,]+) <span class="has-text-white">Views<\/span>', video_page, 'views', default=None)
        like_str = self._search_regex(r'(?P<likes>[\d,]+) <span class="has-text-white">Likes<\/span>', video_page, 'likes', default=None)
        comment_str = self._search_regex(r'(?P<comment>[\d,]+) <span class="has-text-white">Comments<\/span>', video_page, 'comment', default=None)
        return {
            'id': video_id,
            'title': self._og_search_title(video_page).split(' - Murrtube')[0],
            'age_limit': 18,
            'formats': formats,
            'description': self._og_search_description(video_page),
            'thumbnail': self._og_search_thumbnail(video_page).split('?')[0],
            'uploader': self._html_search_regex(
                r'<span class="pl-1 is-size-6 has-text-lighter">(.+?)</span>', video_page, 'uploader', default=None),
            'view_count': int(view_str.replace(',', '')) if view_str else None,
            'like_count': int(like_str.replace(',', '')) if like_str else None,
            'comment_count': int(comment_str.replace(',', '')) if comment_str else None
        }


class MurrtubeUserIE(MurrtubeIE):  # XXX: Do not subclass from concrete IE
    _WORKING = False
    IE_DESC = 'Murrtube user profile'
    _VALID_URL = r'https?://murrtube\.net/(?P<id>[^/]+)$'
    _TESTS = [
        {
            'url': 'https://murrtube.net/stormy',
            'info_dict': {
                'id': 'stormy',
            },
            'playlist_mincount': 27,
        }
    ]
    _PAGE_SIZE = 10

    def _fetch_page(self, username, user_id, page):
        data = self._download_gql(username, {

Review comment (suggestion):
need to make this non-fatal
```suggestion
            'thumbnail': update_url(self._og_search_thumbnail(video_page, default=''), query=None) or None,
```

Code after:
            'like_count': int,
        },
    }]

    def _extract_count(self, name, html):
        return parse_count(self._search_regex(
            rf'([\d,]+)\s+<span[^>]*>{name}</span>', html, name, default=None))

    def _real_initialize(self):
        homepage = self._download_webpage(
            'https://murrtube.net', None, note='Getting session token')
        self._request_webpage(
            'https://murrtube.net/accept_age_check', None, 'Setting age cookie',
            data=urlencode_postdata(self._hidden_inputs(homepage)))

    def _real_extract(self, url):
        video_id = self._match_id(url)
        if video_id.startswith('murrtube:'):
            raise ExtractorError('Support for murrtube: prefix URLs is broken')
        video_page = self._download_webpage(url, video_id)
        video_attrs = extract_attributes(get_element_html_by_id('video', video_page))
        playlist = update_url(video_attrs['data-url'], query=None)
        video_id = self._search_regex(r'/([\da-f]+)/index.m3u8', playlist, 'video id')

        return {
            'id': video_id,
            'title': remove_end(self._og_search_title(video_page), ' - Murrtube'),
            'age_limit': 18,
            'formats': self._extract_m3u8_formats(playlist, video_id, 'mp4'),
            'description': self._og_search_description(video_page),
            'thumbnail': update_url(self._og_search_thumbnail(video_page, default=''), query=None) or None,
            'uploader': clean_html(get_element_by_class('pl-1 is-size-6 has-text-lighter', video_page)),
            'view_count': self._extract_count('Views', video_page),
            'like_count': self._extract_count('Likes', video_page),
            'comment_count': self._extract_count('Comments', video_page),
        }


class MurrtubeUserIE(InfoExtractor):
    _WORKING = False
    IE_DESC = 'Murrtube user profile'
    _VALID_URL = r'https?://murrtube\.net/(?P<id>[^/]+)$'
    _TESTS = [{
        'url': 'https://murrtube.net/stormy',
        'info_dict': {
            'id': 'stormy',
        },
        'playlist_mincount': 27,
    }]
    _PAGE_SIZE = 10