X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fwayofthemaster.py;fp=youtube_dl%2Fextractor%2Fwayofthemaster.py;h=c0723b8ebb6078a4c03f0b9cd76eb150cf021b1d;hb=e5402ac1203c8fd0c438ad515bbd80eb288b3907;hp=0000000000000000000000000000000000000000;hpb=f56f8399c7a222dd07cbf09b02c212509f2ad805;p=youtube-dl diff --git a/youtube_dl/extractor/wayofthemaster.py b/youtube_dl/extractor/wayofthemaster.py new file mode 100644 index 000000000..c0723b8eb --- /dev/null +++ b/youtube_dl/extractor/wayofthemaster.py @@ -0,0 +1,53 @@ +from __future__ import unicode_literals + +import re + +from .common import InfoExtractor +from ..utils import determine_ext + + +class WayOfTheMasterIE(InfoExtractor): + _VALID_URL = r'https?://www\.wayofthemaster\.com/([^/?#]*/)*(?P[^/?#]+)\.s?html(?:$|[?#])' + + _TEST = { + 'url': 'http://www.wayofthemaster.com/hbks.shtml', + 'md5': '5316b57487ada8480606a93cb3d18d24', + 'info_dict': { + 'id': 'hbks', + 'ext': 'mp4', + 'title': 'Intelligent Design vs. Evolution', + }, + } + + def _real_extract(self, url): + mobj = re.match(self._VALID_URL, url) + video_id = mobj.group('id') + + webpage = self._download_webpage(url, video_id) + + title = self._search_regex( + r'(.*?)', webpage, 'page title') + + url_base = self._search_regex( + r'