Page 1 of 1

java.io.IOException: Invalid argument (bad --output folder)

Posted: 02 Jul 2016, 11:04
by stian89
Hi!
After upgrading from 4.6.2 to 4.7, my automation string in µTorrent doesn't work anymore. Probably an easy fix, but I've read release note without really understanding what is wrong.

This is used in µTorrent:

Code: Select all

filebot -script fn:amc --output "\\XXNAS" --log-file amc.log --action copy --conflict override -non-strict --def music=n subtitles=en,no "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" --def "seriesFormat=\\XXNAS/Serier/{n}/Sesong {s}/{n} - {sxe} - {t}" "movieFormat=\\XXNAS/Filmer/{n} ({y})/{n.upperInitial().space('.')}.{y}.{vf}.{source}.{vc}{'-'+group}" "musicFormat=\\XXNAS/Music/Musikk/{n}/{fn}" --def storeReport=y --def "plex=192.XXXX:TOKEN" --def clean=y
I get this result in the log:

Code: Select all

Run script [fn:amc] at [Sat Jul 02 12:55:01 CEST 2016]
Parameter: music = n
Parameter: subtitles = en,no
Parameter: ut_label = 
Parameter: ut_state = 5
Parameter: ut_title = TV-show..
Parameter: ut_kind = %K
Parameter: ut_file = 
Parameter: ut_dir = \\XXNAS\Nedlastinger\SHOW
Parameter: seriesFormat = \\XXNAS/Serier/{n}/Sesong {s}/{n} - {sxe} - {t}
Parameter: movieFormat = \\XXNAS/Filmer/{n} ({y})/{n.upperInitial().space('.')}.{y}.{vf}.{source}.{vc}{'-'+group}
Parameter: musicFormat = \\XXNAS/Music/Musikk/{n}/{fn}
Parameter: storeReport = y
Parameter: plex = 192.XXIP:TOKEN
Parameter: clean = y
Invalid argument
java.io.IOException: Invalid argument
	at java_io_File$getCanonicalFile.call(Unknown Source)
	at Script1.run(Script1.groovy:15)
	at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:62)
	at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:72)
	at net.filebot.cli.ArgumentProcessor.runScript(ArgumentProcessor.java:114)
	at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:29)
	at net.filebot.Main.main(Main.java:120)
Failure (°_°)
If i install the old Filebot again, it works. So I guess one of the strings is wrong. Can anyone help me? :)

Re: Automation trouble with 4.7

Posted: 02 Jul 2016, 12:30
by rednoah
--output must be a folder. A network host (e.g. \\host) is not a folder. A network share (e.g. \\host\share) is a folder.

Re: java.io.IOException: Invalid argument (bad --output fold

Posted: 02 Jul 2016, 12:38
by stian89
How will this work when i have seperate folders for movies and tv-shows?

If I put it like this:

--output "\\XXNAS\Movies"

The TV-shows will not end up where I want them: \\XXNAS\Shows ? :)

Re: java.io.IOException: Invalid argument (bad --output fold

Posted: 02 Jul 2016, 12:42
by rednoah
You can always override the absolute destination in the format, but the amc script will still require a real folder (where it can create folders and temporary files) as default output folder.

Re: java.io.IOException: Invalid argument (bad --output fold

Posted: 02 Jul 2016, 12:57
by stian89
Works like a charm!
Thank you for great support!

Re: java.io.IOException: Invalid argument (bad --output fold

Posted: 26 Sep 2016, 18:27
by datalore44
rednoah wrote:You can always override the absolute destination in the format, but the amc script will still require a real folder (where it can create folders and temporary files) as default output folder.
Hi Rednoah
Can you elaborate what this comment means please? And how to resolve it. I have had filebot amc setup for a very long time and all of a sudden I am having the same java issue as the original poster. This is my setup.

Code: Select all

filebot.launcher -script fn:amc "D:\USENET\TVSHOWS" "D:\USENET\MOVIES" --output "\\NSA325" --log-file D:\filebot.log --action move -non-strict --conflict override  --def clean=y  --def "seriesFormat=tvshows/{n}/{n} - {S00E00} - {t}" "movieFormat=movies/{n} ({y})"

REM delete left behind empty folders

filebot.launcher -script fn:cleaner "D:\USENET\TVSHOWS" "D:\USENET\MOVIES" minFileSize=120000000 --log-file D:\filebot.log --def "exts=/mp4|srs|sfv|idx|sub|txt|par2|rar|IGNORE|0|bin|mkv|1|url|FILE|docx|z\d+|jpg|jpeg|png|gif|nfo|info|xml|htm|html|log|srt|md5|sfv|txt|rtf|db|dna|log|tgmd|json|data|srv|srr|avi|hq|xvid|nzb|par\d+|part\d+/

filebot -script fn:cleaner "D:\USENET\TVSHOWS" "D:\USENET\MOVIES" --log-file D:\filebot.log
I am assuming the output is no longer valid \\NSA325

Re: java.io.IOException: Invalid argument (bad --output folder)

Posted: 27 Sep 2016, 03:19
by rednoah
rednoah wrote:--output must be a folder. A network host (e.g. \\host) is not a folder. A network share (e.g. \\host\share) is a folder.
You must pass in a folder, but you can override the absolute path in your format if you want to put stuff on different shares. Note that FileBot may still use --output for internal reasons, which is way it must be a valid folder where it can create temporary files.

In the past FileBot didn't correctly validate the --output option. This is now fixed.

Re: java.io.IOException: Invalid argument (bad --output folder)

Posted: 27 Sep 2016, 17:37
by datalore44
Thank you.
I have managed to sort it out by doubling the script, once for tvshows and once for movies with there respective outputs. There is probably a much easier way, but this works for me.
Regards
Alan

Re: java.io.IOException: Invalid argument (bad --output folder)

Posted: 28 Sep 2016, 01:45
by rednoah
rednoah wrote:You can (and should) force Movie/Series/Anime mode or force ignore files via labels, e.g. label as Movie to force TheMovieDB, Series to force TheTVDB, Anime to force AniDB, or other to ignore all files.
If you know in advance if you're processing TV Shows or Movies, then you should do that anyway, so FileBot doesn't have to autodetect what is what.

e.g.

Code: Select all

--def ut_label=TV

Re: java.io.IOException: Invalid argument (bad --output folder)

Posted: 03 Oct 2016, 02:06
by datalore44
Hi Rednoah.

Well I thought that I had it sorted but no! This is my script below.

filebot.launcher -script fn:amc "D:\USENET\MOVIES" --output "\\NSA325\movies" --def ut_label=Movie --log-file D:\filebotMOV.log --action move -non-strict --conflict override --def clean=y --def "movieFormat=movies/{n} ({y})"

filebot.launcher -script fn:amc "D:\USENET\TVSHOWS" --output "\\NSA325\tvshows" --def ut_label=Series --log-file D:\filebotTV.log --action move -non-strict --conflict override --def clean=y --def "seriesFormat=tvshows/{n}/{n} - {S00E00} - {t}"



Before the filebot update, using my old script:

filebot.launcher -script fn:amc "D:\USENET\TVSHOWS" "D:\USENET\MOVIES" --output "\\NSA325" --log-file D:\filebot.log --action move -non-strict --conflict override --def clean=y --def "seriesFormat=tvshows/{n}/{n} - {S00E00} - {t}" "movieFormat=movies/{n} ({y})"


which had --output "\\NAS325", my files were separated and moved into 2 folders called, movies and tvshows which were on the root of my nas. Now with the above script it is making separate folders inside the original folders, so output is now NSA325/movies/movies/ filename.mkv

Would it be simpler to revert back to an older filebot, or is there something I am doing wrong?
I am sorry I am so stupid, I struggle to catch on to this stuff due to a very bad head injury. This is why I need to automate as much stuff as I can.
Thanks
Alan

Re: java.io.IOException: Invalid argument (bad --output folder)

Posted: 03 Oct 2016, 04:42
by rednoah
The path you generate in your format is resolved against your output folder:

Code: Select all

--output "\\NSA325\tvshows" --def seriesFormat="{n}/{n} - {s00e00} - {t}"