support zhanqi.tv #444

This commit is contained in:
pl 2014-11-16 22:54:57 +08:00 committed by Mort Yao
parent 810535a64b
commit 7afeecf4d7
3 changed files with 32 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# You-Get # You-Get
[![Build Status](https://api.travis-ci.org/soimort/you-get.png)](https://travis-ci.org/soimort/you-get) [![PyPI version](https://badge.fury.io/py/you-get.png)](http://badge.fury.io/py/you-get) [![Build Status](https://api.travis-ci.org/soimort/you-get.png)](https://travis-ci.org/soimort/you-get) [![PyPI version](https://badge.fury.io/py/you-get.png)](http://badge.fury.io/py/you-get)
@ -75,6 +75,7 @@ Others:
* 56 (56网) <http://www.56.com> * 56 (56网) <http://www.56.com>
* Xiami (虾米) <http://www.xiami.com> * Xiami (虾米) <http://www.xiami.com>
* YinYueTai (音悦台) <http://www.yinyuetai.com> * YinYueTai (音悦台) <http://www.yinyuetai.com>
* Zhanqi (战旗TV) <http://www.zhanqi.tv/lives>
## Prerequisites ## Prerequisites

View File

@ -899,7 +899,7 @@ def script_main(script_name, download, download_playlist = None):
sys.exit(1) sys.exit(1)
def url_to_module(url): def url_to_module(url):
from .extractors import netease, w56, acfun, baidu, baomihua, bilibili, blip, catfun, cntv, cbs, coursera, dailymotion, dongting, douban, douyutv, ehow, facebook, freesound, google, sina, ifeng, alive, instagram, iqiyi, joy, jpopsuki, khan, ku6, kugou, kuwo, letv, magisto, miomio, mixcloud, mtv81, nicovideo, pptv, qq, sohu, songtaste, soundcloud, ted, theplatform, tudou, tucao, tumblr, vid48, videobam, vimeo, vine, vk, xiami, yinyuetai, youku, youtube from .extractors import netease, w56, acfun, baidu, baomihua, bilibili, blip, catfun, cntv, cbs, coursera, dailymotion, dongting, douban, douyutv, ehow, facebook, freesound, google, sina, ifeng, alive, instagram, iqiyi, joy, jpopsuki, khan, ku6, kugou, kuwo, letv, magisto, miomio, mixcloud, mtv81, nicovideo, pptv, qq, sohu, songtaste, soundcloud, ted, theplatform, tudou, tucao, tumblr, vid48, videobam, vimeo, vine, vk, xiami, yinyuetai, youku, youtube, zhanqi
video_host = r1(r'https?://([^/]+)/', url) video_host = r1(r'https?://([^/]+)/', url)
video_url = r1(r'https?://[^/]+(.*)', url) video_url = r1(r'https?://[^/]+(.*)', url)
@ -971,6 +971,7 @@ def url_to_module(url):
'youku': youku, 'youku': youku,
'youtu': youtube, 'youtu': youtube,
'youtube': youtube, 'youtube': youtube,
'zhanqi': zhanqi,
} }
if k in downloads: if k in downloads:
return downloads[k], url return downloads[k], url

View File

@ -0,0 +1,28 @@
#!/usr/bin/env python
__all__ = ['zhanqi_download']
from ..common import *
import re
def zhanqi_download(url, output_dir = '.', merge = True, info_only = False):
html = get_content(url)
rtmp_base_patt = r'VideoUrl":"([^"]+)"'
rtmp_id_patt = r'VideoID":"([^"]+)"'
title_patt = r'<p class="title-name" title="[^"]+">([^<]+)</p>'
title_patt_backup = r'<title>([^<]{1,9999})</title>'
rtmp_base = match1(html, rtmp_base_patt).replace('\\/','/')
rtmp_id = match1(html, rtmp_id_patt).replace('\\/','/')
title = match1(html, title_patt) or match1(html, title_patt_backup)
title = unescape_html(title)
real_url = rtmp_base+'/'+rtmp_id
print_info(site_info, title, 'flv', float('inf'))
if not info_only:
download_rtmp_url(real_url, title, 'flv', {}, output_dir, merge = merge)
site_info = "zhanqi.tv"
download = zhanqi_download
download_playlist = playlist_not_supported('zhanqi')