No media files: [] when I pass input file paths that do not exist

Support for Ubuntu and other Desktop Linux distributions
Post Reply
jantjo
Posts: 6
Joined: 11 Nov 2016, 03:04

No media files: [] when I pass input file paths that do not exist

Post by jantjo »

Hey there.

I've been running a fairly old version of Filebot (FileBot 4.7.5) for awhile but i've started to notice some of the lookups have started to fail due to what im guessing is api/key changes with TheTVDB and TheMovieDB::TV. To be transparent I havn't been using filebot todo the actual rename, but more to scrape the results and them apply that to my own script.. so basically been using the "--action test" command.

When I try any of the new versions 4.9.1 -> 5.0.1 I get a new error of "No media files: []" which is true as im not passing filebot a file, just sending a command to check the rename value.

Example of 4.7.5

Code: Select all

~/bin/temp$ ~/bin/filebot.sh -rename --format '{n} - {s00e00} - {t}' --action test --db TheMovieDB::TV Bobs.Burgers.S13E01.mkv
Rename episodes using [TheMovieDB]
Auto-detected query: [bobs burgers]
Fetching episode data for [Bob's Burgers]
[TEST] Rename [/home/rtorrent/bin/temp/Bobs.Burgers.S13E01.mkv] to [/home/rtorrent/bin/temp/Bob's Burgers - S13E01 - To Bob, or Not to Bob.mkv]
Processed 1 files
Example of 4.9.x+

Code: Select all

~/bin/temp$ ./filebot.sh -rename --format '{n} - {s00e00} - {t}' --action test --db TheMovieDB::TV Bobs.Burgers.S13E01.mkv
File does not exist: Bobs.Burgers.S13E01.mkv
Rename episodes using [TheMovieDB] with [Airdate Order]
No media files: []
Failure (×_×)⌒☆
So the question/assistance im looking for is, how can I use filebot via cli (linux) to respond with a rename as per the defined format regardless if the file is there or not?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: No media files: [] - Error with newer versions of filebot

Post by rednoah »

FileBot does not work with non-existent file paths. Older versions of FileBot just didn't validate input arguments. Newer versions reliably fail-fast instead of maybe kinda working maybe somehow failing, because a non-existent input file path typically indicates an accidental user error.


:arrow: You can however create a new empty file and then run tests on that:

Code: Select all

#!/bin/sh
touch "$1"
filebot -rename "$1" --format '{n} - {s00e00} - {t}' --action test --db TheMovieDB::TV


EDIT:

You may be able to use a bash script as Custom Rename Action for custom processing, rather than parsing console output:
rednoah wrote: 05 Apr 2017, 09:58 Shell Actions:
The --action parameter accepts custom executables as parameter value. The source path and the target path are passed as first and second argument respectively.

e.g. use a custom shell script perform arbitrary operations:

Code: Select all

--action /usr/local/bin/echo-arguments

Code: Select all

#!/bin/sh -xu
echo "SOURCE=$1"
echo "TARGET=$2"
e.g. use scp to copy files to a remote server:

Code: Select all

--action /usr/local/bin/scp-to-server

Code: Select all

#!/bin/sh -xu
scp -v "$1" "user@host:/volume1/files/$2"
e.g. use ln -s to create absolute symlinks:

Code: Select all

--action /usr/local/bin/create-absolute-symlink

Code: Select all

#!/bin/sh -xu
mkdir -p "$(dirname "$1")"
ln -sv "$1" "$2"
:idea: Please read the FAQ and How to Request Help.
Post Reply