add support for Tumblr (fix #44)

This commit is contained in:
Mort Yao 2012-12-18 17:26:35 +01:00
parent a681458860
commit cf721b0c61
7 changed files with 39 additions and 2 deletions

View File

@ -1,6 +1,14 @@
Changelog
=========
0.3dev-20121219
---------------
*Date: 2012-12-19*
* Add support for:
- Tumblr
0.3dev-20121217
---------------

View File

@ -14,6 +14,7 @@ Fork me on GitHub: <https://github.com/soimort/you-get>
* Vimeo <http://vimeo.com>
* Dailymotion <http://dailymotion.com>
* Google+ <http://plus.google.com>
* Tumblr <http://www.tumblr.com>
* SoundCloud <http://soundcloud.com>
* Youku (优酷) <http://www.youku.com>
* Tudou (土豆) <http://www.tudou.com>
@ -203,6 +204,7 @@ You-Get基于优酷下载脚本[iambus/youku-lixian](https://github.com/iambus/y
* Vimeo <http://vimeo.com>
* Dailymotion <http://dailymotion.com>
* Google+ <http://plus.google.com>
* Tumblr <http://www.tumblr.com>
* SoundCloud <http://soundcloud.com>
* 优酷 <http://www.youku.com>
* 土豆 <http://www.tudou.com>

View File

@ -17,6 +17,7 @@ Supported Sites (As of Now)
* Vimeo http://vimeo.com
* Dailymotion http://dailymotion.com
* Google+ http://plus.google.com
* Tumblr http://www.tumblr.com
* SoundCloud http://soundcloud.com
* Youku (优酷) http://www.youku.com
* Tudou (土豆) http://www.tudou.com

View File

@ -14,6 +14,7 @@ from .sina import *
from .sohu import *
from .soundcloud import *
from .tudou import *
from .tumblr import *
from .vimeo import *
from .w56 import *
from .yinyuetai import *

View File

@ -0,0 +1,24 @@
#!/usr/bin/env python
__all__ = ['tumblr_download']
from ..common import *
import re
def tumblr_download(url, output_dir = '.', merge = True, info_only = False):
html = get_html(url)
html = parse.unquote(html).replace('\/', '/')
title = r1(r'<title>(.*)</title>', html) or r1(r'<title>(.*)\n', html)
real_url = r1(r'source src=\\x22([^\\]+)\\', html)
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 = "Tumblr.com"
download = tumblr_download
download_playlist = playlist_not_supported('tumblr')

View File

@ -36,6 +36,7 @@ def url_to_module(url):
'sohu': sohu,
'soundcloud': soundcloud,
'tudou': tudou,
'tumblr': tumblr,
'vimeo': vimeo,
'yinyuetai': yinyuetai,
'youku': youku,

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
__version__ = '0.3dev-20121217'
__date__ = '2012-12-17'
__version__ = '0.3dev-20121219'
__date__ = '2012-12-19'