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

Code before:
        categories = [cat.strip() for cat in categories.split(',') if cat.strip()]

        return {
            'id': video_id,
            'title': title,
            'upload_date': upload_date,
            'uploader_id': uploader_id,
            'thumbnail': self._og_search_thumbnail(webpage),
            'categories': categories,
            'view_count': view_count,
            'like_count': like_count,
            'comment_count': comment_count,
            'age_limit': age_limit,
            'url': video_url,
        }


class MotherlessPaginatedIE(InfoExtractor):
    _EXTRA_QUERY = {}
    _PAGE_SIZE = 60

    def _correct_path(self, url, item_id):
        raise NotImplementedError('This method must be implemented by subclasses')

    def _correct_title(self, title, /):
        return title.partition(' - Videos')[0]

    def _extract_entries(self, webpage, base):
        for mobj in re.finditer(r'href="[^"]*(?P<href>/[A-F0-9]+)"\s+title="(?P<title>[^"]+)',
                                webpage):
            video_url = urllib.parse.urljoin(base, mobj.group('href'))
            video_id = MotherlessIE.get_temp_id(video_url)

            if video_id:
                yield self.url_result(video_url, MotherlessIE, video_id, mobj.group('title'))

    def _real_extract(self, url):
        item_id = self._match_id(url)
        real_url = self._correct_path(url, item_id)
        webpage = self._download_webpage(real_url, item_id, 'Downloading page 1')

        def get_page(idx):
            page = idx + 1
            current_page = webpage if not idx else self._download_webpage(
                real_url, item_id, note=f'Downloading page {page}', query={'page': page, **self._EXTRA_QUERY})
            yield from self._extract_entries(current_page, real_url)

        return self.playlist_result(
            OnDemandPagedList(get_page, self._PAGE_SIZE), item_id,
            self._correct_title(self._html_extract_title(webpage)))


Review comment (suggestion):
```suggestion
    def _correct_title(self, title, /):
        return title.partition(' - Videos')[0] if title else None
```

Code after:
        categories = [cat.strip() for cat in categories.split(',') if cat.strip()]

        return {
            'id': video_id,
            'title': title,
            'upload_date': upload_date,
            'uploader_id': uploader_id,
            'thumbnail': self._og_search_thumbnail(webpage),
            'categories': categories,
            'view_count': view_count,
            'like_count': like_count,
            'comment_count': comment_count,
            'age_limit': age_limit,
            'url': video_url,
        }


class MotherlessPaginatedIE(InfoExtractor):
    _EXTRA_QUERY = {}
    _PAGE_SIZE = 60

    def _correct_path(self, url, item_id):
        raise NotImplementedError('This method must be implemented by subclasses')

    def _correct_title(self, title, /):
        return title.partition(' - Videos')[0] if title else None

    def _extract_entries(self, webpage, base):
        for mobj in re.finditer(r'href="[^"]*(?P<href>/[A-F0-9]+)"\s+title="(?P<title>[^"]+)',
                                webpage):
            video_url = urllib.parse.urljoin(base, mobj.group('href'))
            video_id = MotherlessIE.get_temp_id(video_url)

            if video_id:
                yield self.url_result(video_url, MotherlessIE, video_id, mobj.group('title'))

    def _real_extract(self, url):
        item_id = self._match_id(url)
        real_url = self._correct_path(url, item_id)
        webpage = self._download_webpage(real_url, item_id, 'Downloading page 1')

        def get_page(idx):
            page = idx + 1
            current_page = webpage if not idx else self._download_webpage(
                real_url, item_id, note=f'Downloading page {page}', query={'page': page, **self._EXTRA_QUERY})
            yield from self._extract_entries(current_page, real_url)

        return self.playlist_result(
            OnDemandPagedList(get_page, self._PAGE_SIZE), item_id,
            self._correct_title(self._html_extract_title(webpage)))