-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust error message for stuck/slow videos [if elapsed_time >= timeout, e.g. due to unavailable fragments &/or xklb media_check] #223
Conversation
Lack of explanatory context is the far more serious problem:
(Either way: all users deserve a clear explanation of next steps!) [*] Link to a concrete actionable steps at https://github.com/iiab/calibre-web/wiki if absolutely necessary. Possibly related: |
Is this ticket explanatory enough? yt-dlp/yt-dlp#2137
I'll put the following link in the error message yt-dlp/yt-dlp#2137
What to suggest a user to do if nothing can be done. Redownloading/retrying is the only concrete action a user can do in such cases. There is no buttons or parameters to set in the GUI.
|
cps/tasks/download.py
Outdated
@@ -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"<br>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. Please see https://github.com/yt-dlp/yt-dlp/issues/2137 for context. Try to download the video again later." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to download the video again later.
Specifically why? Under what conditions will waiting help?
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. See https://github.com/yt-dlp/yt-dlp/issues/2137 for context. Try to download the video again later." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to download the video again later.
Specifically why? Under what conditions will waiting help?
Let's not create false hopes:
- Outline conditions (here on Adjust error message for stuck/slow videos [if elapsed_time >= timeout, e.g. due to unavailable fragments &/or xklb media_check] #223 discussion) where waiting-then-retrying can pragmatically help.
- If these are real, then explain (abbreviate / summarize reason[s] to wait!) within "Tasks" view.
Can an anchor tag ( e.g. |
cps/tasks/download.py
Outdated
@@ -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"<br>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. Please see <a href='https://github.com/yt-dlp/yt-dlp/issues/2137' target='_blank'>this ticket</a> for context. Try to download the video again later." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.message = f"Unable to download {self.media_url_link} due to unavailable fragments. Please see <a href='https://github.com/yt-dlp/yt-dlp/issues/2137' target='_blank'>this ticket</a> for context. Try to download the video again later." | |
self.message = f"Unable to download {self.media_url_link} due to unavailable fragments. See <a href='https://github.com/yt-dlp/yt-dlp/issues/2137' target='_blank'>yt-dlp/yt-dlp#2137</a> for context. Try to download the video again later (e.g. if [EXPLANATION])." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user cannot do anything to work around this for now. I removed the suggestion to retry.
|
Excerpt from #215 (comment) :
@deldesir does repetition of this error message somehow indicate (or at least correlate?) with the severity of the problem with an individual video download? (If so, should this [i.e. how much the error message is being repeated] somehow be communicated to the "Task" view user/operator?) |
the message was always repeated because it's caught within the loop of the polling mechanism looking for activity. This was triggered by inactivity for 30s since the video was stuck at x bytes. calibre-web/cps/tasks/download.py Lines 82 to 84 in 8b5ebff
In this particular case, it was repeated with multiline because the error message was appended to previous self.message with |
Sounds like you're saying the error message should never really have been repeated (using (No problem, but if so, forgive me for assuming that repetition had been added for a reason!) |
That's right
No worry, sometimes I cannot explain stuff well enough. The |
No worries!! Let's just make the new error message as accurate as possible, perhaps including bits of the yt-dlp/yt-dlp#2137 title / subject line if this explains more clearly + completely, per: #223 (comment) |
@deldesir please explain why this appears to be happening — hinting at your best guess {assumptions, intuition, intention} :
And/Or...
And/Or...
🙏 |
@holta, this is difficult to put an accurate message for this bug. My observation is we never know if the stuck video will fail or recover. For example, the following video was stuck, but ended up being donwloaded succesfully. I'd like to put a message to encourage the user to wait, but we don't know if it's worth it. after 2-3 minutes: UPDATE: This specific video was not stuck. It was reported as such because the post-processing took some time. I ran |
We don't know wether the download will recover or not
Great insight! ✅ Hopefully "Tasks" view will clarify this & similar revelations as soon as you can in coming days — one tiny-or-small PR at a time — as soon as each is safe and reasonable to merge! 🪚 |
@deldesir are you suggesting that error message "stuck due to unavailable fragments" is sometimes incorrect?
Thank you for clearing this up, so this PR (or similar) can be merged without delay. (As mentioned a week ago, this can always be revised later if understanding advances + shifts in due course!) |
Yes, tasks may appear stuck due to delays in processing video files by ffmpeg too. A message like "Processing video xxx is taking longer than usual, please wait..." will do. If for some reason the download task fails, we can let the user know about it with another message like: "Video xxx failed to download due to xxx" |
If there are delays or failures implementing FFmpeg in isolated circumstance — e.g. if "instantly" generating missing thumbnails is necessary for some video downloads — we'd surface those delays or failures (FFmpeg or otherwise!) making them increasingly very visible in Tasks view. Related:
Please include a link that (also) explains real world causes of delay:
|
Let's outline in a separate GitHub issue or PR the most practical way(s) to surface + strengthen clarity (concrete explanation, hints, tips, or context!) in Tasks view. Addressing similar/common errors, cleanly + efficiently in "Tasks" view, over coming weeks. 💫 Related: |
@deldesir linking to this actual ticket (#223) is also fine in the interim, if you prefer? |
Given the reality that this error is triggered
|
Recap:
|
ASIDE: Should we preserve the original
|
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.
I think it's a bad idea. Multiline messages convey progress, but spamming the message column with repetitive messages is very ugly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 84: As discussed, here's an alternative message to make clear the possible types of errors based on your explanation to me. I also added a sentence so the user knows we are retrying and should wait.
===
{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 <a href=‘#223' target=‘_blank’>/pull/223 for more info.
cps/tasks/download.py
Outdated
self.message += f"<br>Some fragments are taking longer than expected to download. Please wait..." | ||
|
||
if elapsed_time >= timeout: | ||
self.message = f"{self.media_url_link} is stuck due to unavailable fragments. See <a href='https://github.com/yt-dlp/yt-dlp/issues/2137' target='_blank'>yt-dlp/yt-dlp#2137</a> for context." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.message = f"{self.media_url_link} is stuck due to unavailable fragments. See <a href='https://github.com/yt-dlp/yt-dlp/issues/2137' target='_blank'>yt-dlp/yt-dlp#2137</a> 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 <a href=‘https://github.com/iiab/calibre-web/pull/223' target=‘_blank’>https://github.com/iiab/calibre-web/pull/223 for more info.</a>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better.
Co-authored-by: Avni Fein <[email protected]>
Description looks great! Both HTML links appear slightly off to me?? @deldesir can you abbreviate the visible part of links... to be?
|
Tested locally with Blondel via screen share on an IIAB instance. This PR is Ready to merge, imo. [NB: http://lrn2.org's IP is blocked from downloading videos so we could not test there! See: yt-dlp/yt-dlp/issues/10128] |
self.message += f"<br>Some fragments are taking longer than expected to download. Please wait..." | ||
|
||
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 (<a href='https://github.com/yt-dlp/yt-dlp/issues/2137' target='_blank'>yt-dlp/yt-dlp#2137</a>) and/or an error in xklb's media check. Please wait as we try again. See <a href='https://github.com/iiab/calibre-web/pull/223' target='_blank'>#223</a> for more info." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deldesir @avni is the revision below more accurate? (Or if I'm wrong, LMK!)
self.message = f"{self.media_url_link} is taking longer than expected. It could be a stuck download due to unavailable fragments (<a href='https://github.com/yt-dlp/yt-dlp/issues/2137' target='_blank'>yt-dlp/yt-dlp#2137</a>) and/or an error in xklb's media check. Please wait as we try again. See <a href='https://github.com/iiab/calibre-web/pull/223' target='_blank'>#223</a> 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 (<a href='https://github.com/yt-dlp/yt-dlp/issues/2137' target='_blank'>yt-dlp/yt-dlp#2137</a>) and/or an error in xklb's media_check. Please wait as we keep trying. See <a href='https://github.com/iiab/calibre-web/pull/223' target='_blank'>#223</a> for more info." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"keep trying" is more accurate, yes! TY! I don't know if 'media_check' is more accurate than 'media check'. @deldesir is more familiar with xklb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deldesir please revise at any time (e.g. with a new PR) if improvement's helpful 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging of this PR is now cleaned up with this separate commit:
(Apologies I messed up, and didn't get that revision from ~30min ago properly into this PR!)
This PR gets rid of the dozen multi-lines error messages
Tested on Ubuntu 24.04 (LRN2)