From 8fec1984bb02b5d4e46dffe0573bf3779201e5be Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR <16546989+deldesir@users.noreply.github.com> Date: Wed, 6 Dec 2023 22:14:34 -0500 Subject: [PATCH 1/4] Sort formats --prefer-free-formats: Prefer video formats with free containers over non-free ones of same quality --format: Video format code --format-sort: Sort the formats by the fields given, see https://github.com/yt-dlp/yt-dlp#sorting-formats for more details --- scripts/lb-wrapper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lb-wrapper b/scripts/lb-wrapper index 6b92e6fce2..8753f59344 100644 --- a/scripts/lb-wrapper +++ b/scripts/lb-wrapper @@ -39,7 +39,7 @@ mv ${SURVEY_DB_FILE} ${SURVEY_DB_FILE}.$(date +%F_%T_%Z) || true log "Running command: ${XKLB_EXECUTABLE} tubeadd ${SURVEY_DB_FILE} ${URL} --verbose && ${XKLB_EXECUTABLE} dl ${SURVEY_DB_FILE} --prefix ${TMP_DOWNLOADS_DIR} --write-thumbnail --format='bestvideo[height<=720][vcodec=vp9]+bestaudio/best[height<=720][vcodec=vp9]' --video ${URL} --verbose" OUTPUT=$(${XKLB_EXECUTABLE} tubeadd ${SURVEY_DB_FILE} ${URL} --verbose && \ ${XKLB_EXECUTABLE} dl ${SURVEY_DB_FILE} --prefix ${TMP_DOWNLOADS_DIR} --write-thumbnail \ - --format='bestvideo[height<=720][vcodec=vp9]+bestaudio/best[height<=720][vcodec=vp9]' --video ${URL} --verbose) + --prefer-free-formats --format='best' --format-sort='res:720,tbr~2000' --video ${URL} --verbose) if [ $? -ne 0 ]; then log "An error occurred while running the command. Output: ${OUTPUT}" From 80c4084681731968591dba81f362f0a393926e6b Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR Date: Wed, 6 Dec 2023 23:45:12 -0500 Subject: [PATCH 2/4] Update log output --- scripts/lb-wrapper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lb-wrapper b/scripts/lb-wrapper index 8753f59344..04c2a3a4c8 100644 --- a/scripts/lb-wrapper +++ b/scripts/lb-wrapper @@ -36,7 +36,7 @@ fi log "Moving ${SURVEY_DB_FILE} aside if it already exists." mv ${SURVEY_DB_FILE} ${SURVEY_DB_FILE}.$(date +%F_%T_%Z) || true -log "Running command: ${XKLB_EXECUTABLE} tubeadd ${SURVEY_DB_FILE} ${URL} --verbose && ${XKLB_EXECUTABLE} dl ${SURVEY_DB_FILE} --prefix ${TMP_DOWNLOADS_DIR} --write-thumbnail --format='bestvideo[height<=720][vcodec=vp9]+bestaudio/best[height<=720][vcodec=vp9]' --video ${URL} --verbose" +log "Running command: ${XKLB_EXECUTABLE} tubeadd ${SURVEY_DB_FILE} ${URL} --verbose && ${XKLB_EXECUTABLE} dl ${SURVEY_DB_FILE} --prefix ${TMP_DOWNLOADS_DIR} --write-thumbnail--format='best' --format-sort='res:720,tbr~2000' --video ${URL} --verbose" OUTPUT=$(${XKLB_EXECUTABLE} tubeadd ${SURVEY_DB_FILE} ${URL} --verbose && \ ${XKLB_EXECUTABLE} dl ${SURVEY_DB_FILE} --prefix ${TMP_DOWNLOADS_DIR} --write-thumbnail \ --prefer-free-formats --format='best' --format-sort='res:720,tbr~2000' --video ${URL} --verbose) From 4e7c442d9dc48d31c6122a1f75745f45964d306e Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR Date: Thu, 7 Dec 2023 14:19:11 -0500 Subject: [PATCH 3/4] Update log output --- scripts/lb-wrapper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lb-wrapper b/scripts/lb-wrapper index 04c2a3a4c8..4f0e1c7312 100644 --- a/scripts/lb-wrapper +++ b/scripts/lb-wrapper @@ -36,7 +36,7 @@ fi log "Moving ${SURVEY_DB_FILE} aside if it already exists." mv ${SURVEY_DB_FILE} ${SURVEY_DB_FILE}.$(date +%F_%T_%Z) || true -log "Running command: ${XKLB_EXECUTABLE} tubeadd ${SURVEY_DB_FILE} ${URL} --verbose && ${XKLB_EXECUTABLE} dl ${SURVEY_DB_FILE} --prefix ${TMP_DOWNLOADS_DIR} --write-thumbnail--format='best' --format-sort='res:720,tbr~2000' --video ${URL} --verbose" +log "Running command: ${XKLB_EXECUTABLE} tubeadd ${SURVEY_DB_FILE} ${URL} --verbose && ${XKLB_EXECUTABLE} dl ${SURVEY_DB_FILE} --prefix ${TMP_DOWNLOADS_DIR} --write-thumbnail --prefer-free-formats --format='best' --format-sort='res:720,tbr~2000' --video ${URL} --verbose" OUTPUT=$(${XKLB_EXECUTABLE} tubeadd ${SURVEY_DB_FILE} ${URL} --verbose && \ ${XKLB_EXECUTABLE} dl ${SURVEY_DB_FILE} --prefix ${TMP_DOWNLOADS_DIR} --write-thumbnail \ --prefer-free-formats --format='best' --format-sort='res:720,tbr~2000' --video ${URL} --verbose) From a8770b5270d73f96e903fd63e02d0db48f75c0bc Mon Sep 17 00:00:00 2001 From: Blondel MONDESIR Date: Thu, 7 Dec 2023 14:58:02 -0500 Subject: [PATCH 4/4] Use format-sort only --- scripts/lb-wrapper | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/lb-wrapper b/scripts/lb-wrapper index 4f0e1c7312..763632e019 100644 --- a/scripts/lb-wrapper +++ b/scripts/lb-wrapper @@ -36,10 +36,10 @@ fi log "Moving ${SURVEY_DB_FILE} aside if it already exists." mv ${SURVEY_DB_FILE} ${SURVEY_DB_FILE}.$(date +%F_%T_%Z) || true -log "Running command: ${XKLB_EXECUTABLE} tubeadd ${SURVEY_DB_FILE} ${URL} --verbose && ${XKLB_EXECUTABLE} dl ${SURVEY_DB_FILE} --prefix ${TMP_DOWNLOADS_DIR} --write-thumbnail --prefer-free-formats --format='best' --format-sort='res:720,tbr~2000' --video ${URL} --verbose" +log "Running command: ${XKLB_EXECUTABLE} tubeadd ${SURVEY_DB_FILE} ${URL} --verbose && ${XKLB_EXECUTABLE} dl ${SURVEY_DB_FILE} --prefix ${TMP_DOWNLOADS_DIR} --write-thumbnail --format-sort='res:720,tbr~2000' --video ${URL} --verbose" OUTPUT=$(${XKLB_EXECUTABLE} tubeadd ${SURVEY_DB_FILE} ${URL} --verbose && \ ${XKLB_EXECUTABLE} dl ${SURVEY_DB_FILE} --prefix ${TMP_DOWNLOADS_DIR} --write-thumbnail \ - --prefer-free-formats --format='best' --format-sort='res:720,tbr~2000' --video ${URL} --verbose) + --format-sort='res:720,tbr~2000' --video ${URL} --verbose) if [ $? -ne 0 ]; then log "An error occurred while running the command. Output: ${OUTPUT}"