From 585d496e16881115d5af443cb6d60a293f9905e0 Mon Sep 17 00:00:00 2001 From: doskey Date: Tue, 10 Sep 2024 00:13:51 +0800 Subject: [PATCH] Fix: Restore functionality of -o parameter for Miaopai downloads The -o parameter, used for specifying output filename, was not functioning correctly when downloading videos from Miaopai. This commit addresses the issue and ensures the parameter works as intended. --- src/you_get/extractors/miaopai.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/you_get/extractors/miaopai.py b/src/you_get/extractors/miaopai.py index 91a301b8..63c8685c 100644 --- a/src/you_get/extractors/miaopai.py +++ b/src/you_get/extractors/miaopai.py @@ -37,7 +37,7 @@ def miaopai_download_by_fid(fid, output_dir = '.', merge = False, info_only = Fa download_urls([url], title, ext, total_size=None, output_dir=output_dir, merge=merge) -def miaopai_download_by_wbmp(wbmp_url, fid, info_only=False, **kwargs): +def miaopai_download_by_wbmp(wbmp_url, fid, output_dir='.', merge=False, info_only=False, **kwargs): headers = {} headers.update(fake_headers_mobile) headers['Host'] = 'imgaliyuncdn.miaopai.com' @@ -62,7 +62,7 @@ def miaopai_download_by_wbmp(wbmp_url, fid, info_only=False, **kwargs): headers['Host'] = 'f.us.sinaimg.cn' print_info(site_info, title, ext, url_info(video_url, headers=headers)[2]) if not info_only: - download_urls([video_url], fs.legitimize(title), ext, headers=headers, **kwargs) + download_urls([video_url], fs.legitimize(title), ext, output_dir=output_dir, headers=headers, **kwargs) def miaopai_download_story(url, output_dir='.', merge=False, info_only=False, **kwargs): @@ -75,7 +75,7 @@ def miaopai_download_story(url, output_dir='.', merge=False, info_only=False, ** ext = 'mp4' print_info(site_info, title, ext, url_info(stream_url, headers=fake_headers_mobile)[2]) if not info_only: - download_urls([stream_url], fs.legitimize(title), ext, total_size=None, headers=fake_headers_mobile, **kwargs) + download_urls([stream_url], fs.legitimize(title), ext, total_size=None, output_dir=output_dir, headers=fake_headers_mobile, **kwargs) def miaopai_download_h5api(url, output_dir='.', merge=False, info_only=False, **kwargs): @@ -122,7 +122,7 @@ def miaopai_download_h5api(url, output_dir='.', merge=False, info_only=False, ** print_info(site_info, title, ext, size) if not info_only: - download_urls([video_url], fs.legitimize(title), ext, total_size=size, headers=headers, **kwargs) + download_urls([video_url], fs.legitimize(title), ext, total_size=size, output_dir=output_dir, headers=headers, **kwargs) def miaopai_download_direct(url, output_dir='.', merge=False, info_only=False, **kwargs): @@ -141,7 +141,7 @@ def miaopai_download_direct(url, output_dir='.', merge=False, info_only=False, * ext = 'mp4' print_info(site_info, title, ext, url_info(stream_url, headers=fake_headers_mobile)[2]) if not info_only: - download_urls([stream_url], fs.legitimize(title), ext, total_size=None, headers=fake_headers_mobile, **kwargs) + download_urls([stream_url], fs.legitimize(title), ext, total_size=None, output_dir=output_dir, headers=fake_headers_mobile, **kwargs) def miaopai_download(url, output_dir='.', merge=False, info_only=False, **kwargs):