integration of postnamed foldar with sonarr and radarr

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
lukjod
Posts: 35
Joined: 13 Jul 2014, 18:53

integration of postnamed foldar with sonarr and radarr

Post by lukjod »

As seen here that should be easy but unfortunately is not working quite smooth as it probably can.
Here is section describing how to set both programs https://github.com/Radarr/Radarr/wiki/C ... ie#filebot but in my case is problem with resolution, audio codec, audio channels which both scripts rename different.

eg filebot [{vf}, {ac}, {af}] gives [1080p, AC3, 2ch]
while radarr {Movie Title} ({Release Year}) [{Quality Title}, {MediaInfo AudioCodec}, {MediaInfo AudioChannels}] gives [Bluray-1080p, AC3, 2.0] in same sample.

After that filebot simply creates different folder and on disc i have 2 movie folders due to radarr taking info from my transmission client of finished download and rename it with these pattern.
For now i take simply name pattern as only name and year and then 2 programs work with same folder and files name but want to have more movie info like above. Is this possible to easy connect those programs to work together?

Any help appreciated
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: integration of postnamed foldar with sonarr and radarr

Post by rednoah »

If you want to yield a value like this:

Code: Select all

[Bluray-1080p, AC3, 2.0]

Here's a FileBot format snippet that will give you just that:

Code: Select all

{[source+'-'+vf, ac, channels]}

:!: You may have to adjust and fine-tune your FileBot format over time to ensure it yields the exact same file path that sonarr would expect for a given file.
:idea: Please read the FAQ and How to Request Help.
lukjod
Posts: 35
Joined: 13 Jul 2014, 18:53

Re: integration of postnamed foldar with sonarr and radarr

Post by lukjod »

ok, thx for this

Can You also show me the pattern to get BluRay instead of Bluray or WEB-DL instead of Webdl in Filebot so I can prepare valid expressions for radarr as i can´t find any possibility to change theis name scheme on github nor their forum. Probably String.replaceAll(pattern, replacement) can do the job?

thx in advance
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: integration of postnamed foldar with sonarr and radarr

Post by rednoah »

lukjod wrote: 25 Aug 2019, 17:56 BluRay instead of Bluray or WEB-DL instead of Webdl in Filebot
e.g.

Code: Select all

source.replace('Bluray':'BluRay', 'Webdl':'WEB-DL')
:idea: Please read the FAQ and How to Request Help.
lukjod
Posts: 35
Joined: 13 Jul 2014, 18:53

Re: integration of postnamed foldar with sonarr and radarr

Post by lukjod »

thx
lukjod
Posts: 35
Joined: 13 Jul 2014, 18:53

Re: integration of postnamed foldar with sonarr and radarr

Post by lukjod »

another small problem, filebot doesnt want to copy and replace file into folder created by radarr.
Is any way to force it to copy anyway or at least continue to work further and download additional info and subs?

script:

Code: Select all

/share/CACHEDEV1_DATA/.qpkg/filebot/bin/filebot.sh -script fn:amc "/share/CACHEDEV1_DATA/Download/transmission/completed" --output "/share/CACHEDEV1_DATA/Download" --log-file amc.log  --action copy --conflict override -non-strict --lang en --def minFileSize=50000000 artwork=y subtitles=pl,en plex=192.168.1.197:Eqxxxxxxxxxxxxx [email protected]:xxxxxxxxxxxx [email protected] --def exec="/share/CACHEDEV1_DATA/.qpkg/filebot/sonarr_refresh.sh" "excludeList=filebot_processed_files.txt" "musicFormat=Music/{n}/{t}" "seriesFormat=Series/{n}/Season {s.pad(2)}/{n} - {s00e00} - {t}{'.'+lang.ISO2}" "movieFormat=Movies/{n} ({y}) {[source.replace('BluRay':'Bluray', 'WEB-DL':'WEBDL')+'-'+vf, ac, channels]}/{n} ({y}){'.'+lang.ISO2}"
log:

Code: Select all

Run script [fn:amc] at [Fri Aug 30 16:34:09 GMT 2019]
Parameter: minFileSize = 50000000
Parameter: artwork = y
Parameter: subtitles = pl,en
Parameter: plex = *****
Parameter: gmail = *****
Parameter: mailto = *****
Parameter: exec = /share/CACHEDEV1_DATA/.qpkg/filebot/sonarr_refresh.sh
Parameter: excludeList = filebot_processed_files.txt
Parameter: musicFormat = Music/{n}/{t}
Parameter: seriesFormat = Series/{n}/Season {s.pad(2)}/{n} - {s00e00} - {t}{'.'+lang.ISO2}
Parameter: movieFormat = Movies/{n} ({y}) {[source.replace('BluRay':'Bluray', 'WEB-DL':'WEBDL')+'-'+vf, ac, channels]}/{n} ({y}){'.'+lang.ISO2}
Argument[0]: /share/CACHEDEV1_DATA/Download/transmission/completed
Use excludes: /share/CACHEDEV1_DATA/Download/filebot_processed_files.txt (1)
Ignore orphaned subtitles: /share/CACHEDEV1_DATA/Download/transmission/completed/Dark.Phoenix.2019.1080p.BluRay.H264.AAC-RARBG/Subs/2_English.srt
Input: /share/CACHEDEV1_DATA/Download/transmission/completed/Dark.Phoenix.2019.1080p.BluRay.H264.AAC-RARBG/Dark.Phoenix.2019.1080p.BluRay.H264.AAC-RARBG.mp4
Input: /share/CACHEDEV1_DATA/Download/transmission/completed/Dark.Phoenix.2019.1080p.BluRay.H264.AAC-RARBG/Subs/Dark.Phoenix.2019.1080p.BluRay.H264.AAC-RARBG.idx
Input: /share/CACHEDEV1_DATA/Download/transmission/completed/Dark.Phoenix.2019.1080p.BluRay.H264.AAC-RARBG/Subs/Dark.Phoenix.2019.1080p.BluRay.H264.AAC-RARBG.sub
Group: [Movie:Dark Phoenix (2019)] => [Dark.Phoenix.2019.1080p.BluRay.H264.AAC-RARBG.mp4, Dark.Phoenix.2019.1080p.BluRay.H264.AAC-RARBG.idx, Dark.Phoenix.2019.1080p.BluRay.H264.AAC-RARBG.sub]
Get [Polish] subtitles for 1 files
Looking up subtitles by hash via OpenSubtitles
No matching subtitles found: /share/CACHEDEV1_DATA/Download/transmission/completed/Dark.Phoenix.2019.1080p.BluRay.H264.AAC-RARBG/Dark.Phoenix.2019.1080p.BluRay.H264.AAC-RARBG.mp4
Get [English] subtitles for 1 files
Looking up subtitles by hash via OpenSubtitles
Failed to read video properties: NumberFormatException: For input string: "2997/125"
Fetching [English] subtitles [Dark.Phoenix.2019.720p.BluRay.x264-GECKOS.srt] from [OpenSubtitles]
Export [Dark.Phoenix.2019.720p.BluRay.x264-GECKOS.srt] as [SubRip / UTF-8]
Writing [Dark.Phoenix.2019.720p.BluRay.x264-GECKOS.srt] to [Dark.Phoenix.2019.1080p.BluRay.H264.AAC-RARBG.eng.srt]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/share/CACHEDEV1_DATA/Download/transmission/completed/Dark.Phoenix.2019.1080p.BluRay.H264.AAC-RARBG/Dark.Phoenix.2019.1080p.BluRay.H264.AAC-RARBG.mp4]
Processed 0 files
CmdlineException: Failed to process [/share/CACHEDEV1_DATA/Download/transmission/completed/Dark.Phoenix.2019.1080p.BluRay.H264.AAC-RARBG/Dark.Phoenix.2019.1080p.BluRay.H264.AAC-RARBG.mp4] because [/share/CACHEDEV1_DATA/Download/Movies/Dark Phoenix (2019) [Bluray-1080p, AAC, 5.1]/Dark Phoenix (2019).mp4] is an exact copy and already exists [Last-Modified: Fri Aug 30 16:33:52 GMT 2019]
Finished without processing any files
Abort (×_×)
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: integration of postnamed foldar with sonarr and radarr

Post by rednoah »

Code: Select all

CmdlineException: Failed to process [...] because [...] is an exact copy and already exists [...]
FileBot does not allow you to process the same file over and over, as that's most likely the result of haywire automation that is repeatedly doing the same thing over and over indefinitely.


:?: You'll need to rethink and adjust your logic. How exactly did you manage to process the exact same file twice even though --def excludeList typically ensures that this can't happen?


:idea: If you want to fetch extra subtitles or artwork for files downloaded & organized by 3rd party applications, then the amc script is not your friend. There's dedicated scripts for adding subtitles and artwork to existing file structures.
:idea: Please read the FAQ and How to Request Help.
lukjod
Posts: 35
Joined: 13 Jul 2014, 18:53

Re: integration of postnamed foldar with sonarr and radarr

Post by lukjod »

the problem is that radarr takes name from transmission and creates hardlink to downloaded contents and changes name to same as filebot will based on given example in amc script trigger. So filebot sees that folder processed by radarr and stop function. So i see that it is not possibe to run both of scripts pararerly and must turn off renaming by radarr and then manually import folder created by filebot to radarr to stop watching for new releases unless there is other way which i dont know
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: integration of postnamed foldar with sonarr and radarr

Post by rednoah »

Why does the FileBot output folder have to be same as the radarr output folder?
:idea: Please read the FAQ and How to Request Help.
lukjod
Posts: 35
Joined: 13 Jul 2014, 18:53

Re: integration of postnamed foldar with sonarr and radarr

Post by lukjod »

Because radarr monitors this folder for further download of better copy/ quality and if download by client (in my case transmission was successful). For this it can change original name of folder file and writes it in its database. I tried to connect radarr and sonarr with filebot in this way that it wont create 2 folders of same movie (1 with its name radarr and second filebot) which gives to copy of same movie in eg plex. The best way would be to keep folder and movie name totally the same and produce only 1 instantiation of it . Thats why i asked how to change quality names to be exact as in radar.

Its better explained here https://github.com/Radarr/Radarr/wiki/C ... Each-Movie

in my case filebot stops not because it calls file many times, as just before it can start its magic radarr creates hardlink with exact name and fools filebot. it is not called automatically by mistake but just integration of both programs need this

Hope it helps to better understand what i want to achieve here

Could it be a switch in program as eg --def radarr which lets program once overwrite file and later list.txt with proceeded files wont let it work with that file again?
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: integration of postnamed foldar with sonarr and radarr

Post by rednoah »

Keep things separate. Since we're hard linking everything, you can have the same file all over the place many times. You can have separate output folders for all your different tools.

:arrow: Golden Rule: FileBot processes everything. The only tool that touches the Plex Media Folder is FileBot.

If you use Deluge / Radarr / Sonarr / etc that's all fine. You can hook all of them up with FileBot, so that regardless of where a file comes from, the final operation that links it into the Plex Media Folder is always FileBot and only ever FileBot.

You can then have some other integration between Deluge <-> Radarr <-> etc prior to FileBot being called by one of these tools on the final download.
:idea: Please read the FAQ and How to Request Help.
Post Reply