mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-30 02:14:37 +01:00
Merge remote-tracking branch 'Nikerabbit/hki'
This commit is contained in:
commit
4412ca751d
@ -92,6 +92,7 @@ from .generic import GenericIE
|
|||||||
from .googleplus import GooglePlusIE
|
from .googleplus import GooglePlusIE
|
||||||
from .googlesearch import GoogleSearchIE
|
from .googlesearch import GoogleSearchIE
|
||||||
from .hark import HarkIE
|
from .hark import HarkIE
|
||||||
|
from .helsinki import HelsinkiIE
|
||||||
from .hotnewhiphop import HotNewHipHopIE
|
from .hotnewhiphop import HotNewHipHopIE
|
||||||
from .howcast import HowcastIE
|
from .howcast import HowcastIE
|
||||||
from .huffpost import HuffPostIE
|
from .huffpost import HuffPostIE
|
||||||
|
51
youtube_dl/extractor/helsinki.py
Normal file
51
youtube_dl/extractor/helsinki.py
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
|
class HelsinkiIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://video\.helsinki\.fi/Arkisto/flash\.php\?id=(?P<id>\d+)'
|
||||||
|
_TEST = {
|
||||||
|
'url': 'http://video.helsinki.fi/Arkisto/flash.php?id=20258',
|
||||||
|
'md5': 'cd829201b890905682eb194cbdea55d7',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '20258',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Tietotekniikkafoorumi-iltapäivä',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
mobj = re.match(self._VALID_URL, url)
|
||||||
|
vid = mobj.group('id')
|
||||||
|
webpage = self._download_webpage(url, vid)
|
||||||
|
formats = []
|
||||||
|
mobj = re.search('file=((\w+):[^&]+)', webpage)
|
||||||
|
if mobj: formats.append({
|
||||||
|
'ext': mobj.group(2),
|
||||||
|
'play_path': mobj.group(1),
|
||||||
|
'url': 'rtmp://flashvideo.it.helsinki.fi/vod/',
|
||||||
|
'player_url': 'http://video.helsinki.fi/player.swf',
|
||||||
|
'format_note': 'sd'
|
||||||
|
})
|
||||||
|
|
||||||
|
mobj = re.search('hd\.file=((\w+):[^&]+)', webpage)
|
||||||
|
if mobj: formats.append({
|
||||||
|
'ext': mobj.group(2),
|
||||||
|
'play_path': mobj.group(1),
|
||||||
|
'url': 'rtmp://flashvideo.it.helsinki.fi/vod/',
|
||||||
|
'player_url': 'http://video.helsinki.fi/player.swf',
|
||||||
|
'format_note': 'hd'
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': vid,
|
||||||
|
'title': self._og_search_title(webpage).replace('Video: ', ''),
|
||||||
|
'description': self._og_search_description(webpage),
|
||||||
|
'thumbnail': self._og_search_thumbnail(webpage),
|
||||||
|
'formats': formats
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user