1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-01-23 22:22:52 +08:00

[vidlii] add new extractor

This commit is contained in:
John D 2017-10-15 22:26:12 -07:00
parent 83fcf19e2d
commit ccfa7671b0
2 changed files with 36 additions and 0 deletions

View File

@ -1192,6 +1192,7 @@ from .videomore import (
from .videopremium import VideoPremiumIE
from .videopress import VideoPressIE
from .vidio import VidioIE
from .vidlii import VidliiIE
from .vidme import (
VidmeIE,
VidmeUserIE,

View File

@ -0,0 +1,35 @@
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import int_or_none
class VidliiIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?vidlii\.com/watch\?v\=(?P<id>[a-zA-Z0-9]+$)'
_TEST = {
'url': 'https://www.vidlii.com/watch?v=vBo2IcrwOkO',
'md5': 'b42640a596b4dc986702567d49268963',
'info_dict': {
'id': 'vBo2IcrwOkO',
'ext': 'mp4',
'title': '(OLD VIDEO) i like youtube!!',
}
}
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
video_url = self._search_regex(r'var videoInfo\s+=\s+{\s+src\:\s+"(.+?)"', webpage, 'video URL')
title = self._html_search_regex(r'<h1>(.+?)</h1>', webpage, 'title')
view_count = int_or_none(self._html_search_regex(r'<div[^>]+class="w_views"[^>]*><strong>(\d*)', webpage, 'views'))
return {
'id': video_id,
'title': title,
'view_count': view_count,
'formats': [{
'url': video_url,
}],
}