mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-12-01 20:57:54 +01:00
Fix Stanford (Closes #653)
This commit is contained in:
parent
25580f3251
commit
f0bad2b026
@ -2869,8 +2869,7 @@ class StanfordOpenClassroomIE(InfoExtractor):
|
|||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
if mobj is None:
|
if mobj is None:
|
||||||
self._downloader.trouble(u'ERROR: invalid URL: %s' % url)
|
raise ExtractorError(u'Invalid URL: %s' % url)
|
||||||
return
|
|
||||||
|
|
||||||
if mobj.group('course') and mobj.group('video'): # A specific video
|
if mobj.group('course') and mobj.group('video'): # A specific video
|
||||||
course = mobj.group('course')
|
course = mobj.group('course')
|
||||||
@ -2907,12 +2906,9 @@ class StanfordOpenClassroomIE(InfoExtractor):
|
|||||||
'upload_date': None,
|
'upload_date': None,
|
||||||
}
|
}
|
||||||
|
|
||||||
self.report_download_webpage(info['id'])
|
coursepage = self._download_webpage(url, info['id'],
|
||||||
try:
|
note='Downloading course info page',
|
||||||
coursepage = compat_urllib_request.urlopen(url).read()
|
errnote='Unable to download course info page')
|
||||||
except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err:
|
|
||||||
self._downloader.trouble(u'ERROR: unable to download course info page: ' + compat_str(err))
|
|
||||||
return
|
|
||||||
|
|
||||||
m = re.search('<h1>([^<]+)</h1>', coursepage)
|
m = re.search('<h1>([^<]+)</h1>', coursepage)
|
||||||
if m:
|
if m:
|
||||||
@ -2936,7 +2932,6 @@ class StanfordOpenClassroomIE(InfoExtractor):
|
|||||||
assert entry['type'] == 'reference'
|
assert entry['type'] == 'reference'
|
||||||
results += self.extract(entry['url'])
|
results += self.extract(entry['url'])
|
||||||
return results
|
return results
|
||||||
|
|
||||||
else: # Root page
|
else: # Root page
|
||||||
info = {
|
info = {
|
||||||
'id': 'Stanford OpenClassroom',
|
'id': 'Stanford OpenClassroom',
|
||||||
|
Loading…
Reference in New Issue
Block a user