mirror of
https://github.com/l1ving/youtube-dl
synced 2025-02-05 21:03:26 +08:00
Add videowood extractor
This commit is contained in:
parent
4c8fea92f3
commit
8b3f2dcfab
@ -633,6 +633,7 @@ from .videomega import VideoMegaIE
|
||||
from .videopremium import VideoPremiumIE
|
||||
from .videott import VideoTtIE
|
||||
from .videoweed import VideoWeedIE
|
||||
from .videowood import VideoWoodIE
|
||||
from .vidme import VidmeIE
|
||||
from .vidzi import VidziIE
|
||||
from .vier import VierIE, VierVideosIE
|
||||
|
29
youtube_dl/extractor/videowood.py
Normal file
29
youtube_dl/extractor/videowood.py
Normal file
@ -0,0 +1,29 @@
|
||||
from __future__ import unicode_literals
|
||||
from .common import InfoExtractor
|
||||
import re
|
||||
|
||||
|
||||
class VideoWoodIE(InfoExtractor):
|
||||
_VALID_URL = r'http://(?:www\.)?videowood\.tv/video/(?P<id>[\da-zA-Z]+)'
|
||||
_TEST = {
|
||||
'url': 'http://videowood.tv/video/cy3q',
|
||||
'md5': '0e98cba08c31f0d3153709926bca51ac',
|
||||
'info_dict': {
|
||||
'id': 'cy3q',
|
||||
'ext': 'mp4',
|
||||
'title': 'Between.S01E02.iTALiAN.subbed.avi'
|
||||
}}
|
||||
|
||||
def _get_property(self, config, prop):
|
||||
c = self._search_regex(r'%s: \'(.+?)\',' % prop, config, 'prop %s' % prop)
|
||||
return c
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
url = url.replace('/video/', '/embed/')
|
||||
embed = self._download_webpage(url, video_id)
|
||||
jwconfig = self._search_regex(r'config += +(\{.*?\});', embed, 'metadata', flags=re.DOTALL)
|
||||
data = {'id': video_id}
|
||||
for s in [('file', 'url'), ('image', 'thumbnail'), ('title', 'title')]:
|
||||
data[s[1]] = self._get_property(jwconfig, s[0])
|
||||
return data
|
Loading…
Reference in New Issue
Block a user