Add Interest.me (CJ E&M) support

This commit is contained in:
cnbeining 2015-10-22 14:56:07 -04:00
parent d80a799569
commit b0128fd879
4 changed files with 35 additions and 0 deletions

View File

@ -50,6 +50,7 @@ Fork me on GitHub: <https://github.com/soimort/you-get>
* Fun.tv (风行, Funshion) <http://www.fun.tv>
* Google Drive <http://docs.google.com>
* ifeng (凤凰视频) <http://v.ifeng.com>
* Interest.me (CJ E&M) <http://interest.me>
* Internet Archive <http://archive.org>
* iQIYI (爱奇艺) <http://www.iqiyi.com>
* iQilu (齐鲁网, 山东网络台) <http://v.iqilu.com>

View File

@ -26,6 +26,7 @@ SITES = {
'ifeng' : 'ifeng',
'in' : 'alive',
'instagram' : 'instagram',
'interest' : 'interest',
'iqilu' : 'iqilu',
'iqiyi' : 'iqiyi',
'isuntv' : 'suntv',

View File

@ -20,6 +20,7 @@ from .google import *
from .heavymusic import *
from .ifeng import *
from .instagram import *
from .interest import *
from .iqilu import *
from .iqiyi import *
from .joy import *

View File

@ -0,0 +1,32 @@
#!/usr/bin/env python
from ..common import *
from json import loads
def interest_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
#http://ch.interest.me/zhtv/VOD/View/114789
#http://program.interest.me/zhtv/sonja/8/Vod/View/15794
html = get_content(url)
#get title
title = match1(html, r'<meta property="og:title" content="([^"]*)"')
title = title.split('&')[0].strip()
info_url = match1(html, r'data: "(.+)",')
play_info = loads(get_content(info_url))
try:
serverurl = play_info['data']['cdn']['serverurl']
except KeyError:
raise ValueError('Cannot_Get_Play_URL')
except:
raise ValueError('Cannot_Get_Play_URL')
# I cannot find any example of "fileurl", so i just put it like this for now
assert serverurl
type, ext, size = 'mp4', 'mp4', 0
print_info(site_info, title, type, size)
if not info_only:
download_rtmp_url(url=serverurl, title=title, ext=ext, output_dir=output_dir)
site_info = "interest.me"
download = interest_download
download_playlist = playlist_not_supported('interest')