mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-23 08:54:33 +01:00
[mit] Modernize
This commit is contained in:
parent
a16af51873
commit
876bef5937
@ -17,7 +17,7 @@ from ..utils import (
|
|||||||
|
|
||||||
class TechTVMITIE(InfoExtractor):
|
class TechTVMITIE(InfoExtractor):
|
||||||
IE_NAME = 'techtv.mit.edu'
|
IE_NAME = 'techtv.mit.edu'
|
||||||
_VALID_URL = r'https?://techtv\.mit\.edu/(videos|embeds)/(?P<id>\d+)'
|
_VALID_URL = r'https?://techtv\.mit\.edu/(?:videos|embeds)/(?P<id>\d+)'
|
||||||
|
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'http://techtv.mit.edu/videos/25418-mit-dna-learning-center-set',
|
'url': 'http://techtv.mit.edu/videos/25418-mit-dna-learning-center-set',
|
||||||
@ -31,8 +31,7 @@ class TechTVMITIE(InfoExtractor):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
video_id = self._match_id(url)
|
||||||
video_id = mobj.group('id')
|
|
||||||
raw_page = self._download_webpage(
|
raw_page = self._download_webpage(
|
||||||
'http://techtv.mit.edu/videos/%s' % video_id, video_id)
|
'http://techtv.mit.edu/videos/%s' % video_id, video_id)
|
||||||
clean_page = re.compile(r'<!--.*?-->', re.S).sub('', raw_page)
|
clean_page = re.compile(r'<!--.*?-->', re.S).sub('', raw_page)
|
||||||
|
Loading…
Reference in New Issue
Block a user