1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-12-21 23:46:48 +00:00

[safari] Refactor login check

This commit is contained in:
Epsilon Spider 2023-04-04 16:29:00 -04:00
parent 899af2ef61
commit f7ca7e77be

View File

@ -38,8 +38,11 @@ class SafariBaseIE(InfoExtractor):
'Downloading login page')
def is_logged(urlh):
return ('https://learning.oreilly.com/member/login/' == urlh.geturl()
or 'learning.oreilly.com/home/' in urlh.geturl())
url = urlh.geturl()
parsed_url = compat_urlparse.urlparse(url)
return parsed_url.hostname.endswith('learning.oreilly.com') and (
parsed_url.path.startswith('/home/')
or (parsed_url.path == '/member/login/' and not parsed_url.query))
if is_logged(urlh):
self.LOGGED_IN = True