From e7e2c234192c3e71cd69376eac9208a996eea935 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 26 Jun 2023 11:38:35 +0200 Subject: [PATCH] Off by one error. --- src/youtube/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/youtube/utils.py b/src/youtube/utils.py index d219dde..87fcf1a 100644 --- a/src/youtube/utils.py +++ b/src/youtube/utils.py @@ -33,9 +33,9 @@ def process_to_file(cmdline, prefix='', suffix='', cache_key=None, output_path=N if cache_key: cache_path = cache_key.replace('/', '__') - if len(cache_path) > 255: + if len(cache_path) > 200: parts = cache_path.rsplit('.', 1) - limit = 255 - 9 + limit = 200 - 9 if len(parts) > 1: limit -= len(parts[1]) + 1 cache_path = parts[0][:limit] + '.' + hashlib.sha1(cache_key.encode('utf-8')).hexdigest()[:8] -- 2.20.1