1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2025-01-08 14:17:54 +01:00
This commit is contained in:
J. Randall Owens 2019-10-03 10:25:40 +01:00
commit 0965d60a9f
4 changed files with 24 additions and 14 deletions

View File

@ -1424,12 +1424,10 @@ class InfoExtractor(object):
try: try:
self._request_webpage(url, video_id, 'Checking %s URL' % item, headers=headers) self._request_webpage(url, video_id, 'Checking %s URL' % item, headers=headers)
return True return True
except ExtractorError as e: except ExtractorError:
if isinstance(e.cause, compat_urllib_error.URLError): self.to_screen(
self.to_screen( '%s: %s URL is invalid, skipping' % (video_id, item))
'%s: %s URL is invalid, skipping' % (video_id, item)) return False
return False
raise
def http_scheme(self): def http_scheme(self):
""" Either "http:" or "https:", depending on the user's preferences """ """ Either "http:" or "https:", depending on the user's preferences """

View File

@ -86,12 +86,13 @@ class ORFTVthekIE(InfoExtractor):
if value: if value:
format_id_list.append(value) format_id_list.append(value)
format_id = '-'.join(format_id_list) format_id = '-'.join(format_id_list)
if determine_ext(fd['src']) == 'm3u8': ext = determine_ext(src)
if ext == 'm3u8':
formats.extend(self._extract_m3u8_formats( formats.extend(self._extract_m3u8_formats(
fd['src'], video_id, 'mp4', m3u8_id=format_id)) src, video_id, 'mp4', m3u8_id=format_id, fatal=False))
elif determine_ext(fd['src']) == 'f4m': elif ext == 'f4m':
formats.extend(self._extract_f4m_formats( formats.extend(self._extract_f4m_formats(
fd['src'], video_id, f4m_id=format_id)) src, video_id, f4m_id=format_id, fatal=False))
else: else:
formats.append({ formats.append({
'format_id': format_id, 'format_id': format_id,

View File

@ -48,6 +48,16 @@ class TeachableBaseIE(InfoExtractor):
'https://%s/sign_in' % site, None, 'https://%s/sign_in' % site, None,
'Downloading %s login page' % site) 'Downloading %s login page' % site)
def is_logged(webpage):
return any(re.search(p, webpage) for p in (
r'class=["\']user-signout',
r'<a[^>]+\bhref=["\']/sign_out',
r'Log\s+[Oo]ut\s*<'))
if is_logged(login_page):
self._logged_in = True
return
login_url = compat_str(urlh.geturl()) login_url = compat_str(urlh.geturl())
login_form = self._hidden_inputs(login_page) login_form = self._hidden_inputs(login_page)
@ -78,10 +88,7 @@ class TeachableBaseIE(InfoExtractor):
'Go to https://%s/ and accept.' % (site, site), expected=True) 'Go to https://%s/ and accept.' % (site, site), expected=True)
# Successful login # Successful login
if any(re.search(p, response) for p in ( if is_logged(response):
r'class=["\']user-signout',
r'<a[^>]+\bhref=["\']/sign_out',
r'>\s*Log out\s*<')):
self._logged_in = True self._logged_in = True
return return

View File

@ -179,6 +179,10 @@ class ViewLiftIE(ViewLiftBaseIE):
'only_matching': True, 'only_matching': True,
}] }]
@classmethod
def suitable(cls, url):
return False if ViewLiftEmbedIE.suitable(url) else super(ViewLiftIE, cls).suitable(url)
def _real_extract(self, url): def _real_extract(self, url):
domain, display_id = re.match(self._VALID_URL, url).groups() domain, display_id = re.match(self._VALID_URL, url).groups()