Page 1 of 1

Filebot and Sonarr Import Again v2

Posted: 02 May 2020, 18:26
by alias
Hey guys

Using filebot-node

Trying to get it to call Sonarr for importing afterwards and having some trouble!

Working from this older thread
viewtopic.php?f=8&t=6309&start=25

This talks about another script
https://github.com/JourneyDeprecated/fi ... rapper.pyw

I'm trying to bring this into Filebot-node by taking the Update_Sonarr_Radarr.groovy script part.

My Series Format command
{plex.derive{' '+tags}{' '+allOf{vf}{vs}{vc.replace('AVC':'x264', 'HEVC':'x265')}{ac}{af}{mbps}}}

I think I need update script under AMC section


https://imgur.com/FnbPsWs

Re: Filebot and Sonarr Import Again v2

Posted: 02 May 2020, 19:24
by rednoah
Where are you stuck?
Is your --def exec command called?
Is your command called as expected?
Is your script working as expected when called?
What does the console output say?


:idea: Using --def exec to make a simple curl call that sends a request to update everything might be easier. There might be existing solutions unrelated to FileBot that you can just copy & paste.

Re: Filebot and Sonarr Import Again v2

Posted: 02 May 2020, 22:10
by alias

Code: Select all

-script
fn:amc
/volume2/nzbget/complete/TV Shows
--output
/volume1/local/plex/
--action
move
-non-strict
--order
Airdate
--conflict
auto
--lang
en
--def
ut_label=TV
subtitles=eng
clean=y
skipExtract=y
minLengthMS=300000
exec=filebot -script /data/filebot-node/.filebot/sonarr_radarr.groovy --def type={type} id={id}
seriesFormat={plex.derive{'  '+tags}{' '+allOf{vf}{vs}{vc.replace('AVC':'x264', 'HEVC':'x265')}{ac}{af}{mbps}}} 
--apply
refresh
--log
all
--log-file
/data/.filebot-node/filebot.log
Is your --def exec command called? Yes
Is your command called as expected? No
Is your script working as expected when called? No
What does the console output say?
See below

Code: Select all

Processed 1 files
Execute: filebot -script /data/filebot-node/.filebot/sonarr_radarr.groovy --def type=Episode id=262407
Bad script source: /data/filebot-node/.filebot/sonarr_radarr.groovy
Failure (×_×)⌒☆
Clean clutter files and empty folders
Delete /volume2/nzbget/complete/TV Shows/Black.Sails.S03E05.XXIII.1080p.BluRay.DD5.1.x264-SA89
Done ヾ(@⌒ー⌒@)ノ
Really looking for a solution to this. I just get some issuies with sonar not matching up downloads

Re: Filebot and Sonarr Import Again v2

Posted: 03 May 2020, 08:15
by rednoah
Well, I can only say that executing local scripts fundamentally works:

Code: Select all

echo 'println "Hello World"' > hello.groovy
filebot -script ./hello.groovy
Hello World

:idea: Educated guess, /data/filebot-node/.filebot/sonarr_radarr.groovy doesn't exist, or appears to not exist due to permissions.


If you think that this file exists and is readable, then you can test your assumption like so:

Code: Select all

--def exec="cat /data/filebot-node/.filebot/sonarr_radarr.groovy"

EDIT:

:?: Are you using docker? Because the OP doesn't indicate that you're using docker. You wouldn't expect there to be a /data root folder on a typical Linux system.

Re: Filebot and Sonarr Import Again v2 - WORKING

Posted: 05 May 2020, 00:50
by alias
Thanks, Rednoah. I added execute permissions no the groovy script just to be sure

Going to break convention and post my answer!

Main Helpful Links posts
  • Replication this in filebot-node with some trial and error worked

    This is my current working copy of my filebotnode config & then my task

    Code: Select all

      filebotnode:
        image: rednoah/filebot:node
        hostname: ********.uk
        container_name: filebotnode
        restart: always
        environment:
          - TZ=Europe/London
          - PGID=1000
          - PUID=1000
        user: 1000:1000
        ports:
          - 5452:5452
        volumes:
          - /home/plex/.config/filebotnode:/data
          - /home/plex/data:/volume1
          - /home/plex/downloads:/volume2
        expose:
          - 443
    
    I'm about 6 weeks into docker but from trial and error, I need the PGID, PUID & user values - for the container to work.
    Without the user value, all the files were renamed with root permissions

    Code: Select all

    -script
    fn:amc
    /volume2/nzbget/complete/TV Shows
    --output
    /volume1/local/plex/
    --action
    move
    -non-strict
    --order
    Airdate
    --conflict
    auto
    --lang
    en
    --def
    ut_label=TV
    subtitles=eng
    clean=y
    skipExtract=y
    minLengthMS=300000
    exec=filebot -script /data/.filebot-node/sonarr_radarr.groovy --def type={type} id={id}
    seriesFormat={plex.derive{'  '+tags}{' '+allOf{vf}{vs}{vc.replace('AVC':'x264', 'HEVC':'x265')}{ac}{af}{mbps}}}
    --apply
    refresh
    --log
    all
    --log-file
    /data/.filebot-node/filebot.log

    Other Helpful Links Good luck, next quest - Collections!

    Stay safe all

Re: Filebot and Sonarr Import Again v2

Posted: 05 May 2020, 06:23
by rednoah
You're using --action move with separate volumes for input / output folders. So the docker container will see that as physically different file systems, and so the OS will physically copy and then delete files, instead of moving them instantly:

Code: Select all

    volumes:
      - /home/plex/.config/filebotnode:/data
      - /home/plex/data:/volume1
      - /home/plex/downloads:/volume2

Re: Filebot and Sonarr Import Again v2

Posted: 07 May 2020, 22:47
by alias
I was just thinking about this and saw your post.

Will update them tomorrow

Thanks