Page 21 of 41

Re: Exclude Blacklist & Series-Mappings

Posted: 19 Sep 2017, 02:03
by rednoah
No. This one will require a little bit of time and testing. It's on my backlog for the weekend though.

EDIT:

Implemented but not tested for regression issues.

Re: [SNAP] Grant access to /media

Posted: 26 Sep 2017, 03:54
by ironcity1861
only 25 minutes after a reinstall I realized this is why it wasn't working!

Re: Q&A for n00bs

Posted: 05 Oct 2017, 19:46
by b0ssem
Hey guys,

I have been using Filebot for some time now but only drag and drop style. So now im moving on to the automated worlds. Please bear with me.

I have started off gently by creating a .bat-file that gets run atomatically when my files get extracted by another software im using. So when the extraction is complete is calls the .bat-script and executes the line below.

This is what i have started out with

Code: Select all

filebot -script fn:amc --output "N:\Done" --action copy -non-strict "N:\TV-IN" --log-file amc.log --def skipExtract=y --def excludeList=amc.txt
Kinda simple, nothing fancy. But there is a few things here that im wondering over.

1. Can I define the script to use any of my presets I have made in Filebot? Some of my swedish TV-Shows get named in english. I want them in Swedish. At the moment i have 2 presets. TV and Movie.

2. Is it possible to make the script to copy the files directly to N:\Done\TV Shows. Instead of how its doing now N:\Done\Tv Shows\ Tvshowname\Season13\

I think that will be good for now.

Thanks in advanced!

Re: Q&A for n00bs

Posted: 05 Oct 2017, 20:10
by rednoah
1.
Yes, you can set custom formats and language preferences via command-line options.

2.
I think you're talking about a custom format that might look something like this:

Code: Select all

N:\Done\{plex.name}

Re: Q&A for n00bs

Posted: 05 Oct 2017, 21:17
by b0ssem
rednoah wrote: 05 Oct 2017, 20:10 1.
Yes, you can set custom formats and language preferences via command-line options.

2.
I think you're talking about a custom format that might look something like this:

Code: Select all

N:\Done\{plex.name}
Thanks for you fast reply!

I will check up on the custom formats and language.

Regarding the custom formats, I did a little test and edited my line as you proposed.

Code: Select all

filebot -script fn:amc --output "N:\Done\{plex.name}" --action copy -non-strict "N:\TV-IN" --log-file amc.log --def skipExtract=y --def excludeList=amc.txt
But i got this error when running
Illegal usage: output folder must exist and must be a directory: N:\Done\{plex.name}

Re: Q&A for n00bs

Posted: 05 Oct 2017, 22:42
by rednoah
1.
--output and --format have distinctively different meanings and functions.

e.g.

Code: Select all

-rename --output N:\Done --format {plex.name}
@see https://www.filebot.net/cli.html


2.
Since you're using the amc script, you'll want to read Change how files will be organized and renamed because you'll need to pass in a custom format for each media type via the --def <type>Format options.

Re: Batch Rename any type of file

Posted: 06 Oct 2017, 21:22
by dadelayer
Thanks!. I tested it out using the example and it worked fine. However, when I use it with my XML file (I converted the JSON > XML), it says my format is not correct.
I use the same format and code as the example

Re: Batch Rename any type of file

Posted: 07 Oct 2017, 07:42
by rednoah
The example here is very specific. You can learn from it, but you can't copy-and-paste and expect it to work in your case. ;)

If you start by learning how to parse JSON, then you're on the right track:
http://docs.groovy-lang.org/latest/html ... urper.html

:idea: You can hire me though, but you'd need to write down exactly what you need, with examples and example data.

Re: Batch Rename any type of file

Posted: 07 Oct 2017, 08:09
by dadelayer
Well, I wanted to try it in XML since I wanted to use your example, but not coming up with anything.

Code: Select all

def fnn = fn
xml = new XmlSlurper().parse(folder+'/mov.xml')
xml.'**'.find { it.name() == 'scid' && it.text() == fnn}*.parent()*.title*.text()
that should return the title but it's not working as its supposed to. I don't have the money to hire :\ it seems expensive :(

Re: Batch Rename any type of file

Posted: 07 Oct 2017, 10:14
by rednoah
Just debug step by step. Does it parse? Is the first element what you think it should be?

You can prototype and debug these things in the Format Editor in minutes. Just try things and narrow down which exact piece of code isn't working as expected. ;)

Re: [SNAP] Grant access to /media

Posted: 21 Oct 2017, 19:10
by brunorene
I have a NAS mounted using cifs and Im not able to access the files on it... Is that possible?

Im using

/etc/fstab with the config

Code: Select all

//192.168.1.14/nas /media/nas cifs uid=user,gid=user,iocharset=utf8,file_mode=0660,dir_mode=0770,username=username,password=password 0 0
I have already tried --devmode
and

Code: Select all

sudo snap connect filebot:removable-media
sudo snap connect filebot:network
sudo snap connect filebot:network-bind
Regards

Re: Batch Rename any type of file

Posted: 24 Oct 2017, 12:51
by Delmano
This is so useful. Thanks for the tutorial Noah, helps newbies like me a lot.

Re: How about sharing our format expressions?

Posted: 13 Dec 2017, 19:36
by yodaspowart
Have a basic script that uses the groovy setup for 4K content going into its own folder for Movies 4K & TV Shows 4K based on 2160p in file name else it goes to regular folders:

Code: Select all

#!/bin/bash

export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_CTYPE="en_US.UTF-8"

TORRENT_PATH="$TR_TORRENT_DIR/$TR_TORRENT_NAME"
TORRENT_NAME="$TR_TORRENT_NAME"
TORRENT_LABEL="N/A"

# Subtitle language
SUBLANG=en
SKIP_EXTRACT=n
MUSIC=y

filebot -script /opt/filebot/scripts/amc.groovy \
    --output "$HOME/media" \
    -non-strict --encoding utf8 --log all --log-file amc-transmission.log --action copy --conflict override \
    --def artwork=false ut_kind=multi "ut_dir=$TORRENT_PATH" "ut_title=$TORRENT_NAME" subtitles=$SUBLANG \
    --def "movieFormat={fn =~ /2160p/ ? 'Movies 4K' : 'Movies'}/{n} ({y})/{n} {hd} {vc} {vf} ({y}){' CD'+pi}{'.'+lang}" \
    --def "seriesFormat={fn =~ /2160p/ ? 'TV Shows 4K' : 'TV Shows'}/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {hd} - {vc} - {vf} - {t.replaceAll(/[\`´''ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part \$1')}{'.'+lang}" \
    extractFolder="$HOME/files/_extracted" music=$MUSIC skipExtract=$SKIP_EXTRACT &
Thinking of expanding this to Movies 3D, just need to figure out how to do an "OR".

Re: How about sharing our format expressions?

Posted: 13 Dec 2017, 20:35
by rednoah
Assuming that "3D" is part of the filename, this should do:

Code: Select all

{fn =~ /3D|2160p/ ? 'Movies 4K' : 'Movies'}

Re: How about sharing our format expressions?

Posted: 13 Dec 2017, 21:41
by yodaspowart
Thanks.
This is useful to know that the "OR" can be used like that if i needed to trigger variants for the Folder Movies 4K or Movies 3D.

Was thinking the "OR" could be used like:

IF filename has 3D it goes to folder named "Movies 3D" (1920x1080P)
IF filename has 2160p it goes to folder named "Movies 4K" (3840x2160P)
ELSE it goes to folder named "Movies" (< 1920x1080P)

Would it be this work?

Code: Select all

--def "movieFormat={fn =~ /2160p|4K|4k|UHD/ ? 'Movies 4K' : 'Movies'}{fn =~ /3D|3d|3dhsbs|H-SBS|3dhou|H-OU/ ? 'Movies 3D' : 'Movies'}/{n} ({y})/{n} {hd} {vc} {vf} ({y}){' CD'+pi}{'.'+lang}" \
Thanks rednoah

Re: [SNAP] Grant access to /media

Posted: 14 Dec 2017, 16:55
by pyropunk2006
Any idea how to get filebot to see mounted devices? Its on automount if that makes a difference.

Re: [SNAP] Grant access to /media

Posted: 14 Dec 2017, 19:25
by rednoah
It should work out of the box. What exactly isn't working?

Re: How about sharing our format expressions?

Posted: 14 Dec 2017, 19:28
by rednoah
More like this:

Code: Select all

fn =~ /2160p/ ? 'Movies 4K' : fn =~ /3D/ ? 'Movies 3D' : 'Movies'
You can nest ternary expressions and have lots of if-then-else that way.

Re: How about sharing our format expressions?

Posted: 14 Dec 2017, 22:33
by yodaspowart
Thanks rednoah, this perfect for me!

My new script:

Code: Select all

#!/bin/bash

export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_CTYPE="en_US.UTF-8"

TORRENT_PATH="$TR_TORRENT_DIR/$TR_TORRENT_NAME"
TORRENT_NAME="$TR_TORRENT_NAME"
TORRENT_LABEL="N/A"

# Subtitle language
SUBLANG=en
SKIP_EXTRACT=n
MUSIC=y

filebot -script /opt/filebot/scripts/amc.groovy \
    --output "$HOME/media" \
	-non-strict --encoding utf8 --log all --log-file amc-transmission.log --action copy --conflict override \
	--def artwork=false ut_kind=multi "ut_dir=$TORRENT_PATH" "ut_title=$TORRENT_NAME" subtitles=$SUBLANG \
    --def "movieFormat={fn =~ /2160p|4K|4k|UHD/ ? 'Movies 4K' : fn =~ /3D|3d|3dhsbs|H-SBS|3dhou|H-OU/ ? 'Movies 3D' : 'Movies'}/{n} ({y})/{n} {hd} {vc} {vf} ({y}){' CD'+pi}{'.'+lang}" \
    --def "seriesFormat={fn =~ /2160p|4K|4k|UHD/ ? 'TV Shows 4K' : 'TV Shows'}/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {hd} - {vc} - {vf} - {t.replaceAll(/[\`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part \$1')}{'.'+lang}" \
	extractFolder="$HOME/files/_extracted" music=$MUSIC skipExtract=$SKIP_EXTRACT &

Re: Exclude Blacklist & Series-Mappings

Posted: 19 Dec 2017, 13:05
by LouisF
Hi rednoah, thanks for the awesome work.

A new series by Amazon is not in tvdb, "Jean-Claude Van Johnson" : http://www.imdb.com/title/tt6682754/

Am I at the correct place to request this ? Thanks a lot,

Re: Exclude Blacklist & Series-Mappings

Posted: 19 Dec 2017, 15:39
by rednoah
You can go to TheTVDB if you want to add or edit series entries:
https://www.thetvdb.com/

This thread is for adding abbreviations that are not in TheTVDB.

Re: How about sharing our format expressions?

Posted: 25 Dec 2017, 05:03
by jebbe
I am absolutely no expert when it comes doing this, but am slowly learning and not trying to over complicate it for myself.

I mainly use FileBot for movies and nothing else. I've essentially used bits from already posted and kind of made it work for my own needs.

Code: Select all

W:\Movies ({vf})\{genre}\{primarytitle} ({y}){' ['+fn.replaceAll(/(?i)directors|theatrical|ultimate/,'$0 Cut').matchAll(/UNRATED|REMASTERED|EXTENDED|UNCUT|DIRECTORS.CUT|THEATRICAL.CUT|ULTIMATE.CUT|SPECIAL.EDITION/).join('][').upperInitial().lowerTrail()+']'} [{vf}] [{ac}{fn.match("-HD.MA.")+af}]/{primarytitle} ({y}) {vc}{" (CD$pi)"}{' '+lang}
This is what I currently have and is fine but I have all of my movies stored between two different drives labeled Y and W. I saw the snippet of code to tell Filebot to essentially use whichever drive has more free space to decide where to store said movies.

Code: Select all

{['C:', 'D:', 'E:'].collect{ (it+'/TV/'+n) as File }.sort{ a, b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace }.last()}/{episode}
I've tried to make this work with my current set up but it comes out weird. I've changed the TV part to movies and what I had for movies but it doesn't seem to work right.

Code: Select all

{['Y:', 'W:'].collect{ (it+'/Movies ({vf})/'+n) as File }.sort{ a, b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace }.last()}/{episode}\{genre}\{primarytitle} ({y}){' ['+fn.replaceAll(/(?i)directors|theatrical|ultimate/,'$0 Cut').matchAll(/UNRATED|REMASTERED|EXTENDED|UNCUT|DIRECTORS.CUT|THEATRICAL.CUT|ULTIMATE.CUT|SPECIAL.EDITION/).join('][').upperInitial().lowerTrail()+']'} [{vf}] [{ac}{fn.match("-HD.MA.")+af}]/{primarytitle} ({y}) {vc}{" (CD$pi)"}{' '+lang}
I attempted something like this, but it puts the ({vf}) as part of the movies folder title instead of using the command for the video size and it looks like that snippet has stuff for tv shows.

Anyone mind correcting me on this? I'd appreciate any help I can get to make this right. I also am curious about the drive size code, does it only scan the drives on the initial scan of the movie titles and move them into the same folder or does it take into account each movie as it fills up the drive?

Re: How about sharing our format expressions?

Posted: 25 Dec 2017, 05:13
by jebbe
Literally after sharing this, I tinkered with it a bit more and discovered this.

Code: Select all

{['Y:', 'W:'].collect{ (it+'/Movies') as File }.sort{ a, b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace }.last()} ({vf})\{genre}\{primarytitle} ({y}){' ['+fn.replaceAll(/(?i)directors|theatrical|ultimate/,'$0 Cut').matchAll(/UNRATED|REMASTERED|EXTENDED|UNCUT|DIRECTORS.CUT|THEATRICAL.CUT|ULTIMATE.CUT|SPECIAL.EDITION/).join('][').upperInitial().lowerTrail()+']'} [{vf}] [{ac}{fn.match("-HD.MA.")+af}]/{primarytitle} ({y}) {vc}{" (CD$pi)"}{' '+lang}
It seems to be working correctly as of right now. Does this look right?

Re: How about sharing our format expressions?

Posted: 31 Dec 2017, 18:48
by Hercules40
I need some help. There are many titles that have question marks in them "?". How do I get the "?" removed from the title?

For example, Anime:

Code: Select all

G:\My Videos\Anime\{n.replace(':',' -').replaceAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, " -").replaceTrailingBrackets()}\{'Season '+s}\{n.replace(':',' -').replaceTrailingBrackets()} - {s+'x'}{e.pad(2)} - {t.replace(':',' -').replaceAll(/[!?.*]+$/).replaceAll(/[`´‘’ʻ]/, "'").lowerTrail().replacePart(', Part $1')}
ButI can't get it to work for:

"World End: What do you do at the end of the world? Are you busy? Will you save us?"

Thanks.

Re: How about sharing our format expressions?

Posted: 31 Dec 2017, 20:24
by rednoah
e.g. replace ? with nothing:

Code: Select all

t.replace('?', '')