import re from .common import InfoExtractor from ..compat import ( compat_str, compat_urlparse, ) from ..utils import ( ExtractorError, parse_duration, url_or_none, urlencode_postdata, ) class FrontendMastersBaseIE(InfoExtractor): _API_BASE = 'https://api.frontendmasters.com/v1/kabuki' _LOGIN_URL = 'https://frontendmasters.com/login/' _NETRC_MACHINE = 'frontendmasters' def _perform_login(self, username, password): login_page = self._download_webpage( self._LOGIN_URL, None, 'Downloading login page') login_form = self._hidden_inputs(login_page) login_form.update({ 'username': username, 'password': password }) post_url = self._search_regex( r'