mirror of
https://github.com/soimort/you-get.git
synced 2025-02-02 16:24:00 +03:00
add support for V.QQ.com, fix #31
This commit is contained in:
parent
1f8272f3e2
commit
22114e1721
@ -9,6 +9,7 @@ from .ifeng import *
|
|||||||
from .iqiyi import *
|
from .iqiyi import *
|
||||||
from .ku6 import *
|
from .ku6 import *
|
||||||
from .pptv import *
|
from .pptv import *
|
||||||
|
from .qq import *
|
||||||
from .sina import *
|
from .sina import *
|
||||||
from .sohu import *
|
from .sohu import *
|
||||||
from .tudou import *
|
from .tudou import *
|
||||||
|
@ -4,6 +4,7 @@ __all__ = ['acfun_download']
|
|||||||
|
|
||||||
from ..common import *
|
from ..common import *
|
||||||
|
|
||||||
|
from .qq import qq_download_by_id
|
||||||
from .sina import sina_download_by_id
|
from .sina import sina_download_by_id
|
||||||
from .tudou import tudou_download_by_iid
|
from .tudou import tudou_download_by_iid
|
||||||
from .youku import youku_download_by_id
|
from .youku import youku_download_by_id
|
||||||
@ -14,15 +15,6 @@ def get_srt_json(id):
|
|||||||
url = 'http://comment.acfun.tv/%s.json' % id
|
url = 'http://comment.acfun.tv/%s.json' % id
|
||||||
return get_html(url)
|
return get_html(url)
|
||||||
|
|
||||||
def qq_download_by_id(id, title = None, output_dir = '.', merge = True, info_only = False):
|
|
||||||
url = 'http://vsrc.store.qq.com/%s.flv' % id
|
|
||||||
assert title
|
|
||||||
_, _, size = url_info(url)
|
|
||||||
|
|
||||||
print_info(site_info, title, 'flv', size)
|
|
||||||
if not info_only:
|
|
||||||
download_urls([url], title, 'flv', size, output_dir = output_dir, merge = merge)
|
|
||||||
|
|
||||||
def acfun_download_by_id(id, title = None, output_dir = '.', merge = True, info_only = False):
|
def acfun_download_by_id(id, title = None, output_dir = '.', merge = True, info_only = False):
|
||||||
info = json.loads(get_html('http://www.acfun.tv/api/getVideoByID.aspx?vid=' + id))
|
info = json.loads(get_html('http://www.acfun.tv/api/getVideoByID.aspx?vid=' + id))
|
||||||
t = info['vtype']
|
t = info['vtype']
|
||||||
|
35
you_get/downloader/qq.py
Normal file
35
you_get/downloader/qq.py
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__all__ = ['qq_download']
|
||||||
|
|
||||||
|
from ..common import *
|
||||||
|
|
||||||
|
def qq_download_by_id(id, title = None, output_dir = '.', merge = True, info_only = False):
|
||||||
|
url = 'http://vsrc.store.qq.com/%s.flv' % id
|
||||||
|
|
||||||
|
_, _, size = url_info(url)
|
||||||
|
|
||||||
|
print_info(site_info, title, 'flv', size)
|
||||||
|
if not info_only:
|
||||||
|
download_urls([url], title, 'flv', size, output_dir = output_dir, merge = merge)
|
||||||
|
|
||||||
|
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 + "/" + vid + ".html"
|
||||||
|
|
||||||
|
html = get_html(url)
|
||||||
|
|
||||||
|
title = r1(r'title:"([^"]+)"', html)
|
||||||
|
assert title
|
||||||
|
title = unescape_html(title)
|
||||||
|
title = escape_file_path(title)
|
||||||
|
|
||||||
|
id = r1(r'vid:"([^"]+)"', html)
|
||||||
|
|
||||||
|
qq_download_by_id(id, title, output_dir = output_dir, merge = merge, info_only = info_only)
|
||||||
|
|
||||||
|
site_info = "V.QQ.com"
|
||||||
|
download = qq_download
|
||||||
|
download_playlist = playlist_not_supported('qq')
|
@ -30,6 +30,7 @@ def url_to_module(url):
|
|||||||
'kankanews': bilibili,
|
'kankanews': bilibili,
|
||||||
'ku6': ku6,
|
'ku6': ku6,
|
||||||
'pptv': pptv,
|
'pptv': pptv,
|
||||||
|
'qq': qq,
|
||||||
'sina': sina,
|
'sina': sina,
|
||||||
'sohu': sohu,
|
'sohu': sohu,
|
||||||
'tudou': tudou,
|
'tudou': tudou,
|
||||||
|
Loading…
Reference in New Issue
Block a user