mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 13:35:16 +03:00
add support for Joy.cn, fix #86
This commit is contained in:
parent
967457dc51
commit
11cf8e4b73
@ -25,6 +25,7 @@ Fork me on GitHub: <https://github.com/soimort/you-get>
|
||||
* CNTV (中国网络电视台) <http://www.cntv.cn>
|
||||
* ifeng (凤凰视频) <http://v.ifeng.com>
|
||||
* iQIYI (爱奇艺) <http://www.iqiyi.com>
|
||||
* Joy.cn (激动网) <http://www.joy.cn>
|
||||
* Ku6 (酷6网) <http://www.ku6.com>
|
||||
* NetEase (网易视频) <http://v.163.com>
|
||||
* PPTV <http://www.pptv.com>
|
||||
@ -218,6 +219,7 @@ You-Get基于优酷下载脚本[iambus/youku-lixian](https://github.com/iambus/y
|
||||
* CNTV <http://www.cntv.cn>
|
||||
* 凤凰视频 <http://v.ifeng.com>
|
||||
* 爱奇艺 <http://www.iqiyi.com>
|
||||
* 激动网 <http://www.joy.cn>
|
||||
* 酷6网 <http://www.ku6.com>
|
||||
* 网易视频 <http://v.163.com>
|
||||
* PPTV <http://www.pptv.com>
|
||||
|
@ -28,6 +28,7 @@ Supported Sites (As of Now)
|
||||
* CNTV (中国网络电视台) http://www.cntv.cn
|
||||
* ifeng (凤凰视频) http://v.ifeng.com
|
||||
* iQIYI (爱奇艺) http://www.iqiyi.com
|
||||
* Joy.cn (激动网) http://www.joy.cn
|
||||
* Ku6 (酷6网) http://www.ku6.com
|
||||
* NetEase (网易视频) http://v.163.com
|
||||
* PPTV http://www.pptv.com
|
||||
|
@ -8,6 +8,7 @@ from .facebook import *
|
||||
from .googleplus import *
|
||||
from .ifeng import *
|
||||
from .iqiyi import *
|
||||
from .joy import *
|
||||
from .ku6 import *
|
||||
from .netease import *
|
||||
from .pptv import *
|
||||
|
45
you_get/downloader/joy.py
Normal file
45
you_get/downloader/joy.py
Normal file
@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__all__ = ['joy_download']
|
||||
|
||||
from ..common import *
|
||||
|
||||
def video_info(channel_id, program_id, volumn_id):
|
||||
url = 'http://msx.app.joy.cn/service.php'
|
||||
if program_id:
|
||||
url += '?action=vodmsxv6'
|
||||
url += '&channelid=%s' % channel_id
|
||||
url += '&programid=%s' % program_id
|
||||
url += '&volumnid=%s' % volumn_id
|
||||
else:
|
||||
url += '?action=msxv6'
|
||||
url += '&videoid=%s' % volumn_id
|
||||
|
||||
xml = get_html(url)
|
||||
|
||||
name = r1(r'<Title>(?:<!\[CDATA\[)?(.+?)(?:\]\]>)?</Title>', xml)
|
||||
urls = re.findall(r'<Url[^>]*>(?:<!\[CDATA\[)?(.*?)(?:\]\]>)?</Url>', xml)
|
||||
hostpath = r1(r'<HostPath[^>]*>(?:<!\[CDATA\[)?(.+?)(?:\]\]>)?</HostPath>', xml)
|
||||
|
||||
return name, urls, hostpath
|
||||
|
||||
def joy_download(url, output_dir = '.', merge = True, info_only = False):
|
||||
channel_id = r1(r'[^_]channelId\s*:\s*"([^\"]+)"', get_html(url))
|
||||
program_id = r1(r'[^_]programId\s*:\s*"([^\"]+)"', get_html(url))
|
||||
volumn_id = r1(r'[^_]videoId\s*:\s*"([^\"]+)"', get_html(url))
|
||||
|
||||
title, urls, hostpath = video_info(channel_id, program_id, volumn_id)
|
||||
urls = [hostpath + url for url in urls]
|
||||
|
||||
size = 0
|
||||
for url in urls:
|
||||
_, ext, temp = url_info(url)
|
||||
size += temp
|
||||
|
||||
print_info(site_info, title, ext, size)
|
||||
if not info_only:
|
||||
download_urls(urls, title, ext, size, output_dir = output_dir, merge = merge)
|
||||
|
||||
site_info = "Joy.cn"
|
||||
download = joy_download
|
||||
download_playlist = playlist_not_supported('joy')
|
@ -29,6 +29,7 @@ def url_to_module(url):
|
||||
'iask': sina,
|
||||
'ifeng': ifeng,
|
||||
'iqiyi': iqiyi,
|
||||
'joy': joy,
|
||||
'kankanews': bilibili,
|
||||
'ku6': ku6,
|
||||
'pptv': pptv,
|
||||
|
Loading…
Reference in New Issue
Block a user