mirror of
https://github.com/soimort/you-get.git
synced 2025-03-13 03:17:44 +03:00
add support for Douban, fix #112
This commit is contained in:
parent
04fee8eb07
commit
cd1498f82d
@ -26,6 +26,7 @@ Fork me on GitHub: <https://github.com/soimort/you-get>
|
||||
* AcFun <http://www.acfun.tv>
|
||||
* bilibili <http://www.bilibili.tv>
|
||||
* CNTV (中国网络电视台) <http://www.cntv.cn>
|
||||
* Douban (豆瓣) <http://douban.com>
|
||||
* ifeng (凤凰视频) <http://v.ifeng.com>
|
||||
* iQIYI (爱奇艺) <http://www.iqiyi.com>
|
||||
* Joy.cn (激动网) <http://www.joy.cn>
|
||||
@ -203,7 +204,7 @@ You-Get基于优酷下载脚本[iambus/youku-lixian](https://github.com/iambus/y
|
||||
|
||||
### 支持的站点(截至目前)
|
||||
|
||||
已实现对以下视频站点的支持,以后会陆续增加(・∀・)
|
||||
已实现对以下站点的支持,以后会陆续增加(・∀・)
|
||||
|
||||
* YouTube <http://www.youtube.com>
|
||||
* Vimeo <http://vimeo.com>
|
||||
@ -221,6 +222,7 @@ You-Get基于优酷下载脚本[iambus/youku-lixian](https://github.com/iambus/y
|
||||
* AcFun <http://www.acfun.tv>
|
||||
* bilibili <http://www.bilibili.tv>
|
||||
* CNTV <http://www.cntv.cn>
|
||||
* 豆瓣 <http://douban.com>
|
||||
* 凤凰视频 <http://v.ifeng.com>
|
||||
* 爱奇艺 <http://www.iqiyi.com>
|
||||
* 激动网 <http://www.joy.cn>
|
||||
|
@ -29,6 +29,7 @@ Supported Sites (As of Now)
|
||||
* AcFun http://www.acfun.tv
|
||||
* bilibili http://www.bilibili.tv
|
||||
* CNTV (中国网络电视台) http://www.cntv.cn
|
||||
* Douban (豆瓣) http://douban.com
|
||||
* ifeng (凤凰视频) http://v.ifeng.com
|
||||
* iQIYI (爱奇艺) http://www.iqiyi.com
|
||||
* Joy.cn (激动网) http://www.joy.cn
|
||||
|
@ -24,6 +24,7 @@ def url_to_module(url):
|
||||
'bilibili': bilibili,
|
||||
'cntv': cntv,
|
||||
'dailymotion': dailymotion,
|
||||
'douban': douban,
|
||||
'facebook': facebook,
|
||||
'google': googleplus,
|
||||
'iask': sina,
|
||||
|
@ -4,6 +4,7 @@ from .acfun import *
|
||||
from .bilibili import *
|
||||
from .cntv import *
|
||||
from .dailymotion import *
|
||||
from .douban import *
|
||||
from .facebook import *
|
||||
from .googleplus import *
|
||||
from .ifeng import *
|
||||
|
25
src/you_get/downloader/douban.py
Normal file
25
src/you_get/downloader/douban.py
Normal file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__all__ = ['douban_download']
|
||||
|
||||
from ..common import *
|
||||
|
||||
def douban_download(url, output_dir = '.', merge = True, info_only = False):
|
||||
html = get_html(url)
|
||||
|
||||
titles = re.findall(r'"name":"([^"]*)"', html)
|
||||
real_urls = [re.sub('\\\\/', '/', i) for i in re.findall(r'"rawUrl":"([^"]*)"', html)]
|
||||
|
||||
for i in range(len(titles)):
|
||||
title = titles[i]
|
||||
real_url = real_urls[i]
|
||||
|
||||
type, ext, size = url_info(real_url)
|
||||
|
||||
print_info(site_info, title, type, size)
|
||||
if not info_only:
|
||||
download_urls([real_url], title, ext, size, output_dir, merge = merge)
|
||||
|
||||
site_info = "Douban.com"
|
||||
download = douban_download
|
||||
download_playlist = playlist_not_supported('douban')
|
@ -33,6 +33,12 @@ class YouGetTests(unittest.TestCase):
|
||||
]:
|
||||
url_to_module(url).download(url, info_only = True)
|
||||
|
||||
def test_douban(self):
|
||||
for url in [
|
||||
"http://site.douban.com/caofang/",
|
||||
]:
|
||||
url_to_module(url).download(url, info_only = True)
|
||||
|
||||
def test_xiami(self):
|
||||
for url in [
|
||||
"http://www.xiami.com/song/1769835121",
|
||||
|
Loading…
x
Reference in New Issue
Block a user