mirror of https://github.com/yt-dlp/yt-dlp
parent
7f7edf837c
commit
19a107f21c
@ -1,9 +0,0 @@
|
|||||||
# Netscape HTTP Cookie File
|
|
||||||
# http://curl.haxx.se/rfc/cookie_spec.html
|
|
||||||
# This is a generated file! Do not edit.
|
|
||||||
|
|
||||||
# Cookie file entry with invalid number of fields - 6 instead of 7
|
|
||||||
www.foobar.foobar FALSE / FALSE 0 COOKIE
|
|
||||||
|
|
||||||
# Cookie file entry with invalid expires at
|
|
||||||
www.foobar.foobar FALSE / FALSE 1.7976931348623157e+308 COOKIE VALUE
|
|
@ -0,0 +1,68 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..utils import (
|
||||||
|
int_or_none,
|
||||||
|
unified_strdate,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class JpopsukiIE(InfoExtractor):
|
||||||
|
IE_NAME = 'jpopsuki.tv'
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?jpopsuki\.tv/(?:category/)?video/[^/]+/(?P<id>\S+)'
|
||||||
|
|
||||||
|
_TEST = {
|
||||||
|
'url': 'http://www.jpopsuki.tv/video/ayumi-hamasaki---evolution/00be659d23b0b40508169cdee4545771',
|
||||||
|
'md5': '88018c0c1a9b1387940e90ec9e7e198e',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '00be659d23b0b40508169cdee4545771',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'ayumi hamasaki - evolution',
|
||||||
|
'description': 'Release date: 2001.01.31\r\n浜崎あゆみ - evolution',
|
||||||
|
'thumbnail': 'http://www.jpopsuki.tv/cache/89722c74d2a2ebe58bcac65321c115b2.jpg',
|
||||||
|
'uploader': 'plama_chan',
|
||||||
|
'uploader_id': '404',
|
||||||
|
'upload_date': '20121101'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
|
video_url = 'http://www.jpopsuki.tv' + self._html_search_regex(
|
||||||
|
r'<source src="(.*?)" type', webpage, 'video url')
|
||||||
|
|
||||||
|
video_title = self._og_search_title(webpage)
|
||||||
|
description = self._og_search_description(webpage)
|
||||||
|
thumbnail = self._og_search_thumbnail(webpage)
|
||||||
|
uploader = self._html_search_regex(
|
||||||
|
r'<li>from: <a href="/user/view/user/(.*?)/uid/',
|
||||||
|
webpage, 'video uploader', fatal=False)
|
||||||
|
uploader_id = self._html_search_regex(
|
||||||
|
r'<li>from: <a href="/user/view/user/\S*?/uid/(\d*)',
|
||||||
|
webpage, 'video uploader_id', fatal=False)
|
||||||
|
upload_date = unified_strdate(self._html_search_regex(
|
||||||
|
r'<li>uploaded: (.*?)</li>', webpage, 'video upload_date',
|
||||||
|
fatal=False))
|
||||||
|
view_count_str = self._html_search_regex(
|
||||||
|
r'<li>Hits: ([0-9]+?)</li>', webpage, 'video view_count',
|
||||||
|
fatal=False)
|
||||||
|
comment_count_str = self._html_search_regex(
|
||||||
|
r'<h2>([0-9]+?) comments</h2>', webpage, 'video comment_count',
|
||||||
|
fatal=False)
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'url': video_url,
|
||||||
|
'title': video_title,
|
||||||
|
'description': description,
|
||||||
|
'thumbnail': thumbnail,
|
||||||
|
'uploader': uploader,
|
||||||
|
'uploader_id': uploader_id,
|
||||||
|
'upload_date': upload_date,
|
||||||
|
'view_count': int_or_none(view_count_str),
|
||||||
|
'comment_count': int_or_none(comment_count_str),
|
||||||
|
}
|
@ -0,0 +1,99 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..utils import (
|
||||||
|
ExtractorError,
|
||||||
|
qualities,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class PandaTVIE(InfoExtractor):
|
||||||
|
IE_DESC = '熊猫TV'
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?panda\.tv/(?P<id>[0-9]+)'
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'http://www.panda.tv/66666',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '66666',
|
||||||
|
'title': 're:.+',
|
||||||
|
'uploader': '刘杀鸡',
|
||||||
|
'ext': 'flv',
|
||||||
|
'is_live': True,
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
'skip_download': True,
|
||||||
|
},
|
||||||
|
'skip': 'Live stream is offline',
|
||||||
|
}, {
|
||||||
|
'url': 'https://www.panda.tv/66666',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
|
config = self._download_json(
|
||||||
|
'https://www.panda.tv/api_room_v2?roomid=%s' % video_id, video_id)
|
||||||
|
|
||||||
|
error_code = config.get('errno', 0)
|
||||||
|
if error_code != 0:
|
||||||
|
raise ExtractorError(
|
||||||
|
'%s returned error %s: %s'
|
||||||
|
% (self.IE_NAME, error_code, config['errmsg']),
|
||||||
|
expected=True)
|
||||||
|
|
||||||
|
data = config['data']
|
||||||
|
video_info = data['videoinfo']
|
||||||
|
|
||||||
|
# 2 = live, 3 = offline
|
||||||
|
if video_info.get('status') != '2':
|
||||||
|
raise ExtractorError(
|
||||||
|
'Live stream is offline', expected=True)
|
||||||
|
|
||||||
|
title = data['roominfo']['name']
|
||||||
|
uploader = data.get('hostinfo', {}).get('name')
|
||||||
|
room_key = video_info['room_key']
|
||||||
|
stream_addr = video_info.get(
|
||||||
|
'stream_addr', {'OD': '1', 'HD': '1', 'SD': '1'})
|
||||||
|
|
||||||
|
# Reverse engineered from web player swf
|
||||||
|
# (http://s6.pdim.gs/static/07153e425f581151.swf at the moment of
|
||||||
|
# writing).
|
||||||
|
plflag0, plflag1 = video_info['plflag'].split('_')
|
||||||
|
plflag0 = int(plflag0) - 1
|
||||||
|
if plflag1 == '21':
|
||||||
|
plflag0 = 10
|
||||||
|
plflag1 = '4'
|
||||||
|
live_panda = 'live_panda' if plflag0 < 1 else ''
|
||||||
|
|
||||||
|
plflag_auth = self._parse_json(video_info['plflag_list'], video_id)
|
||||||
|
sign = plflag_auth['auth']['sign']
|
||||||
|
ts = plflag_auth['auth']['time']
|
||||||
|
rid = plflag_auth['auth']['rid']
|
||||||
|
|
||||||
|
quality_key = qualities(['OD', 'HD', 'SD'])
|
||||||
|
suffix = ['_small', '_mid', '']
|
||||||
|
formats = []
|
||||||
|
for k, v in stream_addr.items():
|
||||||
|
if v != '1':
|
||||||
|
continue
|
||||||
|
quality = quality_key(k)
|
||||||
|
if quality <= 0:
|
||||||
|
continue
|
||||||
|
for pref, (ext, pl) in enumerate((('m3u8', '-hls'), ('flv', ''))):
|
||||||
|
formats.append({
|
||||||
|
'url': 'https://pl%s%s.live.panda.tv/live_panda/%s%s%s.%s?sign=%s&ts=%s&rid=%s'
|
||||||
|
% (pl, plflag1, room_key, live_panda, suffix[quality], ext, sign, ts, rid),
|
||||||
|
'format_id': '%s-%s' % (k, ext),
|
||||||
|
'quality': quality,
|
||||||
|
'source_preference': pref,
|
||||||
|
})
|
||||||
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'title': self._live_title(title),
|
||||||
|
'uploader': uploader,
|
||||||
|
'formats': formats,
|
||||||
|
'is_live': True,
|
||||||
|
}
|
@ -1,99 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
|
||||||
from ..compat import (
|
|
||||||
compat_b64decode,
|
|
||||||
compat_chr,
|
|
||||||
)
|
|
||||||
from ..utils import int_or_none
|
|
||||||
|
|
||||||
|
|
||||||
class PopcorntimesIE(InfoExtractor):
|
|
||||||
_VALID_URL = r'https?://popcorntimes\.tv/[^/]+/m/(?P<id>[^/]+)/(?P<display_id>[^/?#&]+)'
|
|
||||||
_TEST = {
|
|
||||||
'url': 'https://popcorntimes.tv/de/m/A1XCFvz/haensel-und-gretel-opera-fantasy',
|
|
||||||
'md5': '93f210991ad94ba8c3485950a2453257',
|
|
||||||
'info_dict': {
|
|
||||||
'id': 'A1XCFvz',
|
|
||||||
'display_id': 'haensel-und-gretel-opera-fantasy',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'title': 'Hänsel und Gretel',
|
|
||||||
'description': 'md5:1b8146791726342e7b22ce8125cf6945',
|
|
||||||
'thumbnail': r're:^https?://.*\.jpg$',
|
|
||||||
'creator': 'John Paul',
|
|
||||||
'release_date': '19541009',
|
|
||||||
'duration': 4260,
|
|
||||||
'tbr': 5380,
|
|
||||||
'width': 720,
|
|
||||||
'height': 540,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
|
||||||
mobj = re.match(self._VALID_URL, url)
|
|
||||||
video_id, display_id = mobj.group('id', 'display_id')
|
|
||||||
|
|
||||||
webpage = self._download_webpage(url, display_id)
|
|
||||||
|
|
||||||
title = self._search_regex(
|
|
||||||
r'<h1>([^<]+)', webpage, 'title',
|
|
||||||
default=None) or self._html_search_meta(
|
|
||||||
'ya:ovs:original_name', webpage, 'title', fatal=True)
|
|
||||||
|
|
||||||
loc = self._search_regex(
|
|
||||||
r'PCTMLOC\s*=\s*(["\'])(?P<value>(?:(?!\1).)+)\1', webpage, 'loc',
|
|
||||||
group='value')
|
|
||||||
|
|
||||||
loc_b64 = ''
|
|
||||||
for c in loc:
|
|
||||||
c_ord = ord(c)
|
|
||||||
if ord('a') <= c_ord <= ord('z') or ord('A') <= c_ord <= ord('Z'):
|
|
||||||
upper = ord('Z') if c_ord <= ord('Z') else ord('z')
|
|
||||||
c_ord += 13
|
|
||||||
if upper < c_ord:
|
|
||||||
c_ord -= 26
|
|
||||||
loc_b64 += compat_chr(c_ord)
|
|
||||||
|
|
||||||
video_url = compat_b64decode(loc_b64).decode('utf-8')
|
|
||||||
|
|
||||||
description = self._html_search_regex(
|
|
||||||
r'(?s)<div[^>]+class=["\']pt-movie-desc[^>]+>(.+?)</div>', webpage,
|
|
||||||
'description', fatal=False)
|
|
||||||
|
|
||||||
thumbnail = self._search_regex(
|
|
||||||
r'<img[^>]+class=["\']video-preview[^>]+\bsrc=(["\'])(?P<value>(?:(?!\1).)+)\1',
|
|
||||||
webpage, 'thumbnail', default=None,
|
|
||||||
group='value') or self._og_search_thumbnail(webpage)
|
|
||||||
|
|
||||||
creator = self._html_search_meta(
|
|
||||||
'video:director', webpage, 'creator', default=None)
|
|
||||||
|
|
||||||
release_date = self._html_search_meta(
|
|
||||||
'video:release_date', webpage, default=None)
|
|
||||||
if release_date:
|
|
||||||
release_date = release_date.replace('-', '')
|
|
||||||
|
|
||||||
def int_meta(name):
|
|
||||||
return int_or_none(self._html_search_meta(
|
|
||||||
name, webpage, default=None))
|
|
||||||
|
|
||||||
return {
|
|
||||||
'id': video_id,
|
|
||||||
'display_id': display_id,
|
|
||||||
'url': video_url,
|
|
||||||
'title': title,
|
|
||||||
'description': description,
|
|
||||||
'thumbnail': thumbnail,
|
|
||||||
'creator': creator,
|
|
||||||
'release_date': release_date,
|
|
||||||
'duration': int_meta('video:duration'),
|
|
||||||
'tbr': int_meta('ya:ovs:bitrate'),
|
|
||||||
'width': int_meta('og:video:width'),
|
|
||||||
'height': int_meta('og:video:height'),
|
|
||||||
'http_headers': {
|
|
||||||
'Referer': url,
|
|
||||||
},
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue