Merge branch 'mk6012-fix_pptv_#2422' into develop (fix #2422)

This commit is contained in:
Mort Yao 2017-10-13 14:41:04 +02:00
commit 8301ee4034
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251
3 changed files with 36 additions and 2 deletions

View File

@ -25,6 +25,7 @@ SITES = {
'freesound' : 'freesound',
'fun' : 'funshion',
'google' : 'google',
'giphy' : 'giphy',
'heavy-music' : 'heavymusic',
'huaban' : 'huaban',
'huomao' : 'huomaotv',

View File

@ -0,0 +1,33 @@
#!/usr/bin/env python
__all__ = ['giphy_download']
from ..common import *
import json
def giphy_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
html = get_html(url)
url = list(set([
unicodize(str.replace(i, '\\/', '/'))
for i in re.findall(r'<meta property="og:video:secure_url" content="(.*?)">', html)
]))
title = r1(r'<meta property="og:title" content="(.*?)">', html)
if title is None:
title = url[0]
type, ext, size = url_info(url[0], True)
size = urls_size(url)
type = "video/mp4"
ext = "mp4"
print_info(site_info, title, type, size)
if not info_only:
download_urls(url, title, ext, size, output_dir, merge=False)
site_info = "Giphy.com"
download = giphy_download
download_playlist = playlist_not_supported('giphy')

View File

@ -174,7 +174,7 @@ def make_url(stream):
src = []
for i, seg in enumerate(stream['segs']):
url = 'http://{}/{}/{}?key={}&k={}'.format(host, i, rid, key, key_expr)
url += '&fpp.ver=1.3.0.4&type=web.fpp'
url += '&fpp.ver=1.3.0.4&type='
src.append(url)
return src
@ -198,7 +198,7 @@ class PPTV(VideoExtractor):
if not self.vid:
raise('Cannot find id')
api_url = 'http://web-play.pptv.com/webplay3-0-{}.xml'.format(self.vid)
api_url += '?type=web.fpp&version=4'
api_url += '?appplt=flp&appid=pptv.flashplayer.vod&appver=3.4.2.28&type=&version=4'
dom = parseString(get_content(api_url))
self.title, m_items, m_streams, m_segs = parse_pptv_xml(dom)
xml_streams = merge_meta(m_items, m_streams, m_segs)