1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-13 02:59:59 +08:00

[vshare.io] new extractor

This commit is contained in:
slocum 2017-02-26 12:22:22 +01:00
parent bea7af6947
commit 9834e08181
2 changed files with 37 additions and 0 deletions

View File

@ -1177,6 +1177,7 @@ from .vporn import VpornIE
from .vrt import VRTIE
from .vrak import VrakIE
from .medialaan import MedialaanIE
from .vshare import VShareIE
from .vube import VubeIE
from .vuclip import VuClipIE
from .vvvvid import VVVVIDIE

View File

@ -0,0 +1,36 @@
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class VShareIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?vshare\.io/(?:(?:d)|(?P<v>v))/(?P<id>.+)(?(v)/width-\d+/height-\d+/\d+)'
_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)
i = url.find('/v/')
if not i == -1:
url = url[:i] + '/d/' + video_id
webpage = self._download_webpage(url, video_id)
title = self._html_search_regex(r'<div id="root-container">\s*<div id[^>]+>\s*(.+?)<br/>', webpage, 'title')
video_url = self._search_regex(r'<a[^>]+href="(https?://s\d+\.vshare\.io/download.+?)">Click here</a>', webpage, 'video url')
return {
'id': video_id,
'title': title,
'url': video_url,
}