Skip to content
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

Set outtmpl externally [to avoid missing thumbnails; NOTE: archival-quality book & video titles are preserved in 2 SQLite db's] #177

Merged
merged 6 commits into from
Jun 10, 2024

Conversation

deldesir
Copy link
Collaborator

@deldesir deldesir commented Jun 10, 2024

Set "out directory" template externally so video file + thumbnail can be retrieved. This should fix the missing thumbnail issue explained in #171 (comment).

Tested on Ubuntu 24.04
image

image

@holta holta added bug Something isn't working enhancement New feature or request labels Jun 10, 2024
@deldesir deldesir marked this pull request as draft June 10, 2024 01:56
@holta
Copy link
Member

holta commented Jun 10, 2024

Is the idea to further strengthen thumbnail resiliency, building on xklb 2.8.059 ?

Background — xklb 2.8.059 (if I'm understanding correctly!?) also seeks to fix some of these punctuation problems — that have been leading to missing thumbnails like:

@deldesir deldesir requested a review from holta June 10, 2024 02:32
@deldesir deldesir marked this pull request as ready for review June 10, 2024 02:32
@deldesir deldesir self-assigned this Jun 10, 2024
@deldesir
Copy link
Collaborator Author

Is the idea to further strengthen thumbnail resiliency, building on xklb 2.8.059 ?

Yes. Now the issue is resolved. This PR is tested with xklb 2.8.059.

@deldesir
Copy link
Collaborator Author

deldesir commented Jun 10, 2024

To test this PR, follow the instructions outlined in https://github.com/iiab/calibre-web/wiki#how-do-i-test-a-pull-request-pr-, then do:

  • cp /usr/local/calibre-web-py3/scripts/lb-wrapper /usr/local/bin/

@holta holta changed the title Set outtmpl externally Set outtmpl externally [to avoid missing thumbnails] Jun 10, 2024
@holta
Copy link
Member

holta commented Jun 10, 2024

@deldesir is there a specific example this PR fixes, that xklb 2.8.059 does not fix?

@deldesir
Copy link
Collaborator Author

deldesir commented Jun 10, 2024

@deldesir is there a specific example this PR fixes, that xklb 2.8.059 does not fix?

xklb 2.8.059 added support to get both video file and thumbnail in the same folder when outtmpl is set externally. Video files and thumbnails are no longer named after the video_id. The directories are no longer placed into a folder named after the extractor name (YouTube, Vimeo...) and outtmpl downloads everything where the script is run, not inside TMP_DOWNLOADS_DIR anymore. Calibre-Web has to adapt with all these changes, thus #177.

@holta
Copy link
Member

holta commented Jun 10, 2024

xklb 2.8.059 added support to get both video file and thumbnail in the same folder when outtmpl is set externally.

  1. Are your saying outtmpl is absolutely necessary, even with 2.8.059?

Video files and thumbnails are no longer named after the video_id

directories are no longer placed into a folder named after the extractor name (YouTube, Vimeo...)

  1. Please include a specific/full example of an actual PATH/FILENAME to make the code below much more clear for all, Thank You:
OUTTMPL="'${TMP_DOWNLOADS_DIR}/%(extractor_key,extractor)s/%(uploader,uploader_id)s/%(title).170B_%(view_count)3.2D_[%(id).64B].%(ext)s'"

@holta
Copy link
Member

holta commented Jun 10, 2024

Central Design Question that might deserve its own ticket:

  • Are original video titles being preserved in full in xklb-metadata.db? (To protect all characters, no matter how strange, from all languages — and no matter how long the video title?)

  • Likewise for playlist name, channel name and similar?

  • (Even if literary-not-video E-Book titles & metadata might not yet similarly be preserved with archival quality?!)

@holta
Copy link
Member

holta commented Jun 10, 2024

🙏 This PR is opening up existentially critical questions — that families and educators care about deeply in all countries — so learning materials their lives depend on don't disappear or get excessively / accidentally mangled! 🙏

Even if we're not quite there yet obviously!

@deldesir
Copy link
Collaborator Author

deldesir commented Jun 10, 2024

xklb 2.8.059 adde

  1. Are your saying outtmpl is absolutely necessary, even with 2.8.059?

For now yes

  1. Please include a specific/full example of an actual PATH/FILENAME to make the code below much more clear for all, Thank You:

Will do

@deldesir
Copy link
Collaborator Author

deldesir commented Jun 10, 2024

Central Design Question that might deserve its own ticket:

  • Are original video titles being preserved in full in xklb-metadata.db? (To protect all characters, no matter how strange, from all languages — and no matter how long the video title?)
  • Likewise for playlist name, channel name and similar?
  • (Even if literary-not-video E-Book titles & metadata might not yet similarly be preserved with archival quality?!)

We retrieve them directly from xklb-metadata.db already per

https://github.com/iiab/calibre-web/blob/f28a0b7701e0ef0bcb012ac25453f2d0c97ca092/cps/uploader.py#L259C13-L263C37

@holta
Copy link
Member

holta commented Jun 10, 2024

We retrieve them directly from xklb-metadata.db already per

https://github.com/iiab/calibre-web/blob/f28a0b7701e0ef0bcb012ac25453f2d0c97ca092/cps/uploader.py#L259C13-L263C37

Great News!

ASIDE: Does Calibre-Web similarly preserve literary-not-video E-Book titles & metadata, in a completely intact / archival way — or not quite yet?

@deldesir
Copy link
Collaborator Author

We retrieve them directly from xklb-metadata.db already per
https://github.com/iiab/calibre-web/blob/f28a0b7701e0ef0bcb012ac25453f2d0c97ca092/cps/uploader.py#L259C13-L263C37

Great News!

ASIDE: Does Calibre-Web similarly preserve literary-not-video E-Book titles & metadata, in a completely intact / archival way — or not quite yet?

Yes, in /library.calibre-web/metadata.db > books.title

@holta holta changed the title Set outtmpl externally [to avoid missing thumbnails] Set outtmpl externally [to avoid missing thumbnails; NOTE: archival-quality book & video titles are preserved in SQLite db] Jun 10, 2024
@holta holta changed the title Set outtmpl externally [to avoid missing thumbnails; NOTE: archival-quality book & video titles are preserved in SQLite db] Set outtmpl externally [to avoid missing thumbnails; NOTE: archival-quality book & video titles are preserved in 2 SQLite db's] Jun 10, 2024
@holta
Copy link
Member

holta commented Jun 10, 2024

Extremely valuable explanations, thanks to @deldesir !

AI² = Articulate Assumptions + Intuition + Intention 🏞️

@holta holta merged commit 48deb54 into iiab:master Jun 10, 2024
@deldesir deldesir deleted the deldesir-patch-39 branch July 1, 2024 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants