From 2fa4f474c3facd2b2901842a28cf04e0b0ca592d Mon Sep 17 00:00:00 2001 From: projectdx Date: Thu, 8 Jan 2026 20:00:34 +0900 Subject: [PATCH] fix: Improve progress display for aria2c downloads - Add --progress-template with GDM_PROGRESS format - Add aria2c --summary-interval for status updates - Parse GDM_PROGRESS pattern for progress callback --- downloader/ytdlp_aria2.py | 24 +++++++++++++++++++++++- info.yaml | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/downloader/ytdlp_aria2.py b/downloader/ytdlp_aria2.py index 60e2a9b..095b121 100644 --- a/downloader/ytdlp_aria2.py +++ b/downloader/ytdlp_aria2.py @@ -64,9 +64,13 @@ class YtdlpAria2Downloader(BaseDownloader): if self._check_aria2c(aria2c_path): cmd.extend(['--external-downloader', aria2c_path]) - cmd.extend(['--external-downloader-args', f'aria2c:-x{connections} -s{connections} -j{connections} -k1M']) + # aria2c 설정: -x=연결수, -s=분할수, -j=병렬, -k=조각크기, --console-log-level=notice로 진행률 출력 + cmd.extend(['--external-downloader-args', f'aria2c:-x{connections} -s{connections} -j{connections} -k1M --summary-interval=1 --console-log-level=notice']) logger.info(f'[GDM] Using aria2c for multi-threaded download (connections: {connections})') + # 진행률 템플릿 추가 (yt-dlp native downloader) + cmd.extend(['--progress-template', 'download:GDM_PROGRESS:%(progress._percent_str)s:%(progress._speed_str)s:%(progress._eta_str)s']) + # 속도 제한 설정 max_rate = P.ModelSetting.get('max_download_rate') if max_rate == '0': @@ -192,6 +196,24 @@ class YtdlpAria2Downloader(BaseDownloader): except: pass + # 진행률 파싱 - GDM_PROGRESS 템플릿 (우선) + # 형식: GDM_PROGRESS:XX.X%:SPEED:ETA + if 'GDM_PROGRESS:' in line: + try: + parts = line.split('GDM_PROGRESS:', 1)[1].split(':') + if len(parts) >= 1: + pct_str = parts[0].strip().replace('%', '').strip() + progress = int(float(pct_str)) if pct_str and pct_str != 'N/A' else 0 + speed = parts[1].strip() if len(parts) > 1 else '' + eta = parts[2].strip() if len(parts) > 2 else '' + if speed == 'N/A': speed = '' + if eta == 'N/A': eta = '' + if progress_callback and progress > 0: + progress_callback(progress, speed, eta) + continue + except: + pass + # 진행률 파싱 (yt-dlp default) progress_match = re.search(r'\[download\]\s+(\d+\.?\d*)%', line) diff --git a/info.yaml b/info.yaml index 8da289c..1ad6cea 100644 --- a/info.yaml +++ b/info.yaml @@ -1,6 +1,6 @@ title: "GDM" package_name: gommi_downloader_manager -version: '0.2.20' +version: '0.2.21' description: FlaskFarm 범용 다운로더 큐 - YouTube, 애니24, 링크애니, Anilife 지원 developer: projectdx home: https://gitea.yommi.duckdns.org/projectdx/gommi_downloader_manager