mirror of
https://github.com/soimort/you-get.git
synced 2025-02-10 20:22:27 +03:00
Merge remote-tracking branch 'upstream/master' into upstream
This commit is contained in:
commit
7583940018
@ -1,6 +1,15 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
0.3.4
|
||||
-----
|
||||
|
||||
*Date: 2013-03-08*
|
||||
|
||||
* Add support for:
|
||||
- Blip
|
||||
- VID48
|
||||
|
||||
0.3.3
|
||||
-----
|
||||
|
||||
|
@ -12,6 +12,7 @@ Fork me on GitHub: <https://github.com/soimort/you-get>
|
||||
|
||||
* YouTube <http://www.youtube.com>
|
||||
* Vimeo <http://vimeo.com>
|
||||
* Blip <http://blip.tv>
|
||||
* Dailymotion <http://dailymotion.com>
|
||||
* Facebook <http://facebook.com>
|
||||
* Google+ <http://plus.google.com>
|
||||
@ -19,6 +20,7 @@ Fork me on GitHub: <https://github.com/soimort/you-get>
|
||||
* SoundCloud <http://soundcloud.com>
|
||||
* Mixcloud <http://www.mixcloud.com>
|
||||
* JPopsuki <http://jpopsuki.tv>
|
||||
* VID48 <http://vid48.com>
|
||||
* Niconico (ニコニコ動画) <http://www.nicovideo.jp>
|
||||
* Youku (优酷) <http://www.youku.com>
|
||||
* Tudou (土豆) <http://www.tudou.com>
|
||||
@ -234,6 +236,7 @@ You-Get基于优酷下载脚本[iambus/youku-lixian](https://github.com/iambus/y
|
||||
|
||||
* YouTube <http://www.youtube.com>
|
||||
* Vimeo <http://vimeo.com>
|
||||
* Blip <http://blip.tv>
|
||||
* Dailymotion <http://dailymotion.com>
|
||||
* Facebook <http://facebook.com>
|
||||
* Google+ <http://plus.google.com>
|
||||
@ -241,6 +244,7 @@ You-Get基于优酷下载脚本[iambus/youku-lixian](https://github.com/iambus/y
|
||||
* SoundCloud <http://soundcloud.com>
|
||||
* Mixcloud <http://www.mixcloud.com>
|
||||
* JPopsuki <http://jpopsuki.tv>
|
||||
* VID48 <http://vid48.com>
|
||||
* NICONICO动画 <http://www.nicovideo.jp>
|
||||
* 优酷 <http://www.youku.com>
|
||||
* 土豆 <http://www.tudou.com>
|
||||
|
@ -15,6 +15,7 @@ Supported Sites (As of Now)
|
||||
|
||||
* YouTube http://www.youtube.com
|
||||
* Vimeo http://vimeo.com
|
||||
* Blip http://blip.tv
|
||||
* Dailymotion http://dailymotion.com
|
||||
* Facebook http://facebook.com
|
||||
* Google+ http://plus.google.com
|
||||
@ -22,6 +23,7 @@ Supported Sites (As of Now)
|
||||
* SoundCloud http://soundcloud.com
|
||||
* Mixcloud http://www.mixcloud.com
|
||||
* JPopsuki http://jpopsuki.tv
|
||||
* VID48 http://vid48.com
|
||||
* Niconico (ニコニコ動画) http://www.nicovideo.jp
|
||||
* Youku (优酷) http://www.youku.com
|
||||
* Tudou (土豆) http://www.tudou.com
|
||||
|
@ -22,6 +22,7 @@ def url_to_module(url):
|
||||
'56': w56,
|
||||
'acfun': acfun,
|
||||
'bilibili': bilibili,
|
||||
'blip': blip,
|
||||
'cntv': cntv,
|
||||
'dailymotion': dailymotion,
|
||||
'douban': douban,
|
||||
@ -45,6 +46,7 @@ def url_to_module(url):
|
||||
'soundcloud': soundcloud,
|
||||
'tudou': tudou,
|
||||
'tumblr': tumblr,
|
||||
'vid48': vid48,
|
||||
'vimeo': vimeo,
|
||||
'xiami': xiami,
|
||||
'yinyuetai': yinyuetai,
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
from .acfun import *
|
||||
from .bilibili import *
|
||||
from .blip import *
|
||||
from .cntv import *
|
||||
from .dailymotion import *
|
||||
from .douban import *
|
||||
@ -23,6 +24,7 @@ from .sohu import *
|
||||
from .soundcloud import *
|
||||
from .tudou import *
|
||||
from .tumblr import *
|
||||
from .vid48 import *
|
||||
from .vimeo import *
|
||||
from .w56 import *
|
||||
from .xiami import *
|
||||
|
@ -59,6 +59,8 @@ def bilibili_download_by_cid(id, title, output_dir = '.', merge = True, info_onl
|
||||
|
||||
if re.search(r'\.(flv|hlv)\b', urls[0]):
|
||||
type = 'flv'
|
||||
elif re.search(r'/flv/', urls[0]):
|
||||
type = 'flv'
|
||||
elif re.search(r'/mp4/', urls[0]):
|
||||
type = 'mp4'
|
||||
else:
|
||||
|
24
src/you_get/downloader/blip.py
Normal file
24
src/you_get/downloader/blip.py
Normal file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__all__ = ['blip_download']
|
||||
|
||||
from ..common import *
|
||||
|
||||
import json
|
||||
|
||||
def blip_download(url, output_dir = '.', merge = True, info_only = False):
|
||||
p_url = url + "?skin=json&version=2&no_wrap=1"
|
||||
html = get_html(p_url)
|
||||
metadata = json.loads(html)
|
||||
|
||||
title = metadata['Post']['title']
|
||||
real_url = metadata['Post']['media']['url']
|
||||
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 = "Blip.tv"
|
||||
download = blip_download
|
||||
download_playlist = playlist_not_supported('blip')
|
@ -13,7 +13,7 @@ def googleplus_download(url, output_dir = '.', merge = True, info_only = False):
|
||||
html = get_html(url)
|
||||
html = parse.unquote(html).replace('\/', '/')
|
||||
|
||||
title = r1(r'<meta property="og:title" content="([^"]*)"', html) or r1(r'<title>(.*)</title>', html) or r1(r'<title>(.*)\n', html)
|
||||
title = r1(r'<title>(.*)</title>', html) or r1(r'<title>(.*)\n', html) or r1(r'<meta property="og:title" content="([^"]*)"', html)
|
||||
|
||||
url2 = r1(r'<a href="([^"]+)" target="_blank" class="Mn" >', html)
|
||||
if url2:
|
||||
|
@ -17,7 +17,17 @@ def qq_download(url, output_dir = '.', merge = True, info_only = False):
|
||||
if re.match(r'http://v.qq.com/([^\?]+)\?vid', url):
|
||||
aid = r1(r'(.*)\.html', url)
|
||||
vid = r1(r'http://v.qq.com/[^\?]+\?vid=(\w+)', url)
|
||||
url = aid + ".html?vid=" + vid
|
||||
url = "%s/%s.html" % (aid, vid)
|
||||
|
||||
if re.match(r'http://y.qq.com/([^\?]+)\?vid', url):
|
||||
vid = r1(r'http://y.qq.com/[^\?]+\?vid=(\w+)', url)
|
||||
|
||||
url = "http://v.qq.com/page/%s.html" % vid
|
||||
|
||||
r_url = r1(r'<meta http-equiv="refresh" content="0;url=([^"]*)', get_html(url))
|
||||
if r_url:
|
||||
aid = r1(r'(.*)\.html', r_url)
|
||||
url = "%s/%s.html" % (aid, vid)
|
||||
|
||||
html = get_html(url)
|
||||
|
||||
|
23
src/you_get/downloader/vid48.py
Normal file
23
src/you_get/downloader/vid48.py
Normal file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__all__ = ['vid48_download']
|
||||
|
||||
from ..common import *
|
||||
|
||||
def vid48_download(url, output_dir = '.', merge = True, info_only = False):
|
||||
vid = r1(r'v=([^&]*)', url)
|
||||
p_url = "http://vid48.com/embed_player.php?vid=%s&autoplay=yes" % vid
|
||||
|
||||
html = get_html(p_url)
|
||||
|
||||
title = r1(r'<title>(.*)</title>', html)
|
||||
url = "http://vid48.com%s" % r1(r'file: "([^"]*)"', html)
|
||||
type, ext, size = url_info(url)
|
||||
|
||||
print_info(site_info, title, type, size)
|
||||
if not info_only:
|
||||
download_urls([url], title, ext, size, output_dir, merge = merge)
|
||||
|
||||
site_info = "VID48"
|
||||
download = vid48_download
|
||||
download_playlist = playlist_not_supported('vid48')
|
@ -194,8 +194,11 @@ def youku_download_playlist(url, output_dir = '.', merge = True, info_only = Fal
|
||||
output_dir = os.path.join(output_dir, title)
|
||||
|
||||
for i, id in enumerate(ids):
|
||||
print('Processing %s of %s videos...' % (i + 1, len(ids)))
|
||||
youku_download(id, output_dir, merge = merge, info_only = info_only)
|
||||
try:
|
||||
print('Processing %s of %s videos...' % (i + 1, len(ids)))
|
||||
youku_download(id, output_dir, merge = merge, info_only = info_only)
|
||||
except:
|
||||
continue
|
||||
|
||||
site_info = "Youku.com"
|
||||
download = youku_download
|
||||
|
@ -2,5 +2,5 @@
|
||||
|
||||
__all__ = ['__version__', '__date__']
|
||||
|
||||
__version__ = '0.3.3'
|
||||
__date__ = '2013-03-01'
|
||||
__version__ = '0.3.4'
|
||||
__date__ = '2013-03-08'
|
||||
|
@ -12,9 +12,9 @@ def test_urls(urls):
|
||||
|
||||
class YouGetTests(unittest.TestCase):
|
||||
|
||||
def test_douban(self):
|
||||
def test_blip(self):
|
||||
test_urls([
|
||||
"http://site.douban.com/caofang/",
|
||||
"http://blip.tv/clojure/sam-aaron-programming-music-with-overtone-5970273",
|
||||
])
|
||||
|
||||
def test_googleplus(self):
|
||||
@ -39,6 +39,11 @@ class YouGetTests(unittest.TestCase):
|
||||
"http://www.mixcloud.com/DJVadim/north-america-are-you-ready/",
|
||||
])
|
||||
|
||||
def test_vid48(self):
|
||||
test_urls([
|
||||
"http://vid48.com/watch_video.php?v=KXUSG8169U41",
|
||||
])
|
||||
|
||||
def test_vimeo(self):
|
||||
test_urls([
|
||||
"http://vimeo.com/56810854",
|
||||
|
Loading…
Reference in New Issue
Block a user