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

Code before:
            },
            'expected_warnings': ['Ignoring subtitle tracks found in the HLS manifest']
        }
    ]

    def _get_authenticity_token(self):
        signin_page = self._download_webpage(self._LOGIN_URL, None,
                                             note='Getting authenticity token')
        authenticity_token = self._html_search_regex(
            r'name=["\']authenticity_token["\'] value=["\'](.+?)["\']',
            signin_page, 'authenticity_token')
        return authenticity_token

    def _login(self):
        username, password = self._get_login_info()
        if not (username and password):
            self.raise_login_required()

        payload = {
            'email': username,
            'password': password,
            'authenticity_token': self._get_authenticity_token(),
            'utf8': True
        }
        response = self._download_webpage(self._LOGIN_URL, None, note='Logging in',
                                          data=urlencode_postdata(payload))

        user_has_subscription = self._search_regex(r'user_has_subscription: ["\'](.+?)["\']',
                                                   response, 'subscription_status', default='none')
        if user_has_subscription.lower() == 'true':
            return response
        self._logout()
        if user_has_subscription.lower() == 'false':
            self.raise_login_required('Account is not subscribed')
        else:
            self.raise_login_required('Incorrect username/password')

    def _logout(self):
        self._download_webpage(self._LOGOUT_URL, None, note='Logging out')

    def _real_extract(self, url):
        try:
            self._login()
            webpage = self._download_webpage(url, None, note='Downloading video webpage')
        finally:
            self._logout()

        embed_url = self._search_regex(r'embed_url: ["\'](.+?)["\']', webpage, 'embed_url')
        display_id = self._match_id(url)
        id = self._search_regex(r'embed.vhx.tv/videos/(.+?)\?', embed_url, 'id')
        description = self._html_search_meta('description', webpage, display_name='description', fatal=False)

Review comment (security):
```suggestion
    def _login(self, display_id):
        username, password = self._get_login_info()
        if not (username and password):
            self.raise_login_required()

        payload = {
            'email': username,
            'password': password,
            'authenticity_token': self._get_authenticity_token(),
            'utf8': True
        }
        response = self._download_webpage(self._LOGIN_URL, display_id, note='Logging in',
                                          data=urlencode_postdata(payload))
```
display_id isn't needed if it were in initialize

Code after:
            'description': self._html_search_meta('description', webpage, fatal=False),
            'thumbnail': thumbnail.split('?')[0] if thumbnail else None,  # Ignore crop/downscale
            'series': clean_html(get_element_by_class('series-title', watch_info)),
            'episode_number': episode_number,
            'episode': title if episode_number else None,
            'season_number': int_or_none(self._search_regex(
                r'Season (\d+),', season_episode or '', 'season', default=None)),
            'release_date': unified_strdate(self._search_regex(
                r'data-meta-field-name=["\']release_dates["\'] data-meta-field-value=["\'](.+?)["\']',
                watch_info, 'release date', default=None)),
        }


class DropoutSeasonIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?dropout\.tv/(?P<id>[^\/$&?#]+)(?:/?$|/season:[0-9]+/?$)'
    _TESTS = [
        {
            'url': 'https://www.dropout.tv/dimension-20-fantasy-high/season:1',
            'note': 'Multi-season series with the season in the url',
            'playlist_count': 17,
            'info_dict': {
                'id': 'dimension-20-fantasy-high-season-1',
                'title': 'Dimension 20 Fantasy High - Season 1'
            }
        },
        {
            'url': 'https://www.dropout.tv/dimension-20-fantasy-high',
            'note': 'Multi-season series with the season not in the url',
            'playlist_count': 17,
            'info_dict': {
                'id': 'dimension-20-fantasy-high-season-1',
                'title': 'Dimension 20 Fantasy High - Season 1'
            }
        },
        {
            'url': 'https://www.dropout.tv/dimension-20-shriek-week',
            'note': 'Single-season series',
            'playlist_count': 4,
            'info_dict': {
                'id': 'dimension-20-shriek-week-season-1',
                'title': 'Dimension 20 Shriek Week - Season 1'
            }
        }
    ]

    def _real_extract(self, url):
        season_id = self._match_id(url)
        season_title = season_id.replace('-', ' ').title()
        webpage = self._download_webpage(url, season_id)

        entries = [