From 146cfd0b26112257751eda584a0cd4b839d93866 Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR Date: Mon, 15 Jul 2024 18:16:18 -0400 Subject: [PATCH 01/11] Adjust error message for stuck videos due to unavailable fragments --- cps/tasks/download.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/tasks/download.py b/cps/tasks/download.py index efa2c7af27..797ab66205 100644 --- a/cps/tasks/download.py +++ b/cps/tasks/download.py @@ -81,7 +81,7 @@ def run(self, worker_thread): else: elapsed_time = (datetime.now() - last_progress_time).total_seconds() if elapsed_time >= fragment_stuck_timeout: - self.message += f"
Some fragments are taking longer than expected to download. Please wait..." + self.message = f"Unable to download {self.media_url_link} due to unavailable fragments." sleep(0.1) From 8ddb222923f43c1d37ddab54f0affd6a6084c0e3 Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR Date: Mon, 15 Jul 2024 19:12:27 -0400 Subject: [PATCH 02/11] Additional adjustments --- cps/tasks/download.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/tasks/download.py b/cps/tasks/download.py index 797ab66205..da1ac44a74 100644 --- a/cps/tasks/download.py +++ b/cps/tasks/download.py @@ -81,7 +81,7 @@ def run(self, worker_thread): else: elapsed_time = (datetime.now() - last_progress_time).total_seconds() if elapsed_time >= fragment_stuck_timeout: - self.message = f"Unable to download {self.media_url_link} due to unavailable fragments." + self.message = f"Unable to download {self.media_url_link} due to unavailable fragments. Please see https://github.com/yt-dlp/yt-dlp/issues/2137 for context. Try to download the video again later." sleep(0.1) From 3e80b644a1cdea9f43fd332d6278633d807654c6 Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR Date: Mon, 15 Jul 2024 19:20:59 -0400 Subject: [PATCH 03/11] Make link clickable --- cps/tasks/download.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/tasks/download.py b/cps/tasks/download.py index da1ac44a74..2cac578834 100644 --- a/cps/tasks/download.py +++ b/cps/tasks/download.py @@ -81,7 +81,7 @@ def run(self, worker_thread): else: elapsed_time = (datetime.now() - last_progress_time).total_seconds() if elapsed_time >= fragment_stuck_timeout: - self.message = f"Unable to download {self.media_url_link} due to unavailable fragments. Please see https://github.com/yt-dlp/yt-dlp/issues/2137 for context. Try to download the video again later." + self.message = f"Unable to download {self.media_url_link} due to unavailable fragments. Please see this ticket for context. Try to download the video again later." sleep(0.1) From 444ccd1c1c9e609d85c375e2819244e17db9fe3b Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR Date: Tue, 16 Jul 2024 11:04:05 -0400 Subject: [PATCH 04/11] Add context url --- cps/tasks/download.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cps/tasks/download.py b/cps/tasks/download.py index 2cac578834..3b8205734c 100644 --- a/cps/tasks/download.py +++ b/cps/tasks/download.py @@ -81,8 +81,7 @@ def run(self, worker_thread): else: elapsed_time = (datetime.now() - last_progress_time).total_seconds() if elapsed_time >= fragment_stuck_timeout: - self.message = f"Unable to download {self.media_url_link} due to unavailable fragments. Please see this ticket for context. Try to download the video again later." - + self.message = f"Unable to download {self.media_url_link} due to unavailable fragments. See yt-dlp/yt-dlp#2137 for context." sleep(0.1) p.wait() From 64c0b55c937582462215c11cf54807692fa47e34 Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR Date: Fri, 19 Jul 2024 13:37:40 -0400 Subject: [PATCH 05/11] Make message less categoric We don't know wether the download will recover or not --- cps/tasks/download.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/tasks/download.py b/cps/tasks/download.py index 3b8205734c..6d71619ec7 100644 --- a/cps/tasks/download.py +++ b/cps/tasks/download.py @@ -81,7 +81,7 @@ def run(self, worker_thread): else: elapsed_time = (datetime.now() - last_progress_time).total_seconds() if elapsed_time >= fragment_stuck_timeout: - self.message = f"Unable to download {self.media_url_link} due to unavailable fragments. See yt-dlp/yt-dlp#2137 for context." + self.message = f"{self.media_url_link} is stuck due to unavailable fragments. See yt-dlp/yt-dlp#2137 for context." sleep(0.1) p.wait() From 03265a026f5572512e67e7a793233e29e3c63abe Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR Date: Fri, 16 Aug 2024 17:57:06 -0400 Subject: [PATCH 06/11] Rename fragment_stuck_timeout variable We renamed the variable from "fragment_stuck_timeout" --> "timeout" to be more generic. We don't know if we are in the download or the processing state for the video. --- cps/tasks/download.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cps/tasks/download.py b/cps/tasks/download.py index 110de94808..0c6660c6a8 100644 --- a/cps/tasks/download.py +++ b/cps/tasks/download.py @@ -54,7 +54,7 @@ def run(self, worker_thread): complete_progress_cycle = 0 last_progress_time = datetime.now() - fragment_stuck_timeout = 120 # seconds + timeout = 120 # seconds self.message = f"Downloading {self.media_url_link}..." if self.live_status == "was_live": @@ -80,7 +80,7 @@ def run(self, worker_thread): last_progress_time = datetime.now() else: elapsed_time = (datetime.now() - last_progress_time).total_seconds() - if elapsed_time >= fragment_stuck_timeout: + if elapsed_time >= timeout: self.message = f"{self.media_url_link} is stuck due to unavailable fragments. See yt-dlp/yt-dlp#2137 for context." sleep(0.1) From 28c95549a0a25faf73417f285ae142c25f403beb Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR Date: Fri, 16 Aug 2024 19:31:18 -0400 Subject: [PATCH 07/11] Improve stuck error message with context Co-authored-by: Avni Fein --- cps/tasks/download.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/tasks/download.py b/cps/tasks/download.py index 0c6660c6a8..2c89dd3ad6 100644 --- a/cps/tasks/download.py +++ b/cps/tasks/download.py @@ -81,7 +81,7 @@ def run(self, worker_thread): else: elapsed_time = (datetime.now() - last_progress_time).total_seconds() if elapsed_time >= timeout: - self.message = f"{self.media_url_link} is stuck due to unavailable fragments. See yt-dlp/yt-dlp#2137 for context." + self.message = f"{self.media_url_link} is taking longer than expected. It could be a stuck download due to unavailable fragments (https://github.com/yt-dlp/yt-dlp/issues/2137) and/or an error in xklb’s media check. Please wait as we try again. See https://github.com/iiab/calibre-web/pull/223 for more info." sleep(0.1) p.wait() From 61acf54ecce276003ece8e8e71888a34c395d6fd Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR Date: Fri, 16 Aug 2024 19:44:28 -0400 Subject: [PATCH 08/11] Make tickets URL clickable --- cps/tasks/download.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/tasks/download.py b/cps/tasks/download.py index 2c89dd3ad6..01edf3dacc 100644 --- a/cps/tasks/download.py +++ b/cps/tasks/download.py @@ -81,7 +81,7 @@ def run(self, worker_thread): else: elapsed_time = (datetime.now() - last_progress_time).total_seconds() if elapsed_time >= timeout: - self.message = f"{self.media_url_link} is taking longer than expected. It could be a stuck download due to unavailable fragments (https://github.com/yt-dlp/yt-dlp/issues/2137) and/or an error in xklb’s media check. Please wait as we try again. See https://github.com/iiab/calibre-web/pull/223 for more info." + self.message = f"{self.media_url_link} is taking longer than expected. It could be a stuck download due to unavailable fragments yt-dlp/yt-dlp#2137 and/or an error in xklb’s media check. Please wait as we try again. See #223 for more info. sleep(0.1) p.wait() From 35d99598ff6ab791f19e66fa5792a08372cc8667 Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR Date: Fri, 16 Aug 2024 19:51:55 -0400 Subject: [PATCH 09/11] Fix bad quotes --- cps/tasks/download.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/tasks/download.py b/cps/tasks/download.py index 01edf3dacc..17b5564e7f 100644 --- a/cps/tasks/download.py +++ b/cps/tasks/download.py @@ -81,7 +81,7 @@ def run(self, worker_thread): else: elapsed_time = (datetime.now() - last_progress_time).total_seconds() if elapsed_time >= timeout: - self.message = f"{self.media_url_link} is taking longer than expected. It could be a stuck download due to unavailable fragments yt-dlp/yt-dlp#2137 and/or an error in xklb’s media check. Please wait as we try again. See #223 for more info. + self.message = f"{self.media_url_link} is taking longer than expected. It could be a stuck download due to unavailable fragments yt-dlp/yt-dlp#2137 and/or an error in xklb's media check. Please wait as we try again. See #223 for more info. sleep(0.1) p.wait() From 37adc96066c0d3618d12062814c378552635ac63 Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR Date: Fri, 16 Aug 2024 19:56:40 -0400 Subject: [PATCH 10/11] Add missing quote --- cps/tasks/download.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/tasks/download.py b/cps/tasks/download.py index 17b5564e7f..f33211b02d 100644 --- a/cps/tasks/download.py +++ b/cps/tasks/download.py @@ -81,7 +81,7 @@ def run(self, worker_thread): else: elapsed_time = (datetime.now() - last_progress_time).total_seconds() if elapsed_time >= timeout: - self.message = f"{self.media_url_link} is taking longer than expected. It could be a stuck download due to unavailable fragments yt-dlp/yt-dlp#2137 and/or an error in xklb's media check. Please wait as we try again. See #223 for more info. + self.message = f"{self.media_url_link} is taking longer than expected. It could be a stuck download due to unavailable fragments yt-dlp/yt-dlp#2137 and/or an error in xklb's media check. Please wait as we try again. See #223 for more info." sleep(0.1) p.wait() From e52fd6ec7dfe00592920f4469e498b89adac938b Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR Date: Fri, 16 Aug 2024 20:05:38 -0400 Subject: [PATCH 11/11] Add parentheses around yt-dlp link for readability --- cps/tasks/download.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/tasks/download.py b/cps/tasks/download.py index f33211b02d..ea18905784 100644 --- a/cps/tasks/download.py +++ b/cps/tasks/download.py @@ -81,7 +81,7 @@ def run(self, worker_thread): else: elapsed_time = (datetime.now() - last_progress_time).total_seconds() if elapsed_time >= timeout: - self.message = f"{self.media_url_link} is taking longer than expected. It could be a stuck download due to unavailable fragments yt-dlp/yt-dlp#2137 and/or an error in xklb's media check. Please wait as we try again. See #223 for more info." + self.message = f"{self.media_url_link} is taking longer than expected. It could be a stuck download due to unavailable fragments (yt-dlp/yt-dlp#2137) and/or an error in xklb's media check. Please wait as we try again. See #223 for more info." sleep(0.1) p.wait()