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

Code before:

    def _entries(self, show_id):
        video_ids = []
        access_token_request = self._download_json(
            'https://useraction.zee5.com/token/platform_tokens.php?platform_name=web_app',
            show_id, note="Downloading access token")
        headers = {
            'X-Access-Token': access_token_request['token'],
            'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36',
            'Referer': 'https://www.zee5.com/',
        }
        showurl = 'https://gwapi.zee5.com/content/tvshow/{}?translation=en&country=IN'.format(show_id)

        seasonid = try_get(self._download_json(showurl, video_id=show_id, headers=headers), lambda x: x['season']['id'], str)
        nexturl = 'https://gwapi.zee5.com/content/tvshow/?season_id={}&type=episode&translation=en&country=IN&on_air=false&asset_subtype=tvshow&page=1&limit=10'.format(seasonid)
        while nexturl is not None:
            episodesjson = self._download_json(nexturl, video_id=show_id, headers=headers)
            episodes = try_get(episodesjson, lambda x: x['episode'], list)
            for episode in episodes:
                video_ids.append(episode.get('id'))
            nexturl = str_or_none(episodesjson.get('next_episode_api'))

        for video_id in video_ids:
            yield self.url_result(
                'zee5:%s' % video_id,
                ie=Zee5IE.ie_key(), video_id=video_id)

    def _real_extract(self, url):
        show_id, display_id = re.match(self._VALID_URL, url).group('id', 'display_id')
        return self.playlist_result(
            self._entries(show_id), playlist_id=show_id)


Review comment (suggestion):
```suggestion
            for episode in try_get(episodesjson, lambda x: x['episode'], list) or []:
                video_id = episode.get('id')
                yield self.url_result(
                    'zee5:%s' % video_id,
                    ie=Zee5IE.ie_key(), video_id=video_id)
            nexturl = url_or_none(episodesjson.get('next_episode_api'))
```

make sure to import `url_or_none`

Code after:
            'episode_number': int_or_none(try_get(json_data, lambda x: x['index'])),
            'tags': try_get(json_data, lambda x: x['tags'], list)
        }


class Zee5SeriesIE(InfoExtractor):
    IE_NAME = 'zee5:series'
    _VALID_URL = r'''(?x)
                     (?:
                        zee5:series:|
                        (?:https?://)(?:www\.)?zee5\.com/(?:[^#?]+/)?
                        (?:tvshows|kids)(?:/[^#/?]+){2}/
                     )
                     (?P<id>[^#/?]+)/?(?:$|[?#])
                     '''
    _TESTS = [{
        'url': 'https://www.zee5.com/kids/kids-shows/krishna-balram/0-6-1871',
        'playlist_mincount': 43,
        'info_dict': {
            'id': '0-6-1871',
        },
    }, {
        'url': 'https://www.zee5.com/tvshows/details/bhabi-ji-ghar-par-hai/0-6-199',
        'playlist_mincount': 1500,
        'info_dict': {
            'id': '0-6-199',
        },
    }, {
        'url': 'https://www.zee5.com/tvshows/details/agent-raghav-crime-branch/0-6-965',
        'playlist_mincount': 25,
        'info_dict': {
            'id': '0-6-965',
        },
    }, {
        'url': 'https://www.zee5.com/ta/tvshows/details/nagabhairavi/0-6-3201',
        'playlist_mincount': 3,
        'info_dict': {
            'id': '0-6-3201',
        },
    }, {
        'url': 'https://www.zee5.com/global/hi/tvshows/details/khwaabon-ki-zamin-par/0-6-270',
        'playlist_mincount': 150,
        'info_dict': {
            'id': '0-6-270',
        },
    }
    ]

    def _entries(self, show_id):
        access_token_request = self._download_json(
            'https://useraction.zee5.com/token/platform_tokens.php?platform_name=web_app',