X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fvshare.py;fp=youtube_dl%2Fextractor%2Fvshare.py;h=5addbc2803d213f4fcb987ecc26aa8c2ae0de6aa;hb=2ab0bfcd810b521bcf4de6dd555c0a47e8a69f70;hp=0000000000000000000000000000000000000000;hpb=b022f4f600a2d73c65e569a9f0a19eed47272938;p=youtube-dl diff --git a/youtube_dl/extractor/vshare.py b/youtube_dl/extractor/vshare.py new file mode 100644 index 000000000..5addbc280 --- /dev/null +++ b/youtube_dl/extractor/vshare.py @@ -0,0 +1,38 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class VShareIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?vshare\.io/[dv]/(?P[^/?#&]+)' + _TESTS = [{ + 'url': 'https://vshare.io/d/0f64ce6', + 'md5': '16d7b8fef58846db47419199ff1ab3e7', + 'info_dict': { + 'id': '0f64ce6', + 'title': 'vl14062007715967', + 'ext': 'mp4', + } + }, { + 'url': 'https://vshare.io/v/0f64ce6/width-650/height-430/1', + 'only_matching': True, + }] + + def _real_extract(self, url): + video_id = self._match_id(url) + + webpage = self._download_webpage( + 'https://vshare.io/d/%s' % video_id, video_id) + + title = self._html_search_regex( + r'(?s)
(.+?)
', webpage, 'title') + video_url = self._search_regex( + r']+href=(["\'])(?P(?:https?:)?//.+?)\1[^>]*>[Cc]lick\s+here', + webpage, 'video url', group='url') + + return { + 'id': video_id, + 'title': title, + 'url': video_url, + }