Where can I add ISO2, so that subs get rename in a 2 letter format

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
abescalamis
Posts: 30
Joined: 26 Jan 2018, 04:10

Where can I add ISO2, so that subs get rename in a 2 letter format

Post by abescalamis »

Code: Select all

filebot -script 'fn:amc' /volume1/Data/Prueba --output /volume1/Data/Media/listo --action move -non-strict --conflict override --lang en --def 'ut_label=movie' 'music=y' 'unsorted=y' 'artwork=y' 'clean=y' 'deleteAfterExtract=y' 'excludeList=.excludes' --log all --log-file '/volume1/@appstore/filebot-node/data/filebot.log'
I use the above script, and I was wondering if there is a way so that the renaming of the subtitles get to Movie (2018).eng.srt, instead I want Movie (2018).en.srt, when I used the fileboot language identifier I just add the .ISO2 to the {'.'+lang.ISO2}, I was wondering if is possible to do the same for the above script.

Also, I notice that fileboot adds the artwork and names it like this (fanart.jpg, etc) and Kodi Names it like this (Movie (2018)-fanart.jpg, etc), is possible to make it match the way kodi does it?

is even possible to do any of the above? or maybe someone here knows how to make kodi to save the downloded subtitles using the three language code instead.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by rednoah »

1.
Strange. You don't seem to be using any custom formats so it should be defaulting to the Plex format, which enforces Plex compatible 3-letter language codes.


2.
Changing artwork naming is not possible (unless you modify the scripts). I'd just write an extra scripts that batch renames artwork files to {folder.name}-{fn}.
:idea: Please read the FAQ and How to Request Help.
abescalamis
Posts: 30
Joined: 26 Jan 2018, 04:10

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by abescalamis »

Thank Rednoah.

The reason why I'm asking this is because I'm trying to make an automatic setup, with very little user interaction, I'm using multiple tools to accomplish that, and Emby is my streaming server, My biggest problem is that some tools use ISO2 and others ISO3, I have work around/solutions like the one you gave me in number 2,

My setup so far:
-Synology NAS - Running Emby Server
-Tasks created (NAS) to use "subliminal" and subtitle movies automatically from multiple providers automatically (it uses ISO-2).
-I use a Kodi client to download spanish subtitles that Subliminal cannot find using the Subdvix pluggin (Kodi uses ISO-2).
- Task created (NAS) to use Filebot AMC script after downloading movies.
- after running the AMC script I will do a rename command to match Kodi way of renaming artwork (work in progress need to find the command)

This is what I need to complete my set up

- I need to have the AMC to use ISO2 for subtitles if not possible I will use a rename command(work around)

-I still need to find the command to run before running the AMC script, to rename and identified the subtitle so that AMC detects it and move and rename the subtitle as well, I know how to do it using the GUI but need to find a command for automation, I need the command that does the same as this:
GUI setting
Input Folder:

Code: Select all

Z:\Media\Movies\Movies A-Z
Includes:

Code: Select all

ext=~/srt/
Format - Expression:

Code: Select all

{n.colon(' - ')} ({y}){' CD'+pi}{'.'+lang.ISO2}
Thank you, .
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by rednoah »

Are you familiar with using command-line tools? What have you tried so far?

If you're using the amc script, then it's using {plex} as format by default, but you can pass in your own custom format if you like. Please read the Change how files will be organized and renamed section of the amc script.
:idea: Please read the FAQ and How to Request Help.
abescalamis
Posts: 30
Joined: 26 Jan 2018, 04:10

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by abescalamis »

I figure out how to change the language suffix when using the AMC script

filebot -script fn:amc --output "/volume1/Data/Prueba/" --action move -non-strict "/volume1/AMC Filebot/" 'movieFormat={n}{y}/{ny}{'\'' CD'\''+pi}{'\''.'\''+lang.ISO2}' 'clean=y' 'deleteAfterExtract=y' --log-file amc.log --def excludeList=amc.txt

I'm a step closer to fully automation.
I know that the AMC sript doesn't detect and move the subtitles if they don't have the same name as the video file, the solution I thought is run a comand before running the AMC script to rename the srt subitles and add the videofile name and language suffix. Do you know if filebot can do that.

last question

if I add '--def artwork=y' it adds artwork and NFO, if there a way to add the NFO only?
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by kim »

if I add '--def artwork=y' it adds artwork and NFO, if there a way to add the NFO only?
you may want to try my custom AMC script ;)
viewtopic.php?f=4&t=5451&p=31192#p31191
--def nfoOnly=y (get/make ONLY Movie/TV NFO's)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by rednoah »

abescalamis wrote: 27 May 2018, 22:40 I know that the AMC sript doesn't detect and move the subtitles if they don't have the same name as the video file, the solution I thought is run a comand before running the AMC script to rename the srt subitles and add the videofile name and language suffix. Do you know if filebot can do that.
This would be my recommendation, but not sure if anybody is using FileBot for that. It should be quite easy, but I'm also not aware of any commands you could just copy & paste.


Here's a start though:
viewtopic.php?f=10&t=5941#p34035


If you replace {fn.nameWithoutExtension} with {folder.name} maybe that might just be good enough? Assuming that all your movies are in their own folder and that the folder names matches the movie file file name.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by rednoah »

If all your subtitles are in "Subs" folders then this will work:

Code: Select all

{f.dir.dir.listFiles().find{ it.video }.nameWithoutExtension}{subt}


:idea: Note that this format will not work correctly if subs are not exactly one folder level inside the movie folder, and the format will need to be adjusted for different situations, or to auto-detect different situations.



e.g. Test Case:

Code: Select all

$ tree .
.
├── Avatar.2009.mp4
└── Subs
    └── 1_eng.srt
e.g. Output:

Code: Select all

$ filebot -rename -r . --db xattr -non-strict --filter "f.subtitle" --output . --format "{f.dir.dir.listFiles().find{ it.video }.nameWithoutExtension}{subt}"
Rename files using [Extended Attributes]
[MOVE] From [Avatar.2009/Subs/1_eng.srt] to [Avatar.2009/Avatar.2009.eng.srt]
Processed 1 files

Code: Select all

$ tree .
.
├── Avatar.2009.eng.srt
├── Avatar.2009.mp4
└── Subs



EDIT:

Here's a bit of internal API that might be useful in this particular case:

Code: Select all

{net.filebot.media.MediaDetection.guessMovieFolder(f).name}
:idea: Please read the FAQ and How to Request Help.
abescalamis
Posts: 30
Joined: 26 Jan 2018, 04:10

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by abescalamis »

All of the info provided help me a lot and I'm done

This is the command to rename the subs the same as the video file and adds language suffix (pre AMC run)(doesn't move any sub)

Code: Select all

filebot -rename -r '/volume1/AMC Filebot' --db xattr -non-strict --format "{net.filebot.media.MediaDetection.guessMovieFolder(f).name}{subt}"
Then I run my AMC scrip:

Code: Select all

filebot -script 'fn:amc' '/volume1/AMC Filebot' --output /volume1/Data/Prueba --action move -non-strict --conflict fail --def 'ut_label=movie' 'clean=y' 'deleteAfterExtract=y' 'movieFormat={ny}/{ny}{'\''.'\''+lang.ISO2}' --log-file amc.log --def excludeList=amc.txt
Important Note:

The first command only renames the subs even if they are inside a subfolder or next to the video, this is enough for the AMC script to detect and move the subs.

I also tried to have the subs moved next to the video file, but couldn't find a good --output argument for that, this is what I tried

Code: Select all

filebot -rename -r '/volume1/AMC Filebot/Bluray' --db xattr -non-strict --filter "f.subtitle" --output '/volume1/AMC Filebot/Bluray' --format "{net.filebot.media.MediaDetection.guessMovieFolder(f).name}{subt}"
Anyways

Thank you Rednoah.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by rednoah »

This should do the trick, to move subtitles in the movie folder and renaming them using that movie folders name:

Code: Select all

{def m = net.filebot.media.MediaDetection.guessMovieFolder(f); m/m.name}{subt}
:idea: Please read the FAQ and How to Request Help.
kimosavi
Posts: 3
Joined: 05 Apr 2014, 14:05

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by kimosavi »

hi guys, at the end, can the orphan Eng.1.srt file that was downloaded with the movie under folder Subs be renamed before the main "filebot -script fn:amc..." script is run?

can the latest sript: "{def m = net.filebot.media.MediaDetection.guessMovieFolder(f); m/m.name}{subt}" do this? and sorry for the question, but where is this to be pasted, if I'm calling the script from mutorrent?

I have the standard AMC script working ok from mutorrent.
abescalamis
Posts: 30
Joined: 26 Jan 2018, 04:10

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by abescalamis »

rednoah wrote: 30 May 2018, 05:35 This should do the trick, to move subtitles in the movie folder and renaming them using that movie folders name:

Code: Select all

{def m = net.filebot.media.MediaDetection.guessMovieFolder(f); m/m.name}{subt}
Hello Rednoah, I was trying to use the quoted command for TV shows, but all of the season subtitles are in one folder, it only moved one subtitle, I change some arguments and it didn't work.

Also do you know which argument I have wrong on this command, because It is not changing the subtitle language code to ISO2, and it also creates a TV Shows directory in the "output path" and places the show there instead.

Code: Select all

filebot -script 'fn:amc' '/volume1/AMC/Auto/TV Shows' --output '/volume1/Data/Media/TV Shows' --action move -non-strict --order Airdate --conflict skip --def 'ut_label=TV' 'clean=y' 'deleteAfterExtract=y' 'tvFormat={n} - {s00e00} - {t}{'\''.'\''+lang.ISO2}' --log-file amc.log --def excludeList=amc.txt
Thank you, I appreciate any assistance or guidance.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by rednoah »

Please include the console output that you get in response to calling the command above.


:idea: Please read How to Request Help.
:idea: Please read the FAQ and How to Request Help.
abescalamis
Posts: 30
Joined: 26 Jan 2018, 04:10

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by abescalamis »

  1. Code: Select all

    {def m = net.filebot.media.MediaDetection.guessMovieFolder(f); m/m.name}
    The above command works for my movies and I'm trying to use it for tv shows too, I know I need to change this part "guessMovieFolder(f); m/m.name" to something else, I tried "guessTvFolder(f)"
    • The command doesn't fail, it only moves one subtitle to the parent folder instead of all subtitles, when I get the tv shows the entire season subtitles are in one folder.

      and here is the log

      Code: Select all

      Task: Subtest
      Start time: Thu, 07 Nov 2019 10:30:10 GMT
      Stop time: Thu, 07 Nov 2019 10:30:40 GMT
      Current status: 0 (Normal)
      Standard output/error:
      Rename files using [Extended Attributes]
      [MOVE] from [/volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC/Subs/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC.eng.srt] to [/volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC.eng.srt]
      Skipped [/volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC/Subs/Family.Guy.S15E02.Bookie.of.the.Year.720p.WEB-DL.x264.AAC.srt] because [/volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC.eng.srt] already exists
      Skipped [/volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC/Subs/Family.Guy.S15E03.American.Gigg-olo.720p.WEB-DL.x264.AAC.srt] because [/volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC.eng.srt] already exists
      Processed 1 files
      
      
      Sincerely,
      Synology DiskStation[code][/list]
abescalamis
Posts: 30
Joined: 26 Jan 2018, 04:10

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by abescalamis »

Code: Select all

filebot -script 'fn:amc' '/volume1/AMC/Auto/Kids' --output '/volume1/Data/Media/Movies/Kids Movies' --action move -non-strict --conflict skip --def 'ut_label=movie' 'clean=y' 'deleteAfterExtract=y' 'movieFormat={ny}/{ny}{'\''.'\''+lang.ISO2}' --log-file amc.log --def excludeList=amc.txt
The above code is what I use to move and rename movies, subtitles using ISO2, and it works, I made changes to the below code to use it with TV shows

Code: Select all

filebot -script 'fn:amc' '/volume1/AMC/Auto/TV Shows' --output '/volume1/Data/Media/TV Shows' --action move -non-strict --order Airdate --conflict skip --def 'ut_label=TV' 'clean=y' 'deleteAfterExtract=y' 'tvFormat={n} - {s00e00} - {t}{'\''.'\''+lang.ISO2}' --log-file amc.log --def excludeList=amc.txt
and there are two problems:

1) It doesn't change the subtitle language code to ISO2
2) it creates a folder named as the target folder and it places the show there. (TV shows --->TV Shows--->Family Guy), my guess is that my problem could be related to this 'tvFormat={n} - {s00e00} - {t}{'\''.'\''+lang.ISO2}'


here is the log

Code: Select all

Task: AMCtest
Start time: Thu, 07 Nov 2019 13:04:20 GMT
Stop time: Thu, 07 Nov 2019 13:04:49 GMT
Current status: 0 (Normal)
Standard output/error:
Locking /volume1/@appstore/filebot/data/Aben/logs/amc.log
Run script [fn:amc] at [Thu Nov 07 13:04:25 PST 2019]
Parameter: ut_label = TV
Parameter: clean = y
Parameter: deleteAfterExtract = y
Parameter: tvFormat = {n} - {s00e00} - {t}{'.'+lang.ISO2}
Parameter: excludeList = amc.txt
Argument[0]: /volume1/AMC/Auto/TV Shows
Use excludes: /volume1/Data/Media/TV Shows/amc.txt
Input: /volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC.eng.srt
Input: /volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC.mp4
Input: /volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC/Family.Guy.S15E02.Bookie.of.the.Year.720p.WEB-DL.x264.AAC.mp4
Input: /volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC/Family.Guy.S15E02.Bookie.of.the.Year.720p.WEB-DL.x264.AAC.srt
Input: /volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC/Family.Guy.S15E03.American.Gigg-olo.720p.WEB-DL.x264.AAC.mp4
Input: /volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC/Family.Guy.S15E03.American.Gigg-olo.720p.WEB-DL.x264.AAC.srt
Group: [Series:true] => [Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC.eng.srt, Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC.mp4, Family.Guy.S15E02.Bookie.of.the.Year.720p.WEB-DL.x264.AAC.mp4, Family.Guy.S15E02.Bookie.of.the.Year.720p.WEB-DL.x264.AAC.srt, Family.Guy.S15E03.American.Gigg-olo.720p.WEB-DL.x264.AAC.mp4, Family.Guy.S15E03.American.Gigg-olo.720p.WEB-DL.x264.AAC.srt]
Rename episodes using [TheTVDB]
Auto-detected query: [Family Guy]
Fetching episode data for [Family Guy]
Fetching episode data for [Family Guns]
Fetching episode data for [Family Game]
Fetching episode data for [Family (1976)]
Auto-detected query: [Family Guy]
Fetching episode data for [Family Guy]
Fetching episode data for [Family Guns]
Fetching episode data for [Family Game]
Fetching episode data for [Family (1976)]
[MOVE] from [/volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC.mp4] to [/volume1/Data/Media/TV Shows/TV Shows/Family Guy/Season 15/Family Guy - S15E01 - The Boys in the Band.mp4]
[MOVE] from [/volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC/Family.Guy.S15E02.Bookie.of.the.Year.720p.WEB-DL.x264.AAC.srt] to [/volume1/Data/Media/TV Shows/TV Shows/Family Guy/Season 15/Family Guy - S15E02 - Bookie of the Year.eng.srt]
[MOVE] from [/volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC/Family.Guy.S15E03.American.Gigg-olo.720p.WEB-DL.x264.AAC.srt] to [/volume1/Data/Media/TV Shows/TV Shows/Family Guy/Season 15/Family Guy - S15E03 - American Gigg-olo.eng.srt]
[MOVE] from [/volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC.eng.srt] to [/volume1/Data/Media/TV Shows/TV Shows/Family Guy/Season 15/Family Guy - S15E01 - The Boys in the Band.eng.srt]
[MOVE] from [/volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC/Family.Guy.S15E02.Bookie.of.the.Year.720p.WEB-DL.x264.AAC.mp4] to [/volume1/Data/Media/TV Shows/TV Shows/Family Guy/Season 15/Family Guy - S15E02 - Bookie of the Year.mp4]
[MOVE] from [/volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC/Family.Guy.S15E03.American.Gigg-olo.720p.WEB-DL.x264.AAC.mp4] to [/volume1/Data/Media/TV Shows/TV Shows/Family Guy/Season 15/Family Guy - S15E03 - American Gigg-olo.mp4]
Processed 6 files
Clean clutter files and empty folders
Delete /volume1/AMC/Auto/TV Shows/Family.Guy.S15E01-20.720p.WEB-DL.x264.AAC
Done ヾ(@⌒ー⌒@)ノ


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

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by rednoah »

The amc script does not have a --def tvFormat parameter, and so your format is completely ignored and has no effect:

Code: Select all

Parameter: tvFormat = {n} - {s00e00} - {t}{'.'+lang.ISO2}


There is a --def seriesFormat parameter though, which can be used to pass in your own custom episode naming scheme:

Code: Select all

--def seriesFormat="{plex}"
:idea: Please read the FAQ and How to Request Help.
abescalamis
Posts: 30
Joined: 26 Jan 2018, 04:10

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by abescalamis »

I finally got it working by changing what you said to this.

Code: Select all

'seriesFormat={n}/{'\''Season '\''+s}/{n} - {s00e00} - {t}{'\''.'\''+lang.ISO2}'
Image

Finally, all I need is help with moving the subtitles next to the video, for movies I use the below code, but I am lost in how to implement it for TV shows.

Code: Select all

{def m = net.filebot.media.MediaDetection.guessMovieFolder(f); m/m.name}
Thank you very much for your help
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by rednoah »

Does it matter? If you process files with the same --output folder and same --format then they get moved into the same folder anyway.

e.g.

Code: Select all

$ filebot -rename -r "Family Guy" --db TheMovieDB::TV --action TEST --output /OUTPUT --format "{n}/{'Season '+s}/{n} - {s00e00} - {t}{'.'+lang.ISO2}" --log INFO
[TEST] from [Family Guy/Family.Guy.S01E01.mp4] to [/OUTPUT/Family Guy/Season 1/Family Guy - S01E01 - Death Has a Shadow.mp4]
[TEST] from [Family Guy/Subs/Family.Guy.S01E01.eng.srt] to [/OUTPUT/Family Guy/Season 1/Family Guy - S01E01 - Death Has a Shadow.en.srt]
We and up with file paths exactly as per format specification, and where those files originally come from does not matter at all:

Code: Select all

Family Guy/Season 1/Family Guy - S01E01 - Death Has a Shadow.mp4
Family Guy/Season 1/Family Guy - S01E01 - Death Has a Shadow.en.srt
:idea: Please read the FAQ and How to Request Help.
abescalamis
Posts: 30
Joined: 26 Jan 2018, 04:10

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by abescalamis »

When I get a TV Show, it comes like in the picture, the season subtitles come in a single folder named Subs, the AMC won't process the subtitles if they are located in a subfolder.

That is why I run the command to move the subtitles to the parent folder next to the videos before I run the AMC command.
Last edited by abescalamis on 08 Nov 2019, 23:04, edited 2 times in total.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by rednoah »

I see. You'd have to write the code yourself. I think a simple "if parent folder is named "Subs" then move file to parent parent folder" should do for most cases.

:idea: Note that you want to use Plain File Mode for that:
viewtopic.php?t=2072

e.g.

Code: Select all

filebot -rename -r "Family Guy" --db file --file-filter "folder.name =~ /Subs/" --format "{folder.dir/fn}" --action TEST
Rename files using [Plain File]
[TEST] from [Family Guy/Subs/Family.Guy.S01E01.eng.srt] to [Family Guy/Family.Guy.S01E01.eng.srt]


:!: Note that the amc script is ill-suited for pre-processing / pre-moving files, so that path is best avoided.
:idea: Please read the FAQ and How to Request Help.
abescalamis
Posts: 30
Joined: 26 Jan 2018, 04:10

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by abescalamis »

This is the code you gave me, I only added the path

Code: Select all

filebot -rename -r '/volume1/AMC/Auto/TV Show' "Family Guy" --db file --file-filter "folder.name =~ /Subs/" --format "{folder.dir/fn}" --action TEST Rename files using [Plain File] [TEST] from [Family Guy/Subs/Family.Guy.S01E01.eng.srt] to [Family Guy/Family.Guy.S01E01.eng.srt]
After a lot of hours of scratching my head I read here viewtopic.php?f=13&t=11214&p=46514&hili ... e+r#p46514 that I need to use fileboot 4.86, I did install the beta but the beta was giving me an error on my already working scheduled tasks, and had to go back to 4.85.

The error I get using 4.85

Code: Select all

Standard output/error:
Illegal Argument: java.nio.file.NoSuchFileException: /volume1/AMC/Auto/TV Show (/volume1/AMC/Auto/TV Show)
Illegal Argument: java.nio.file.NoSuchFileException: /volume1/homes/Aben/Family Guy (Family Guy)
Illegal Argument: java.nio.file.NoSuchFileException: /volume1/homes/Aben/Rename (Rename)
Illegal Argument: java.nio.file.NoSuchFileException: /volume1/homes/Aben/files (files)
Illegal Argument: java.nio.file.NoSuchFileException: /volume1/homes/Aben/using (using)
Illegal Argument: java.nio.file.NoSuchFileException: /volume1/homes/Aben/[Plain ([Plain)
Illegal Argument: java.nio.file.NoSuchFileException: /volume1/homes/Aben/File] (File])
Illegal Argument: java.nio.file.NoSuchFileException: /volume1/homes/Aben/[TEST] ([TEST])
Illegal Argument: java.nio.file.NoSuchFileException: /volume1/homes/Aben/from (from)
Illegal Argument: java.nio.file.NoSuchFileException: /volume1/homes/Aben/[Family ([Family)
Illegal Argument: java.nio.file.NoSuchFileException: /volume1/homes/Aben/Guy/Subs/Family.Guy.S01E01.eng.srt] (Guy/Subs/Family.Guy.S01E01.eng.srt])
Illegal Argument: java.nio.file.NoSuchFileException: /volume1/homes/Aben/to (to)
Illegal Argument: java.nio.file.NoSuchFileException: /volume1/homes/Aben/[Family ([Family)
Illegal Argument: java.nio.file.NoSuchFileException: /volume1/homes/Aben/Guy/Family.Guy.S01E01.eng.srt] (Guy/Family.Guy.S01E01.eng.srt])
Rename files using [Plain File]
[TEST] from [Guy/Subs/Family.Guy.S01E01.eng.srt]] to [Guy/Subs/Guy/Family.Guy.S01E01.eng.srt]]
Processed 1 files
The Error I get using 4.86 beta

Code: Select all

Standard output/error:
Unrecognized option: --illegal-access=permit
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
I guess that I will have to wait to test the command
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where can I add ISO2, so that subs get rename in a 2 letter format

Post by rednoah »

Different issues caused by different things. Maybe tricky to resolve. I recommend a systematic approach, as randomly trying things tends to be confusing if you're dealing with multiple unrelated problems.


1.
This errors means that you're using Java 8 to run a version of FileBot that requires Java 11:

Code: Select all

Unrecognized option: --illegal-access=permit

2.
This error means you're using Java 11 to run a version of FileBot that was designed for Java 8 and unfortunately turned out to not be forwards-compatible:

Code: Select all

Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 57

3.
These warnings just mean that you're not escaping command-line arguments correctly:

Code: Select all

Illegal Argument: java.nio.file.NoSuchFileException: /volume1/AMC/Auto/TV Show (/volume1/AMC/Auto/TV Show)
Please read Cmdline and Argument Passing for details.



:idea: (1) and (2) can be resolved by installing the latest FileBot (latest beta) and the latest Java Installer package (which will give you Java 13 at the time of writing).

:idea: (3) is just general-purpose command-line skills. Very useful. Please read Cmdline and Argument Passing thoroughly.




EDIT:

Additionally, did you just copy & paste this into the command-line without thinking?

Code: Select all

filebot -rename -r... --action TEST Rename files using [Plain File] [TEST] from [Family Guy/Subs/Family.Guy.S01E01.eng.srt] to [Family Guy/Family.Guy.S01E01.eng.srt]
This is the command:

Code: Select all

filebot -rename -r '/volume1/AMC/Auto/TV Show' "Family Guy" --db file --file-filter "folder.name =~ /Subs/" --format "{folder.dir/fn}" --action TEST
:!: Passing "Family Guy" as input argument probably doesn't make sense on your system.

This is not a command. This is the output produced by the command in my sample case:

Code: Select all

Rename files using [Plain File] [TEST] from [Family Guy/Subs/Family.Guy.S01E01.eng.srt] to [Family Guy/Family.Guy.S01E01.eng.srt]
:!: :!: :!: If you copy & paste random text into the command-line, then at best, it's gibberish and you just get a confused shell, but at worst, if there's accidentally valid commands that do stuff in your text dump, then you can f*** up your system.
:idea: Please read the FAQ and How to Request Help.
Post Reply