From bb2e54f7fc2bba66e300a006b7bbe097f41ff07a Mon Sep 17 00:00:00 2001 From: dreammu <84692291+dreammu@users.noreply.github.com> Date: Thu, 3 Apr 2025 11:07:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dstreamlink=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E5=99=A8header=E5=8F=82=E6=95=B0=20(#1218)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 修复streamlink下载器header参数 * Update __init__.py --------- Co-authored-by: ForgQi <34411314+ForgQi@users.noreply.github.com> --- biliup/__init__.py | 2 +- biliup/engine/download.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/biliup/__init__.py b/biliup/__init__.py index cc40c13..a9bc09d 100644 --- a/biliup/__init__.py +++ b/biliup/__init__.py @@ -2,7 +2,7 @@ import logging import platform import sys -__version__ = "0.4.90" +__version__ = "0.4.91" LOG_CONF = { 'version': 1, diff --git a/biliup/engine/download.py b/biliup/engine/download.py index 2b46ebf..6337d5d 100644 --- a/biliup/engine/download.py +++ b/biliup/engine/download.py @@ -221,13 +221,15 @@ class DownloadBase(ABC): streamlink_cmd = [ 'streamlink', '--stream-segment-threads', '3', - '--hls-playlist-reload-attempts', '1', - '--http-header', - ';'.join([f'{key}={value}' for key, value in self.fake_headers.items()]), + '--hls-playlist-reload-attempts', '1' + ] + for key, value in self.fake_headers.items(): + streamlink_cmd.extend(['--http-header', f'{key}={value}']) + streamlink_cmd.extend([ self.raw_stream_url, 'best', '-O' - ] + ]) streamlink_proc = subprocess.Popen(streamlink_cmd, stdout=subprocess.PIPE) input_uri = 'pipe:0' else: