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

Code before:
            'series': program_detail.get('title'),
            'episode': episode,

        }


class NetversePlaylistIE(NetverseBaseIE):
    _VALID_URL = r'https?://(?:\w+\.)?netverse\.id/(?P<type>webseries)/(?P<display_id>[^/?#&]+)'
    _TEST = {
        'url': 'https://netverse.id/webseries/tetangga-masa-gitu',
        'info_dict': {
            'id': 16,
            'title': 'Tetangga Masa Gitu',
        },
        'playlist_mincount': 10,
        'params': {
            'skip_download': True,
        }
    }

    def _real_extract(self, url):
        playlist_data = self.get_required_json(url)

        webseries_info = traverse_obj(playlist_data, ('response', 'webseries_info'))

        videos = traverse_obj(playlist_data, ('response', 'related', 'data'))

        entries = []
        for video in videos:
            video_url = f'https://www.netverse.id/video/{video.get("slug")}'

            entry = self.url_result(video_url, NetverseIE)
            entries.append(entry)

        return self.playlist_result(
            entries, webseries_info.get('video_webseries_detail_id'), webseries_info.get('title')
        )


Review comment (suggestion):
```suggestion
        playlist_data = self.get_required_json(url)
        webseries_info = traverse_obj(playlist_data, ('response', 'webseries_info'))
        videos = traverse_obj(playlist_data, ('response', 'related', 'data'))
```
why is there space after each line!?

(Same above)

Code after:
    _VALID_URL = r'https?://(?:\w+\.)?netverse\.id/(?P<type>webseries)/(?P<display_id>[^/?#&]+)'
    _TESTS = [{
        # multiple season
        'url': 'https://netverse.id/webseries/tetangga-masa-gitu',
        'info_dict': {
            'id': 'tetangga-masa-gitu',
            'title': 'Tetangga Masa Gitu',
        },
        'playlist_count': 519,
    }, {
        # single season
        'url': 'https://netverse.id/webseries/kelas-internasional',
        'info_dict': {
            'id': 'kelas-internasional',
            'title': 'Kelas Internasional',
        },
        'playlist_count': 203,
    }]

    def parse_playlist(self, json_data, playlist_id):
        slug_sample = traverse_obj(json_data, ('related', 'data', ..., 'slug'))[0]
        for season in traverse_obj(json_data, ('seasons', ..., 'id')):
            playlist_json = self._call_api(
                slug_sample, 'season', display_id=playlist_id, season_id=season)

            for current_page in range(playlist_json['response']['season_list']['last_page']):
                playlist_json = self._call_api(slug_sample, 'season', query={'page': current_page + 1},
                                               season_id=season, display_id=playlist_id)
                for slug in traverse_obj(playlist_json, ('response', ..., 'data', ..., 'slug')):
                    yield self.url_result(f'https://www.netverse.id/video/{slug}', NetverseIE)

    def _real_extract(self, url):
        playlist_id, sites_type = self._match_valid_url(url).group('display_id', 'type')
        playlist_data = self._call_api(playlist_id, sites_type)

        return self.playlist_result(
            self.parse_playlist(playlist_data['response'], playlist_id),
            traverse_obj(playlist_data, ('response', 'webseries_info', 'slug')),
            traverse_obj(playlist_data, ('response', 'webseries_info', 'title')))