Page 1 of 1

Amc "/" invalid character filename output

Posted: 06 Jan 2017, 09:48
by django69
Hello,

i have spent some hours to adjust my script for automatic renaming but i still have a problem...

Code: Select all

sh /home/bob/.filebot/filebot.sh --lang fr -script fn:amc --output "/home/bob/plex1" --log-file "/home/bob/.temp/filmslog1.log" --action symlink --def ignore=ISO --def subtitles=fr --def excludeList="/home/bob/.temp/filmsexclog1.log" --conflict auto --def reportError=y -non-strict --def unsorted=y --def gmail=********************* --def "movieFormat={output}/films/{n} ({y}) - {'en' in audio.language[0] ? 'Eng' : ''} {'en' in audio.language[0] ? audio[0].codec : ''} {'fr' in audio.language[0] ? audio[0].BitRateString : ''} {'en' in audio.language[0] ? af.replace('8ch','7.1').replace('7ch','6.1').replace('6ch','5.1').replace('3ch', '2.1').replace('2ch','2.0') : ''} {'en' in audio.language[1] ? 'Eng' : ''} {'en' in audio.language[1] ? audio[1].codec : ''} {'fr' in audio.language[1] ? audio[1].BitRateString : ''} {'en' in audio.language[1] ? af.replace('8ch','7.1').replace('7ch','6.1').replace('6ch','5.1').replace('3ch', '2.1').replace('2ch','2.0') : ''}  {'fr' in audio.language[0] ? 'Fr' : ''} {'fr' in audio.language[0] ? audio[0].codec : ''} {'fr' in audio.language[0] ? audio[0].BitRateString : ''} {'fr' in audio.language[0] ? af.replace('8ch','7.1').replace('7ch','6.1').replace('6ch','5.1').replace('3ch', '2.1').replace('2ch','2.0') : ''}  {'fr' in audio.language[1] ? 'Fr' : ''} {'fr' in audio.language[1] ? audio[1].codec : ''} {'fr' in audio.language[1] ? audio[1].BitRateString : ''} {'fr' in audio.language[1] ? af.replace('8ch','7.1').replace('7ch','6.1').replace('6ch','5.1').replace('3ch', '2.1').replace('2ch','2.0') : ''}" "ut_dir=/home/bob/torrents/seed/test" "ut_kind=multi" "ut_title=$TORRENT_NAME" "ut_label=films" &
i want to have a bitrate output like this : 4 804 kbs but i have this from mediainfo query 4 804 kb/s who stripe the filename...

same as with this audio codec like : Atmos / TrueHD who strip the filename !


an example :

Code: Select all

Rename movies using [TheMovieDB]
Auto-detect movie from context: [/home/bob/torrents/seed/test/The************.2016.MULTi.TRUEFRENCH.1080p.BluRay.TrueHD.Atmos.7.1x264.AC3-****.mkv]
Stripping invalid characters from new path: /home/bob/plex1/films/********** (2016) - Eng AC3+ 5.1 4 804 kb/s Fr Atmos / TrueHD 4 804 kb/s 5.1
[SYMLINK] Rename [/home/bob/torrents/seed/test/The*********.2016.MULTi.TRUEFRENCH.1080p.BluRay.TrueHD.Atmos.7.1x264.AC3-****.mkv] to [/home/bob/plex1/films/**********(2016) - Eng AC3+ 5.1 4 804 kb/s Fr Atmos/TrueHD 4 804 kb/s 5.1.mkv]
Processed 1 files
Thanks for the answer, i will be grateful ;)

Re: Amc "/" invalid character filename output

Posted: 06 Jan 2017, 10:31
by rednoah
1.
The String.slash() built-in helper allows you to remove slashes from String objects:

Code: Select all

audio[0].BitRateString.slash('')

2.
Use @files to pass complex format expressions:
viewtopic.php?f=3&t=3244


3.
You use {af} and go crazy with String.replace() when {channels} would do just fine:

Code: Select all

{channels}
Note that the {af} and {channels} bindings are based on Audio Stream #1 so neither is technically applicable for what you're trying to do.


4.
Your format is complex, repetitive and generally unreadable or maintainable.

This is probably more or less what you're trying to express:

Code: Select all

audio.collect{ [it.languageString3.upperInitial(), it.codec, (it.channels as int) - 1 + '.1', (it.BitRate as int) / 1000 + ' kbs'] }.join(' ')

Re: Amc "/" invalid character filename output

Posted: 06 Jan 2017, 11:29
by django69
like this ?

Code: Select all

sh /home/bob/.filebot/filebot.sh --lang fr -script fn:amc --output "/home/bob/plex1" --log-file "/home/bob/.temp/filmslog1.log" --action symlink --def ignore=ISO --def subtitles=fr --conflict auto --def reportError=y -non-strict --def unsorted=y --def gmail=*************************** --def "movieFormat={output}/films/{n} ({y}) - {audio.collect{ [it.languageString3.upperInitial(), it.codec, (it.channels as int) - 1 + '.1', (it.BitRate as int) / 1000 + ' kbs'] }.join(' ')}" "ut_dir=/home/bob/torrents/seed/test" "ut_kind=multi" "ut_title=$TORRENT_NAME" "ut_label=films" &
Seems working when have only one audio

like this one : ********* (2016) - [Eng, AC3, 5.1, 640 kbs].mkv

but with multi-audio i have this output :

Code: Select all

Rename movies using [TheMovieDB]
Auto-detect movie from context: [/home/bob/torrents/seed/test/**********.2016.MULTi.TRUEFRENCH.1080p.BluRay.TrueHD.Atmos.7.1x264.AC3-***.mkv]
[SYMLINK] Rename [/home/bob/torrents/seed/test/**************.2016.MULTi.TRUEFRENCH.1080p.BluRay.TrueHD.Atmos.7.1x264.AC3-*****.mkv] to [/home/bob/plex1/films/******(2016) -.mkv]
Processed 1 files

Re: Amc "/" invalid character filename output

Posted: 06 Jan 2017, 11:49
by rednoah
Please use the Format Editor GUI to prototype and debug formats. It'll tell you the reason why an expression may have failed. Probably because some MediaInfo like language being undefined.


e.g. this format will always work, and silently catch and ignore errors:

Code: Select all

{audio.collect{ a -> allOf{ a.languageString3.upperInitial() }{ a.codec }{ a.channels.toInteger() - 1 + '.1' }{ a.bitRate.toInteger() / 1000 + ' kbs'} }.join(' ')}