mirror of
https://github.com/soimort/you-get.git
synced 2025-02-03 08:43:58 +03:00
[QQ]Add QQ Daxue
This commit is contained in:
parent
6a8f10f9e7
commit
f8939128e6
@ -5,6 +5,7 @@ __all__ = ['qq_download']
|
|||||||
from ..common import *
|
from ..common import *
|
||||||
from .qie import download as qieDownload
|
from .qie import download as qieDownload
|
||||||
from urllib.parse import urlparse,parse_qs
|
from urllib.parse import urlparse,parse_qs
|
||||||
|
|
||||||
def qq_download_by_vid(vid, title, output_dir='.', merge=True, info_only=False):
|
def qq_download_by_vid(vid, title, output_dir='.', merge=True, info_only=False):
|
||||||
api = "http://h5vv.video.qq.com/getinfo?otype=json&platform=10901&vid=%s" % vid
|
api = "http://h5vv.video.qq.com/getinfo?otype=json&platform=10901&vid=%s" % vid
|
||||||
content = get_html(api)
|
content = get_html(api)
|
||||||
@ -23,7 +24,9 @@ def qq_download_by_vid(vid, title, output_dir='.', merge=True, info_only=False):
|
|||||||
if not info_only:
|
if not info_only:
|
||||||
download_urls([url], title, ext, size, output_dir=output_dir, merge=merge)
|
download_urls([url], title, ext, size, output_dir=output_dir, merge=merge)
|
||||||
|
|
||||||
|
|
||||||
def qq_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
|
def qq_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
|
||||||
|
""""""
|
||||||
if 'live.qq.com' in url:
|
if 'live.qq.com' in url:
|
||||||
qieDownload(url,output_dir=output_dir, merge=merge, info_only=info_only)
|
qieDownload(url,output_dir=output_dir, merge=merge, info_only=info_only)
|
||||||
return
|
return
|
||||||
@ -35,7 +38,7 @@ def qq_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
|
|||||||
content = get_html(url)
|
content = get_html(url)
|
||||||
url = match1(content,r'window\.location\.href="(.*?)"')
|
url = match1(content,r'window\.location\.href="(.*?)"')
|
||||||
|
|
||||||
if 'kuaibao.qq.com' in url:
|
if 'kuaibao.qq.com' in url or re.match(r'http://daxue.qq.com/content/content/id/\d+', url):
|
||||||
content = get_html(url)
|
content = get_html(url)
|
||||||
vid = match1(content, r'vid\s*=\s*"\s*([^"]+)"')
|
vid = match1(content, r'vid\s*=\s*"\s*([^"]+)"')
|
||||||
title = match1(content, r'title">([^"]+)</p>')
|
title = match1(content, r'title">([^"]+)</p>')
|
||||||
|
Loading…
Reference in New Issue
Block a user