mirror of
https://github.com/soimort/you-get.git
synced 2025-02-12 04:55:21 +03:00
update the rule of download url
This commit is contained in:
commit
1fe683cbf5
@ -1160,6 +1160,7 @@ def script_main(script_name, download, download_playlist, **kwargs):
|
|||||||
output_dir = a
|
output_dir = a
|
||||||
elif o in ('-p', '--player'):
|
elif o in ('-p', '--player'):
|
||||||
player = a
|
player = a
|
||||||
|
caption = False
|
||||||
elif o in ('-x', '--http-proxy'):
|
elif o in ('-x', '--http-proxy'):
|
||||||
proxy = a
|
proxy = a
|
||||||
elif o in ('-y', '--extractor-proxy'):
|
elif o in ('-y', '--extractor-proxy'):
|
||||||
|
@ -5,13 +5,13 @@ __all__ = ['qq_download']
|
|||||||
from ..common import *
|
from ..common import *
|
||||||
|
|
||||||
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&vid=%s" % vid
|
api = "http://h5vv.video.qq.com/getinfo?platform=11001&otype=json&vid=%s" % vid
|
||||||
content = get_html(api)
|
content = get_html(api)
|
||||||
output_json = json.loads(match1(content, r'QZOutputJson=(.*)')[:-1])
|
output_json = json.loads(match1(content, r'QZOutputJson=(.*)')[:-1])
|
||||||
url = output_json['vl']['vi'][0]['ul']['ui'][0]['url']
|
url = output_json['vl']['vi'][0]['ul']['ui'][0]['url']
|
||||||
fvkey = output_json['vl']['vi'][0]['fvkey']
|
fvkey = output_json['vl']['vi'][0]['fvkey']
|
||||||
lnk = output_json['vl']['vi'][0]['lnk']
|
fn = output_json['vl']['vi'][0]['fn']
|
||||||
url = '%s/%s.mp4?vkey=%s' % ( url, lnk, fvkey )
|
url = '%s/%s?vkey=%s' % ( url, fn, fvkey )
|
||||||
_, ext, size = url_info(url, faker=True)
|
_, ext, size = url_info(url, faker=True)
|
||||||
|
|
||||||
print_info(site_info, title, ext, size)
|
print_info(site_info, title, ext, size)
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import os.path
|
import os.path
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from ..util.strings import parameterize
|
||||||
|
|
||||||
def get_usable_ffmpeg(cmd):
|
def get_usable_ffmpeg(cmd):
|
||||||
try:
|
try:
|
||||||
@ -53,7 +54,7 @@ def ffmpeg_concat_mp4_to_mpg(files, output='output.mpg'):
|
|||||||
concat_list = open(output + '.txt', 'w', encoding="utf-8")
|
concat_list = open(output + '.txt', 'w', encoding="utf-8")
|
||||||
for file in files:
|
for file in files:
|
||||||
if os.path.isfile(file):
|
if os.path.isfile(file):
|
||||||
concat_list.write("file '%s'\n" % file)
|
concat_list.write("file %s\n" % parameterize(file))
|
||||||
concat_list.close()
|
concat_list.close()
|
||||||
|
|
||||||
params = [FFMPEG] + LOGLEVEL
|
params = [FFMPEG] + LOGLEVEL
|
||||||
@ -118,7 +119,7 @@ def ffmpeg_concat_flv_to_mp4(files, output='output.mp4'):
|
|||||||
if os.path.isfile(file):
|
if os.path.isfile(file):
|
||||||
# for escaping rules, see:
|
# for escaping rules, see:
|
||||||
# https://www.ffmpeg.org/ffmpeg-utils.html#Quoting-and-escaping
|
# https://www.ffmpeg.org/ffmpeg-utils.html#Quoting-and-escaping
|
||||||
concat_list.write("file '%s'\n" % file.replace("'", r"'\''"))
|
concat_list.write("file %s\n" % parameterize(file))
|
||||||
concat_list.close()
|
concat_list.close()
|
||||||
|
|
||||||
params = [FFMPEG] + LOGLEVEL + ['-f', 'concat', '-y', '-i']
|
params = [FFMPEG] + LOGLEVEL + ['-f', 'concat', '-y', '-i']
|
||||||
@ -163,7 +164,7 @@ def ffmpeg_concat_mp4_to_mp4(files, output='output.mp4'):
|
|||||||
concat_list = open(output + '.txt', 'w', encoding="utf-8")
|
concat_list = open(output + '.txt', 'w', encoding="utf-8")
|
||||||
for file in files:
|
for file in files:
|
||||||
if os.path.isfile(file):
|
if os.path.isfile(file):
|
||||||
concat_list.write("file '%s'\n" % file)
|
concat_list.write("file %s\n" % parameterize(file))
|
||||||
concat_list.close()
|
concat_list.close()
|
||||||
|
|
||||||
params = [FFMPEG] + LOGLEVEL + ['-f', 'concat', '-y', '-i']
|
params = [FFMPEG] + LOGLEVEL + ['-f', 'concat', '-y', '-i']
|
||||||
|
@ -23,3 +23,6 @@ from .fs import legitimize
|
|||||||
|
|
||||||
def get_filename(htmlstring):
|
def get_filename(htmlstring):
|
||||||
return legitimize(unescape_html(htmlstring))
|
return legitimize(unescape_html(htmlstring))
|
||||||
|
|
||||||
|
def parameterize(string):
|
||||||
|
return "'%s'" % string.replace("'", r"'\''")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
script_name = 'you-get'
|
script_name = 'you-get'
|
||||||
__version__ = '0.4.350'
|
__version__ = '0.4.365'
|
||||||
|
Loading…
Reference in New Issue
Block a user