-
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 message to warn about problematic videos [e.g. "live" videos, that might not really be live anymore, but still fail to download] #194
Conversation
Co-authored-by: A Holt <[email protected]>
@deldesir consider adding an (Including a generic error message explaining — as best we can guess anyway — what might have caused this?!) |
conn.execute("DELETE FROM media WHERE path = ?", (self.media_url,)) | ||
if self.unavailable: | ||
self.message = f"{self.media_url_link} failed: Video not available." | ||
elif error_message := conn.execute("SELECT error FROM media WHERE ? LIKE '%' || extractor_id || '%'", (self.media_url,)).fetchone()[0]: |
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.
I don't quite understand why we're taking the first error where the extractor_id matches the media_url.
Couldn't we take all records (or the first record) where webpath = media_url
and error is not empty?
errors = conn.execute(
"SELECT error FROM media WHERE webpath = ? AND error != ''", (self.media_url,))
.fetchone()
And we could also get the id column in one query:
(id, error) = conn.execute(
"SELECT id, error FROM media WHERE webpath = ? AND error != ''", (self.media_url,))
.fetchone()
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.
Good point. However, due to SQLite UNIQUE constraint, we don't expect 2 relevant records. And this record should be deleted right after to allow the user to force redownload. If ever another record with the same extractor ID is present, it will never match because its webpath
would have a timestamp appended to it or its error column would not be NULL.
Defensive Programming:
|
Done in 017afed |
Tested together with #193
Unavailable videos returns a different message:
Tested on Ubuntu 24.04