mirror of
https://github.com/l1ving/youtube-dl
synced 2025-02-09 07:42:57 +08:00
[yizhibo] Add new extractor
This commit is contained in:
parent
730c0d12a0
commit
54fd7ac5c8
@ -1371,7 +1371,7 @@ from .webofstories import (
|
|||||||
WebOfStoriesPlaylistIE,
|
WebOfStoriesPlaylistIE,
|
||||||
)
|
)
|
||||||
from .weibo import (
|
from .weibo import (
|
||||||
WeiboIE,
|
WeiboIE,
|
||||||
WeiboMobileIE
|
WeiboMobileIE
|
||||||
)
|
)
|
||||||
from .weiqitv import WeiqiTVIE
|
from .weiqitv import WeiqiTVIE
|
||||||
@ -1423,6 +1423,7 @@ from .yandexdisk import YandexDiskIE
|
|||||||
from .yapfiles import YapFilesIE
|
from .yapfiles import YapFilesIE
|
||||||
from .yesjapan import YesJapanIE
|
from .yesjapan import YesJapanIE
|
||||||
from .yinyuetai import YinYueTaiIE
|
from .yinyuetai import YinYueTaiIE
|
||||||
|
from .yizhibo import YizhiboIE
|
||||||
from .ynet import YnetIE
|
from .ynet import YnetIE
|
||||||
from .youjizz import YouJizzIE
|
from .youjizz import YouJizzIE
|
||||||
from .youku import (
|
from .youku import (
|
||||||
|
42
youtube_dl/extractor/yizhibo.py
Normal file
42
youtube_dl/extractor/yizhibo.py
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..utils import (
|
||||||
|
js_to_json,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class YizhiboIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:wb\.)?yizhibo\.com/l/(?P<id>[^/?#&.]+)\.html(?:[?#].*)?'
|
||||||
|
|
||||||
|
_TEST = {
|
||||||
|
'url': 'https://wb.yizhibo.com/l/QcnhER5fkh_drtI3.html',
|
||||||
|
'md5': '4a61687d770de05fd2b67bd7f1b52bc3',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'QcnhER5fkh_drtI3',
|
||||||
|
'ext': 'm3u8',
|
||||||
|
'title': 'hyominnn00-一直播'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
|
title = self._search_regex(r'<title>(.*?)</title>', webpage, 'video title')
|
||||||
|
|
||||||
|
json_raw = self._search_regex(r'window\.anchor *= *({[\s\S]*?});', webpage, 'video data')
|
||||||
|
json = self._parse_json(json_raw, video_id, transform_source=js_to_json)
|
||||||
|
|
||||||
|
play_url = json['play_url']
|
||||||
|
|
||||||
|
formats = self._extract_m3u8_formats(play_url, video_id)
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'url': url,
|
||||||
|
'title': title,
|
||||||
|
'formats': formats,
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user