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

Code before:


class JablePlaylistIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?jable.tv/(?:categories|models|tags)/(?P<id>[\w-]+)'
    _TESTS = [{
        'url': 'https://jable.tv/models/kaede-karen/',
        'info_dict': {
            'id': 'kaede-karen',
            'title': '楓カレン',
        },
        'playlist_count': 34,
    }, {
        'url': 'https://jable.tv/categories/roleplay/',
        'only_matching': True,
    }, {
        'url': 'https://jable.tv/tags/girl/',
        'only_matching': True,
    }]

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

        def page_func(page_num):
            return [
                self.url_result(player_url, 'Jable')
                for player_url in orderedSet(
                    re.findall(
                        r'href="(https://jable.tv/videos/[\w-]+/?)"',
                        self._download_webpage(url, playlist_id, query={
                            'mode': 'async',
                            'from': page_num + 1,
                            'function': 'get_block',
                            'block_id': 'list_videos_common_videos_list',
                        }, note=f'Downloading page {page_num + 1}')
                    )
                )
            ]

        return self.playlist_result(
            InAdvancePagedList(
                page_func,
                int_or_none(
                    self._search_regex(r'from:(\d+)">[^<]+\s*&raquo;', webpage, 'last_page_number', default=1)
                ),
                24
            ),
            playlist_id=playlist_id,
            playlist_title=self._search_regex(
                r'<h2 class="h3-md mb-1">([^<]+)', webpage, 'playlist_title', default=None
            ),

Review comment (suggestion):
```suggestion
                self.url_result(player_url, JableIE)
```

Code after:
        'info_dict': {
            'id': 'kaede-karen',
            'title': '楓カレン',
        },
        'playlist_count': 34,
    }, {
        'url': 'https://jable.tv/categories/roleplay/',
        'only_matching': True,
    }, {
        'url': 'https://jable.tv/tags/girl/',
        'only_matching': True,
    }]

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

        def page_func(page_num):
            return [
                self.url_result(player_url, JableIE)
                for player_url in orderedSet(re.findall(
                    r'href="(https://jable.tv/videos/[\w-]+/?)"',
                    self._download_webpage(url, playlist_id, query={
                        'mode': 'async',
                        'from': page_num + 1,
                        'function': 'get_block',
                        'block_id': 'list_videos_common_videos_list',
                    }, note=f'Downloading page {page_num + 1}')))]

        return self.playlist_result(
            InAdvancePagedList(page_func, int_or_none(self._search_regex(
                r'from:(\d+)">[^<]+\s*&raquo;', webpage, 'last page number', default=1)), 24),
            playlist_id, self._search_regex(
                r'<h2 class="h3-md mb-1">([^<]+)', webpage, 'playlist title', default=None))