mirror of
https://github.com/l1ving/youtube-dl
synced 2025-01-24 05:22:51 +08:00
[vidlii] add new extractor
This commit is contained in:
parent
83fcf19e2d
commit
ccfa7671b0
@ -1192,6 +1192,7 @@ from .videomore import (
|
|||||||
from .videopremium import VideoPremiumIE
|
from .videopremium import VideoPremiumIE
|
||||||
from .videopress import VideoPressIE
|
from .videopress import VideoPressIE
|
||||||
from .vidio import VidioIE
|
from .vidio import VidioIE
|
||||||
|
from .vidlii import VidliiIE
|
||||||
from .vidme import (
|
from .vidme import (
|
||||||
VidmeIE,
|
VidmeIE,
|
||||||
VidmeUserIE,
|
VidmeUserIE,
|
||||||
|
35
youtube_dl/extractor/vidlii.py
Normal file
35
youtube_dl/extractor/vidlii.py
Normal 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,
|
||||||
|
}],
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user