Running FileBot from the console, Groovy scripting, shell scripts, etc
MickeMM
Posts: 48 Joined: 03 Apr 2019, 10:52
Post
by MickeMM » 10 Dec 2019, 21:47
Hello!
Im using this code and everything works. But i have some problem with unfinish downloads that also copies.
Code: Select all
#!/bin/bash
PATH=/root:/usr/bin:/bin:/sbin:/home/micke
filebot -script fn:amc --output "/home/micke/rtorrent/test" --action duplicate --conflict skip -non-strict "/home/micke/rtorrent/download/filmer/svensk_text" --log-file amc_film.log --def excludeList=amc_filmer.txt --def ut_label=Movie --def movieFormat="/home/micke/rtorrent/test/film/{plex}";
filebot -script fn:amc --output "/home/micke/rtorrent/test" --action duplicate --conflict skip -non-strict "/home/micke/rtorrent/download/animerat" --log-file amc_animerat.log --def excludeList=amc_animerat.txt ut_label=Movie --def movieFormat="/home/micke/rtorrent/test/animerat/{plex}";
filebot -script fn:amc --output "/home/micke/rtorrent/test" --action duplicate --conflict skip -non-strict "/home/micke/rtorrent/download/serier" --log-file amc_serie.log --def excludeList=amc_serier.txt --def ut_label=TV --def seriesFormat="/home/micke/rtorrent/test/serie/{plex}";
filebot -script fn:amc --output "/home/micke/rtorrent/test" --action duplicate --conflict skip -non-strict "/home/micke/rtorrent/download/filmer/boxar" --log-file amc_boxar.log --def excludeList=amc_boxar.txt ut_label=Movie --def movieFormat="/home/micke/rtorrent/test/boxar/{plex}";
exit 0
Any solution how i can fix it?
Im using rtorrent and rtorrent-postprocess.sh
Regards
rednoah
The Source
Posts: 23957 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 11 Dec 2019, 00:24
You'll need to separate complete / incomplete downloads. You're calling the
amc script so it's your responsibility to not command it to process unfinished downloads.
Typically, the
amc script is called on newly completed downloads only, not your entire downloads folder, that's what the
rtorrent-postprocess.sh glue logic script does:
https://github.com/filebot/plugins/blob ... process.sh
MickeMM
Posts: 48 Joined: 03 Apr 2019, 10:52
Post
by MickeMM » 11 Dec 2019, 01:00
Thanks!
I have searching but couldn't find any solution for that. I only use rss for my downloads.
Maybe you know?
rednoah
The Source
Posts: 23957 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 11 Dec 2019, 10:40
If you're using rT, then this:
viewtopic.php?f=4&t=215#p5316
How you pass torrents into rT is irrelevant as far as post-processing scripts are concerned.
MickeMM
Posts: 48 Joined: 03 Apr 2019, 10:52
Post
by MickeMM » 31 Dec 2019, 00:21
It is possible to do this, with one line of code?
filebot
-Animated
-All other movies
-TV shows
Thanks!
rednoah
The Source
Posts: 23957 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 31 Dec 2019, 00:25
Yes, that's how most people use the
amc script . Though doing different calls for different types of content isn't a bad idea. Makes it easier to reason about things, and less auto-detection means lower chance on incorrect auto-detection.
MickeMM
Posts: 48 Joined: 03 Apr 2019, 10:52
Post
by MickeMM » 31 Dec 2019, 00:29
Thanks!
I have read some links but cant understand really how the script should look like.
I use the code above and dosent know how i should change it.
MickeMM
Posts: 48 Joined: 03 Apr 2019, 10:52
Post
by MickeMM » 31 Dec 2019, 01:42
Im trying this, but "Open Season" animated movie goes to moviefolder and not animated folder.
filebot -script fn:amc --output "/home/micke/rtorrent/test" --action duplicate --conflict auto -non-strict "/home/micke/rtorrent/download" --log-file amc_film.log --def excludeList=amc_filmer.txt --def movieFormat="/home/micke/rtorrent/test/film/{plex}" seriesFormat="/home/micke/rtorrent/test/serie/{plex}" animeFormat="/home/micke/rtorrent/test/animerat/{plex}";
kim
Power User
Posts: 1251 Joined: 15 May 2014, 16:17
Post
by kim » 31 Dec 2019, 02:20
you cant do this with only {plex}... you need a custom format like this:
Code: Select all
{genres.contains(/Animation/) ? 'animerat/' : 'moviefolder/'}{plex.tail}
output:
animerat/Open Season (2006)/Open Season (2006)
MickeMM
Posts: 48 Joined: 03 Apr 2019, 10:52
Post
by MickeMM » 31 Dec 2019, 03:22
kim wrote: ↑ 31 Dec 2019, 02:20
you cant do this with only {plex}... you need a custom format like this:
Code: Select all
{genres.contains(/Animation/) ? 'animerat/' : 'moviefolder/'}{plex.tail}
output:
animerat/Open Season (2006)/Open Season (2006)
Thanks for the help.
I cant get it to work, dont know what im doing wrong
Code: Select all
filebot -script fn:amc --output "/home/micke/rtorrent/test" --action duplicate --conflict auto -non-strict "/home/micke/rtorrent/download" --log-file amc_film.log --def excludeList=amc_filmer.txt --def movieFormat="/home/micke/rtorrent/test/film/{plex}" seriesFormat="/home/micke/rtorrent/test/serie/{plex}" animeFormat="/home/micke/rtorrent/test/animerat/{genres.contains(/Animation/) ? 'animerat/' : 'Movies/'}{plex.tail}";
Open Season (
https://www.imdb.com/title/tt0400717 ) stil comes in the /test/film/ folder and not /test/animerat
rednoah
The Source
Posts: 23957 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 31 Dec 2019, 10:53
Anime refers to Japanese Animated TV Series for which episode listings are available on AniDB , and
not American Animated Movies which are just movies on TheMovieDB like any other movie.
rednoah wrote: ↑ 01 Aug 2012, 13:04
Anime are inherently TV Shows, so Anime will only be detected as Anime and processed with AniDB if the files have
Anime-like characteristics .
Does your file have
Anime-like characteristics ? If yes, it will be processed as Anime, if not it will not be processed as Anime.
Please read the console output carefully. The console output will tell you which path is taken, and which database / format is being used. Presumably, your
--def animeFormat isn't used, because none of your content is Anime
(i.e. Japanese Animated TV Series, not Animated American Movies) .
rednoah
The Source
Posts: 23957 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 31 Dec 2019, 11:12
MickeMM
Posts: 48 Joined: 03 Apr 2019, 10:52
Post
by MickeMM » 31 Dec 2019, 12:37
Nop! I have not test it in gui, i have ubuntu server.
Ok, so if im understand this correct it wont work to take animated movie and put them in a folder and rest of the movie in moviefolder.
rednoah
The Source
Posts: 23957 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 31 Dec 2019, 13:15
It's perfectly
possible to movie different movies into different folders, based on arbitrary conditions, for example, based
{genres} , as explained by kim previously:
viewtopic.php?f=4&t=11323#p47707
If
genres contains
Animation , then use
Animated Movies folder, otherwise use
Movies folder.
MickeMM
Posts: 48 Joined: 03 Apr 2019, 10:52
Post
by MickeMM » 31 Dec 2019, 15:07
Thanks for the help. Everything works now.
Code: Select all
filebot -script fn:amc --output "/home/micke/rtorrent/test/" --action duplicate --conflict auto -non-strict "/home/micke/rtorrent/download" --log-file amc_film.log --def excludeList=amc_filmer.txt --def ignore="dansk_text" --def movieFormat="/home/micke/rtorrent/test/{/Animation/ in genres ? 'animerat/Movies' : 'film/Movies'}/{plex.tail}" seriesFormat="/home/micke/rtorrent/test/serie/{plex}";
I only have one problem left
This movie
https://www.themoviedb.org/movie/602797 hasen't any genre and was placed in /test/ folder (root of output).
rednoah
The Source
Posts: 23957 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 31 Dec 2019, 15:53
You can catch the
"genres is undefined" corner case like so:
Code: Select all
{any{/Animation/ in genres ? 'Animated Movies' : 'Movies'}{'No Genres Movies'}}/{plex.tail}
MickeMM
Posts: 48 Joined: 03 Apr 2019, 10:52
Post
by MickeMM » 31 Dec 2019, 23:37
I'm grateful for the help. Thank you and a Happy New year to u and all members!
MickeMM
Posts: 48 Joined: 03 Apr 2019, 10:52
Post
by MickeMM » 04 Jan 2020, 13:34
I have a new problem
This is my rtorrent code:
Code: Select all
method.set_key=event.download.finished,filebot,"execute={/home/micke/rtorrent-postprocess.sh,$d.base_path=,$d.name=,$d.custom1=}"
This is my code in rtorrent-postprocess.sh
Code: Select all
filebot -script fn:amc --output "/home/micke/rtorrent/test/" --action duplicate --conflict auto -non-strict "/home/micke/rtorrent/download" --log-file amc_film.log --def excludeList=amc_filmer.txt --def ignore="dansk_text" --def movieFormat="/home/micke/rtorrent/test/{any{/Animation/ in genres ? 'animerat/Movies' : genres =~ /Documentary/? 'dokumentar/Movies' : 'film/Movies'}{'film/Movies'}}/{plex.tail}" seriesFormat="/home/micke/rtorrent/test/serie/{plex}"
Now to my problem
1. As i understand filebot should only work with downloaded movies, but my take movies that are not completely downloaded to.
2. Lately filebot make cd1 and cd2, why and how can i remove it so it wont (if it possible).
Regards
rednoah
The Source
Posts: 23957 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 04 Jan 2020, 13:45
1.
Why not use the official integration / model solution?
viewtopic.php?p=5316#p5316
Code: Select all
#!/bin/sh -xu
# Input Parameters
ARG_PATH="$1"
ARG_NAME="$2"
ARG_LABEL="$3"
# Configuration
CONFIG_OUTPUT="$HOME/Media"
filebot -script fn:amc --output "$CONFIG_OUTPUT" --action duplicate --conflict skip -non-strict --log-file amc.log --def unsorted=y music=y artwork=y excludeList=".excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL" &
I'd start with the official solution, and the customize it for your needs. This code will only process the newly completed files, as opposed to your code, which always processes your entire download folder whenever any download is completed.
2.
CD1/2 is part of
{plex} . If you have multi-part movies, each part will end up with the same name, if you remove the CD1/2 bit, and then the CD2 file will override the CD1 file, as you can't have 2 files with the exact same file path.
MickeMM
Posts: 48 Joined: 03 Apr 2019, 10:52
Post
by MickeMM » 04 Jan 2020, 14:07
Thanks!
I will try to change my code ...
Okej, before i never seen any cd1 and cd2, it sins i change my code.
As it is now, i have on my google "movie" "movie.cd1" "Moviecd2" and all subfiles.
rednoah
The Source
Posts: 23957 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 04 Jan 2020, 14:09
MickeMM wrote: ↑ 04 Jan 2020, 14:07
Okej, before i never seen any cd1 and cd2, it sins i change my code.
As it is now, i have on my google "movie" "movie.cd1" "Moviecd2" and all subfiles.
Well, if you paste the relevant logs on pastebin, I'll have a look and interpret them for you.
MickeMM
Posts: 48 Joined: 03 Apr 2019, 10:52
Post
by MickeMM » 04 Jan 2020, 14:18
Is this correct?
Code: Select all
# Configuration
CONFIG_OUTPUT="/home/micke/rtorrent/test"
filebot -script fn:amc --output "$CONFIG_OUTPUT" --action duplicate --conflict auto -non-strict --log-file amc.log --def excludeList=".excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL" --def ignore="dansk_text" --def movieFormat="$CONFIG_OUTPUT/{any{/Animation/ in genres ? 'animerat/Movies' : genres =~ /Documentary/? 'dokumentar/Movies' : 'film/Movies'}{'film/Movies'}}/{plex.tail}" seriesFormat="$CONFIG_OUTPUT/serie/{plex}" &
MickeMM
Posts: 48 Joined: 03 Apr 2019, 10:52
Post
by MickeMM » 04 Jan 2020, 14:34
It works
Code: Select all
# Configuration
CONFIG_OUTPUT="/home/micke/rtorrent/test/"
filebot -script fn:amc --output "$CONFIG_OUTPUT" --action duplicate --conflict auto -non-strict --log-file amc.log --def excludeList=".excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL" --def ignore="dansk_text" --def movieFormat=""$CONFIG_OUTPUT"{any{/Animation/ in genres ? 'animerat/Movies' : genres =~ /Documentary/? 'dokumentar/Movies' : 'film/Movies'}{'film/Movies'}}/{plex.tail}" seriesFormat=""$CONFIG_OUTPUT"/serie/{plex}" &
Thanks for helping me!..
Regards and a heart!