mirror of
https://github.com/soimort/you-get.git
synced 2025-02-03 08:43:58 +03:00
add support for Xtube
This commit is contained in:
parent
ee3d248afb
commit
00f27681ca
@ -15,6 +15,7 @@ Fork me on GitHub: <https://github.com/soimort/you-get>
|
|||||||
* Dailymotion <http://dailymotion.com>
|
* Dailymotion <http://dailymotion.com>
|
||||||
* Google+ <http://plus.google.com>
|
* Google+ <http://plus.google.com>
|
||||||
* Tumblr <http://www.tumblr.com>
|
* Tumblr <http://www.tumblr.com>
|
||||||
|
* Xtube <http://www.xtube.com>
|
||||||
* SoundCloud <http://soundcloud.com>
|
* SoundCloud <http://soundcloud.com>
|
||||||
* Youku (优酷) <http://www.youku.com>
|
* Youku (优酷) <http://www.youku.com>
|
||||||
* Tudou (土豆) <http://www.tudou.com>
|
* Tudou (土豆) <http://www.tudou.com>
|
||||||
@ -205,6 +206,7 @@ You-Get基于优酷下载脚本[iambus/youku-lixian](https://github.com/iambus/y
|
|||||||
* Dailymotion <http://dailymotion.com>
|
* Dailymotion <http://dailymotion.com>
|
||||||
* Google+ <http://plus.google.com>
|
* Google+ <http://plus.google.com>
|
||||||
* Tumblr <http://www.tumblr.com>
|
* Tumblr <http://www.tumblr.com>
|
||||||
|
* Xtube <http://www.xtube.com>
|
||||||
* SoundCloud <http://soundcloud.com>
|
* SoundCloud <http://soundcloud.com>
|
||||||
* 优酷 <http://www.youku.com>
|
* 优酷 <http://www.youku.com>
|
||||||
* 土豆 <http://www.tudou.com>
|
* 土豆 <http://www.tudou.com>
|
||||||
|
@ -18,6 +18,7 @@ Supported Sites (As of Now)
|
|||||||
* Dailymotion http://dailymotion.com
|
* Dailymotion http://dailymotion.com
|
||||||
* Google+ http://plus.google.com
|
* Google+ http://plus.google.com
|
||||||
* Tumblr http://www.tumblr.com
|
* Tumblr http://www.tumblr.com
|
||||||
|
* Xtube http://www.xtube.com
|
||||||
* SoundCloud http://soundcloud.com
|
* SoundCloud http://soundcloud.com
|
||||||
* Youku (优酷) http://www.youku.com
|
* Youku (优酷) http://www.youku.com
|
||||||
* Tudou (土豆) http://www.tudou.com
|
* Tudou (土豆) http://www.tudou.com
|
||||||
|
1
you_get/downloader/__init__.py
Normal file → Executable file
1
you_get/downloader/__init__.py
Normal file → Executable file
@ -14,6 +14,7 @@ from .sina import *
|
|||||||
from .sohu import *
|
from .sohu import *
|
||||||
from .soundcloud import *
|
from .soundcloud import *
|
||||||
from .tudou import *
|
from .tudou import *
|
||||||
|
from .xtube import *
|
||||||
from .tumblr import *
|
from .tumblr import *
|
||||||
from .vimeo import *
|
from .vimeo import *
|
||||||
from .w56 import *
|
from .w56 import *
|
||||||
|
28
you_get/downloader/xtube.py
Executable file
28
you_get/downloader/xtube.py
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__all__ = ['xtube_download', 'xtube_download_by_id']
|
||||||
|
|
||||||
|
from ..common import *
|
||||||
|
|
||||||
|
import urllib
|
||||||
|
|
||||||
|
def xtube_download_by_id(id, title = None, output_dir = '.', merge = True, info_only = False):
|
||||||
|
html = get_html('http://www.xtube.com/find_video.php?video_id=%s' % id)
|
||||||
|
url = urllib.parse.unquote(r1('&filename=([a-zA-Z0-9\-\%\.\\_]+)', html))
|
||||||
|
title = "[%s] %s" % (id, title)
|
||||||
|
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)
|
||||||
|
|
||||||
|
def xtube_download(url, output_dir = '.', merge = True, info_only = False):
|
||||||
|
html = get_html(url)
|
||||||
|
title = r1(r'<title>(.*)</title>', html)
|
||||||
|
assert title
|
||||||
|
id = r1(r'http://www.xtube.com/watch.php\?v=([a-zA-Z0-9\-]+)', url)
|
||||||
|
assert id
|
||||||
|
xtube_download_by_id(id, title, output_dir = output_dir, merge = merge, info_only = info_only)
|
||||||
|
|
||||||
|
site_info = "xtube.com"
|
||||||
|
download = xtube_download
|
||||||
|
download_playlist = playlist_not_supported('xtube')
|
1
you_get/main.py
Normal file → Executable file
1
you_get/main.py
Normal file → Executable file
@ -36,6 +36,7 @@ def url_to_module(url):
|
|||||||
'sohu': sohu,
|
'sohu': sohu,
|
||||||
'soundcloud': soundcloud,
|
'soundcloud': soundcloud,
|
||||||
'tudou': tudou,
|
'tudou': tudou,
|
||||||
|
'xtube': xtube,
|
||||||
'tumblr': tumblr,
|
'tumblr': tumblr,
|
||||||
'vimeo': vimeo,
|
'vimeo': vimeo,
|
||||||
'yinyuetai': yinyuetai,
|
'yinyuetai': yinyuetai,
|
||||||
|
Loading…
Reference in New Issue
Block a user