Running amc script from Qbt - getting errors

Support for Ubuntu and other Desktop Linux distributions
Post Reply
wizzd
Posts: 20
Joined: 28 Dec 2019, 21:15

Running amc script from Qbt - getting errors

Post by wizzd »

Hi
Migrating from PI to NUC running proxmox
Installed qbt and filebot in vm - plex will also run in vm.
Running qbt-nox - using webUI.
Trying to make run filebot amc script upon torrent completion.
I suspect that my issue relates to permissions, but my linux skills aren't that good... The amc.log file does, however, get created in one case...

My end goal is to run this command on torrnet completion - which worked on my old setup, which was qbt - but running with the GUI.
There is no output to amc log when I put this in Qbt

Code: Select all

filebot -script fn:amc --output "/storage/torrent/download” --action copy --def clean=y --conflict skip -non-strict --log-file “/storage/torrent/amc.log"  --def plex=192.168.1.205:PLEX_KEY --def subtitles=en,da --def movieFormat="/storage/torrent/download/Movies/{ny} - {label}" seriesFormat="/storage/torrent/download/Serier/{n}/Season {s.pad(2)}/{n} - {s00e00} - {t}" --def [email protected]:gmail_key ut_dir="%F" ut_kind="multi" ut_title="%N" ut_label="%L"

Just fyi, I have had a working license for some years but haven't renewed as the old setup was going out of commission ... I will get a license when I make the new setup work 😀


Sysinfo

Code: Select all

my_USERNAME@plex:/storage/torrent$ filebot -script fn:sysinfo
Low Disk Space (3.5 GB) on / (/dev/mapper/ubuntu--vg-ubuntu--lv)
FileBot 5.0.1 (r9665)
JNA Native: 6.1.1
MediaInfo: 21.09
Tools: fpcalc/1.5.1 7z/16.02 unrar/6.11
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2023-03-28 (r895)
Groovy: 4.0.9
JRE: OpenJDK Runtime Environment 11.0.18
JVM: OpenJDK 64-Bit Server VM
CPU/MEM: 4 Core / 517 MB Max Memory / 22 MB Used Memory
OS: Linux (amd64)
HW: Linux plex 5.15.0-69-generic #76-Ubuntu SMP Fri Mar 17 17:19:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
CPU/MEM: Common KVM processor [MemTotal: 2.1 GB | MemFree: 785 MB | MemAvailable: 1.5 GB | SwapTotal: 1.9 GB | SwapFree: 1.9 GB]
STORAGE: ext4 [/] @ 3.5 GB | ext4 [/storage] @ 149 GB
UID/GID: uid=1000(my_USERNAME) gid=1000(my_USERNAME) groups=1000(my_USERNAME),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),110(lxd)
DATA: /home/my_USERNAME/.filebot
Package: DEB
License: UNREGISTERED
I''m starting out with basics and running this command

Code: Select all

filebot -script fn:amc --output “/storage/torrent” --log-file "/storage/torrent/amc.log" 
AMC output

Code: Select all

Low Disk Space (3.5 GB) on / (/dev/mapper/ubuntu--vg-ubuntu--lv)
Run script [fn:amc] at [Thu Apr 06 11:23:26 UTC 2023]

[PSA] Important Discussion of Proposed Changes:
https://www.filebot.net/forums/viewtopic.php?t=13406

Invalid usage: output folder must exist and must be a writable directory: /“/storage/torrent”
Invalid usage: no input
Abort (×_×)
Permissions (I ran chmod 777 -R and chown 777 -R on the folders)

Code: Select all

my_USERNAME@plex:/storage$ ls -la
total 28
drwxrwxrwx  4 my_USERNAME root  4096 Apr  5 07:22 .
drwxr-xr-x 20 root   root  4096 Apr  5 05:15 ..
drwxrwxrwx  2 my_USERNAME root 16384 Apr  5 05:13 lost+found
drwxrwxrwx  3 my_USERNAME root  4096 Apr  6 11:31 torrent

my_USERNAME@plex:/storage/torrent$ ls -la
total 16
drwxrwxrwx 3 my_USERNAME root   4096 Apr  6 11:31 .
drwxrwxrwx 4 my_USERNAME root   4096 Apr  5 07:22 ..
-rw-r--r-- 1 my_USERNAME my_USERNAME  358 Apr  6 11:23 amc.log
drwxrwxrwx 4 my_USERNAME root   4096 Apr  6 11:23 download
Please let me know if i missed providing some info.

Thanks
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Running amc script from Qbt - getting errors

Post by rednoah »

:?: Are you writing command-line code in Microsoft Word or Google Docs? You'll want to use a Code Editor that doesn't auto-convert bash syntax like " or ' to similar looking characters that have no special meaning to the bash interpreter.


:arrow: Please read the Avoid non-ASCII characters section in the Cmdline and Argument Passing for details.


:idea: The error message literally means what it says, you're passing a relative file path "x", which is resolved against the current working directory / so filebot says "/x" does not exist, it just so happens that your "x" is a filename that happens to contain strange characters like “ and ” which is perfectly valid and no different from A-Z as far as the file system is concerned:

Code: Select all

Invalid usage: output folder must exist and must be a writable directory: /“/storage/torrent”
:idea: Please read the FAQ and How to Request Help.
wizzd
Posts: 20
Joined: 28 Dec 2019, 21:15

Re: Running amc script from Qbt - getting errors

Post by wizzd »

First of all, thanks for replying so fast - that's just awesome!

I used the notes app on my mac - hence the changed " - i didn't notice those.

It fixed the initial problem, but raised another which I haven't been able to solve from your guides on amc. I used the code from the guide and changed the output and the log part.

Code: Select all

filebot -script fn:amc --output "/storage/torrent/unpack" --action copy --def clean=y --conflict skip -non-strict --log-file "/storage/torrent/amc.log" --def subtitles=en,da --def [email protected]:email_key "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L"
Then I get this in the log...
(Don't mind the subtitle thing)

Code: Select all

Low Disk Space (3.5 GB) on / (/dev/mapper/ubuntu--vg-ubuntu--lv)
Run script [fn:amc] at [Thu Apr 06 18:49:13 UTC 2023]

[PSA] Important Discussion of Proposed Changes:
https://www.filebot.net/forums/viewtopic.php?t=13406

Parameter: clean = y
Parameter: subtitles = en,da
Parameter: gmail = *****
Parameter: ut_dir = /storage/torrent/download/ABCD
Parameter: ut_kind = multi
Parameter: ut_title = ABCD
Parameter: ut_label = 
Input: /storage/torrent/download/ABCD/ABCD.mkv
Failed to fetch resource: https://api.filebot.net/9665/data/series-mappings.txt.xz: Undefined Variable: NullPointerException
Failed to load data file: Undefined Variable: NullPointerException
Failed to fetch resource: https://api.filebot.net/9665/data/query-excludes.txt.xz: Undefined Variable: NullPointerException
Failed to load data file: Undefined Variable: NullPointerException
Failed to fetch resource: https://api.filebot.net/9665/data/seriesdb.txt.xz: Undefined Variable: NullPointerException
Failed to load data file: Undefined Variable: NullPointerException
Failed to fetch resource: https://api.filebot.net/9665/data/release-groups.txt.xz: Undefined Variable: NullPointerException
Failed to load data file: Undefined Variable: NullPointerException
Failed to fetch resource: https://api.filebot.net/9665/data/media-sources.txt.xz: Undefined Variable: NullPointerException
Failed to load data file: Undefined Variable: NullPointerException
Group: {Series=ABCD} => [ABCD.mkv]
Get [English] subtitles for 1 file
Please enter your login details by calling `filebot -script fn:configure`
Get [Danish] subtitles for 1 file
Please enter your login details by calling `filebot -script fn:configure`
Rename episodes using [TheMovieDB] with [Airdate Order]
Lookup via [] [ABCD]
Failed to fetch resource: https://api.themoviedb.org/3/search/tv: Undefined Variable: NullPointerException
Undefined Variable: NullPointerException
Finished without processing any files
Failure (×_×)⌒☆
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Running amc script from Qbt - getting errors

Post by rednoah »

qBT seems to be passing invalid environment variables on Linux that break proxy auto-configuration and thus break all network requests:
viewtopic.php?t=13656

Code: Select all

http_proxy = 
https_proxy = 
sock_proxy = 

:arrow: The solution is to disable system proxies:

Code: Select all

filebot -script fn:properties --def java.net.useSystemProxies=false

:idea: FileBot r9718 and higher do this by default when running on Linux.
:idea: Please read the FAQ and How to Request Help.
wizzd
Posts: 20
Joined: 28 Dec 2019, 21:15

Re: Running amc script from Qbt - getting errors

Post by wizzd »

I acutally already found this post and tried the

Code: Select all

--def java.net.useSystemProxies=false 
I didn't post it here to avoid confusion if the topic was unrelated...

But I don't know where to put/what to do with the below lines so I'm getting the same results (which is probably expected)
- could you guide me here please.
Thanks

Code: Select all

http_proxy = 
https_proxy = 
sock_proxy = 
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Running amc script from Qbt - getting errors

Post by rednoah »

You need to configure filebot first (i.e. a separate one-time operation that creates a configuration file) so that filebot will then pick up the new configuration in subsequent calls:

Code: Select all

filebot -script fn:properties --def java.net.useSystemProxies=false
filebot -script fn:amc ...


:!: You notably cannot add arbitrary --def name=value script parameters to the amc script call. The amc script will silently ignore parameters that are not used.



:idea: This is the problem, not the solution. The problem is that these environment variables are somehow set but set to an empty value, instead of being unset, likely a qBT bug, which in turn exposes a JDK HTTP/2 bug:

Code: Select all

http_proxy = 
https_proxy = 
sock_proxy = 
:idea: Please read the FAQ and How to Request Help.
wizzd
Posts: 20
Joined: 28 Dec 2019, 21:15

Re: Running amc script from Qbt - getting errors

Post by wizzd »

This did the trick.
Thanks for the always quick support - license renewed 😀
Post Reply