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
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cps/uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def video_metadata(tmp_file_path, original_file_name, original_file_extension):
# FYI yt_dlp uses YouTube and Vimeo "extractors" -- among ~1810 websites it can scrape:
# https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md
# https://github.com/yt-dlp/yt-dlp/tree/master/yt_dlp/extractor
if file.lower().endswith(('.webp', '.jpg', '.png', '.gif')) and os.path.splitext(file)[0] == video_id:
if file.lower().endswith(('.webp', '.jpg', '.png', '.gif')) and os.path.splitext(file)[0] == os.path.splitext(os.path.basename(row['path']))[0]:
cover_file_path = os.path.join(os.path.dirname(row['path']), file)
break
else:
Expand Down
3 changes: 2 additions & 1 deletion scripts/lb-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ URL_OR_SEARCH_TERM="$2"
LOG_FILE="/var/log/xklb.log"
XKLB_DB_FILE="/library/calibre-web/xklb-metadata.db"
TMP_DOWNLOADS_DIR="/library/downloads/calibre-web"
OUTTMPL="'${TMP_DOWNLOADS_DIR}/%(extractor_key,extractor)s/%(uploader,uploader_id)s/%(title).170B_%(view_count)3.2D_[%(id).64B].%(ext)s'"
holta marked this conversation as resolved.
Show resolved Hide resolved
holta marked this conversation as resolved.
Show resolved Hide resolved
VERBOSITY="-vv"

PATTERNS=(
Expand Down Expand Up @@ -71,7 +72,7 @@ log "Info" "Using yt-dlp $(yt-dlp --version)"
if [[ $XKLB_INTERNAL_CMD == "tubeadd" ]]; then
xklb_full_cmd="lb tubeadd ${XKLB_DB_FILE} ${URL_OR_SEARCH_TERM} --force ${VERBOSITY}"
elif [[ $XKLB_INTERNAL_CMD == "dl" ]]; then
xklb_full_cmd="lb dl ${XKLB_DB_FILE} --prefix ${TMP_DOWNLOADS_DIR} --video --search ${URL_OR_SEARCH_TERM} ${FORMAT_OPTIONS} --write-thumbnail --subs ${VERBOSITY}"
xklb_full_cmd="lb dl ${XKLB_DB_FILE} --video --search ${URL_OR_SEARCH_TERM} ${FORMAT_OPTIONS} --write-thumbnail --subs -o ${OUTTMPL} ${VERBOSITY}"
elif [[ $XKLB_INTERNAL_CMD == "search" ]]; then
xklb_full_cmd="lb search ${XKLB_DB_FILE} ${URL_OR_SEARCH_TERM}"
else
Expand Down