
I want to use that information for a shell script.
Code: Select all
-exec /path/to/script.sh {folder}
Code: Select all
/Users/john/.filebot/scripts/qBT_e-program.sh "%N" "%L" "%F" "%R" "%D" "%C" "%Z" "%T" "%I" "%G"
Code: Select all
!/bin/bash
{
filebot -script fn:amc --output "/Volumes/PlexMedia/PlexServer_1" \
--action copy \
--conflict index -non-strict \
--log-file amc.log \
--def "ut_kind"="multi" \
--def "ut_title"="${1}" \
--def "ut_label"="${2}" \
--def "ut_tags"="${10}" \
--def "ut_dir"="${3}" \
--def "ut_rpath"="${4}" \
--def "ut_spath"="${5}" \
--def "ut_files"="${6}" \
--def "ut_bytes"="${7}" \
--def "ut_track"="${8}" \
--def "ut_info"="${9}" \
--def excludeList="/Users/john/.filebot/amc_excludes.txt" \
--def pushover=xxx \
--def unsorted=y \
--def music=y \
--def skipExtract=y \
--def seriesFormat="/Volumes/SeedDrive/PlexServer_2/{plex.derive{' {thetvdb-'}{id}{'}'}{' - ['+allOf{tags}{vf}{vs}{crc32}.join(' ')}{']'}}{if (dc > 1) '.'+di}" \
--def movieFormat="/Volumes/PlexMedia/PlexServer_1/{plex.derive{' {imdb-'}{imdbid}{'}'}{' ['+allOf{tags}{audio.language}{if ('Documentary' in genres)'[doc]'}{info:video[0].displayAspectRatioString.colon('"∶"').replace('?', '')}{ws}{vf}{vs}{vc}{crc32}.join(' ')}{']'}}{if (dc > 1) '.'+di}" \
"ut_dir"="${3}" "ut_title"="${1}" "ut_label"="${2}"
}
#this is where I do the find... Add {$1} at the end of the path here?
{
find /Volumes/PlexMedia/PlexServer_1/Movies -type f -iname "*.srt" | \
grep -v \\.eng | \
grep -v "].srt" | \
while read -r file; do trash -F "$file";done;
}
{
DATEVAR=$(date '+%Y_%m_%d_%H:%M:%S'); echo "$DATEVAR ""${1}""" >> ~/Desktop/qbtscriptresult.txt
}
I see. So you want a process called by your shell script to be able to set variables within the context of the calling shell script? AFAIK, that is fundamentally conceptually not possible since a parent processes cannot communicate with a child processes on this level of detail. There is standard IO though. Your shell script can always parse the standard output of the filebot process though, and then set variables accordingly.
Code: Select all
-exec /path/to/delete-srt-files.sh {folder}
Code: Select all
#!/bin/sh -xu
find "$1" # JUST PRINT FILE PATHS FOR TESTING
Code: Select all
#!/bin/bash
#find "$1" >> ~/Desktop/SsubDeletetest.txt
Code: Select all
/Volumes/SeedDrive/PlexServer_2/TV Shows/Last Week Tonight with John Oliver/Season 08
/Volumes/SeedDrive/PlexServer_2/TV Shows/Last Week Tonight with John Oliver/Season 08/Last Week Tonight with John Oliver - S08E01 - Episode 210 {thetvdb-278518} - [720p WEB-DL B0D70BE9].mkv
/Volumes/SeedDrive/PlexServer_2/TV Shows/Last Week Tonight with John Oliver/Season 08/Last Week Tonight with John Oliver - S08E02 - Episode 211 {thetvdb-278518} - [720p WEB-DL 53A2A391].mkv
/Volumes/SeedDrive/PlexServer_2/TV Shows/Last Week Tonight with John Oliver/Season 08/Last Week Tonight with John Oliver - S08E03 - Episode 212 {thetvdb-278518} - [720p WEB-DL 4744E726].mkv
/Volumes/SeedDrive/PlexServer_2/TV Shows/Last Week Tonight with John Oliver/Season 08/Last Week Tonight with John Oliver - S08E04 - Episode 213 {thetvdb-278518} - [720p WEB-DL 2A3AC986].mkv
Code: Select all
"$1/"
Code: Select all
/Volumes/PlexMedia/PlexServer_1/Movies/Sin Nombre (2009)
Code: Select all
/Volumes/PlexMedia/PlexServer_1/Movies/Sin Nombre (2009)/
Code: Select all
'"$1"'
I have been working on this for quite awhile and couldn't get the second script to run. I finally figured out how to log the shell script process and have useful information to share. I can PM you the err.txt?rednoah wrote: ↑07 Mar 2021, 04:44
Here's what the call stack would look like:
1. qBT calls your qBT_e-program.sh
1.1. qBT_e-program.sh calls filebot
1.1.1. filebot -exec calls your delete-srt-files.sh passing along the destination {folder} as Argument $1
1.1.1.1. delete-srt-files.sh calls find "$1" ...
e.g.e.g. delete-srt-files.shCode: Select all
-exec /path/to/delete-srt-files.sh {folder}
Code: Select all
#!/bin/sh -xu find "$1" # JUST PRINT FILE PATHS FOR TESTING
Code: Select all
[2021-03-28 18:40:57.330] Cannot run program "/Users/john/.filebot/scripts/remove_non-english_subtitles.sh" (in directory "/Volumes/PlexMedia/PlexServer_1"): error=2, No such file or directory
[2021-03-28 18:40:57.336] Processed 26 files
[2021-03-28 18:40:57.342] Sending Pushover notification
[2021-03-28 18:40:58.247] Done ヾ(@⌒ー⌒@)ノ
Code: Select all
#!/bin/bash
set -x
{
filebot -script fn:amc --output "/Volumes/PlexMedia/PlexServer_1" \
--action copy \
--conflict index -non-strict \
--log-file amc.log \
--def "ut_kind"="multi" \
--def "ut_title"="${1}" \
--def "ut_label"="${2}" \
--def "ut_tags"="${10}" \
--def "ut_dir"="${3}" \
--def "ut_rpath"="${4}" \
--def "ut_spath"="${5}" \
--def "ut_files"="${6}" \
--def "ut_bytes"="${7}" \
--def "ut_track"="${8}" \
--def "ut_info"="${9}" \
--def excludeList="/Users/john/.filebot/amc_excludes.txt" \
--def pushover=xxxx \
--def unsorted=y \
--def music=y \
--def skipExtract=y \
--def seriesFormat="/Volumes/SeedDrive/PlexServer_2/{plex.derive{' {thetvdb-'}{id}{'}'}{' - ['+allOf{tags}{vf}{vs}{crc32}.join(' ')}{']'}}{if (dc > 1) '.'+di}" \
--def movieFormat="/Volumes/PlexMedia/PlexServer_1/{plex.derive{' {imdb-'}{imdbid}{'}'}{' ['+allOf{tags}{audio.language}{if ('Documentary' in genres)'[doc]'}{info:video[0].displayAspectRatioString.colon('"∶"').replace('?', '')}{ws}{vf}{vs}{vc}{crc32}.join(' ')}{']'}}{if (dc > 1) '.'+di}" \
"ut_title"="${1}" "ut_label"="${2}" "ut_dir"="${3}" -exec /Users/john/.filebot/scripts/remove_non-english_subtitles.sh {folder}
} 2>&1 >> /Users/john/Desktop/qbt_e-program_exec_results.txt
Code: Select all
Cannot run program "/Users/john/.filebot/scripts/remove_non-english_subtitles.sh" (in directory "/Volumes/PlexMedia/PlexServer_1"): error=2, No such file or directory
Code: Select all
-exec echo {f}