You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Attempt to explain the logic behind success and failure of a video download)
I. Metadata Fetch Task
lb tubeadd is run:
The lb tubeadd command is executed to fetch metadata for the media URL.
media.webpath is set to the original URL.
media.path is initially set to the original URL.
media.error is set to NULL.
Notes:
lb tubeadd will fail due to an unsupported URL or if yt-dlp returns no data, the metadata fetch task will not proceed further, and no download task will be created for the URL.
lb tubeadd will silently exit when the URL is already present and nothing is recorded in media.error (i.e unavailable fragments case)
Sending URL to "Download Task":
After successfully running lb tubeadd, the metadata fetch task checks the media table in the database:
If media.duration is not NULL and media.duration > 0, the URL is considered valid and is sent to the download task.
If media.duration is NULL or media.duration = 0, the URL is marked as unavailable, and the task will log an error and terminate.
Notes:
Only URLs with valid durations are forwarded to the download task, ensuring that only downloadable videos are processed further.
II. Download Task
Running lb dl:
The lb dl command is executed to download the media file.
media.webpath remains the original URL.
media.path should be updated to the actual file path on the disk upon successful download.
media.error remains NULL if no errors occur during the download process.
Notes:
If lb dl fails to download the video, media.path will not be updated correctly (i.e., it might remain as an URL or contain an invalid path).
The task will log any errors and update the media.error field accordingly, except for videos failed due to unavailable fragments (to be fixed)
Upon Successful Download:
If the download is successful:
A timestamp is appended to media.webpath to indicate the time of download.
The downloaded file's path is stored in media.path.
Detailed Steps for Success and Failure
Success:
Metadata Fetch Task:
lb tubeadd runs successfully.
Metadata (including duration) is fetched and stored in the database.
URL is forwarded to the download task if media.duration is valid.
Download Task:
lb dl runs successfully.
Video is downloaded, and the file path is updated in the database.
media.webpath is updated with a timestamp.
Task status is set to STAT_FINISH_SUCCESS.
Failure:
Metadata Fetch Task Failure:
lb tubeadd fails due to an unsupported URL or no data returned.
Task logs an error and terminates without creating a download task.
Download Task Failure:
lb dl fails to download the video (e.g., due to network issues, video removal, or other errors).
media.path remains incorrect or NULL, leading to potential NoneType errors when accessed.
The tasks interact with xklb-metadata.db to fetch and update media metadata and paths. Ensure failures doesn't prevent its reuse
Proper database transactions and error handling ensure that the database state remains consistent even in case of failures, but views-per-day calculation may fail if one of requested value is missing. Check for likeliness.
Redownloading / Retrying
Currently, redownload of failed videos is not supported. Remove media.error or apply timestamp to their media.webpath
The text was updated successfully, but these errors were encountered:
deldesir
changed the title
What makes videos fail
What makes videos fail?
Jun 17, 2024
(Attempt to explain the logic behind success and failure of a video download)
I. Metadata Fetch Task
lb tubeadd
is run:lb tubeadd
command is executed to fetch metadata for the media URL.media.webpath
is set to the original URL.media.path
is initially set to the original URL.media.error
is set toNULL
.Notes:
lb tubeadd
will fail due to an unsupported URL or ifyt-dlp
returns no data, the metadata fetch task will not proceed further, and no download task will be created for the URL.lb tubeadd
will silently exit when the URL is already present and nothing is recorded inmedia.error
(i.e unavailable fragments case)Sending URL to "Download Task":
lb tubeadd
, the metadata fetch task checks themedia
table in the database:media.duration
is notNULL
andmedia.duration > 0
, the URL is considered valid and is sent to the download task.media.duration
isNULL
ormedia.duration = 0
, the URL is marked as unavailable, and the task will log an error and terminate.Notes:
II. Download Task
Running
lb dl
:lb dl
command is executed to download the media file.media.webpath
remains the original URL.media.path
should be updated to the actual file path on the disk upon successful download.media.error
remainsNULL
if no errors occur during the download process.Notes:
lb dl
fails to download the video,media.path
will not be updated correctly (i.e., it might remain as an URL or contain an invalid path).media.error
field accordingly, except for videos failed due to unavailable fragments (to be fixed)Upon Successful Download:
media.webpath
to indicate the time of download.media.path
.Detailed Steps for Success and Failure
Success:
Metadata Fetch Task:
lb tubeadd
runs successfully.media.duration
is valid.Download Task:
lb dl
runs successfully.media.webpath
is updated with a timestamp.STAT_FINISH_SUCCESS
.Failure:
Metadata Fetch Task Failure:
lb tubeadd
fails due to an unsupported URL or no data returned.Download Task Failure:
lb dl
fails to download the video (e.g., due to network issues, video removal, or other errors).media.path
remains incorrect orNULL
, leading to potentialNoneType
errors when accessed.media.error
is updated with the error message.STAT_FAIL
.TODO:
Calibre-Web/XKLB Tuning:
Error Handling:
Database Operations:
media.error
exists, if not create it. Ensure error and live_status columns are created from the start #191xklb-metadata.db
to fetch and update media metadata and paths. Ensure failures doesn't prevent its reuseviews-per-day
calculation may fail if one of requested value is missing. Check for likeliness.Redownloading / Retrying
media.error
or apply timestamp to theirmedia.webpath
The text was updated successfully, but these errors were encountered: