POSTBUCKET - where random posts in unrelated topics go

Any questions? Need some help?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post 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.
:idea: Please read the FAQ and How to Request Help.
ironcity1861
Posts: 3
Joined: 08 Aug 2016, 18:23

Re: [SNAP] Grant access to /media

Post by ironcity1861 »

only 25 minutes after a reinstall I realized this is why it wasn't working!
b0ssem
Posts: 14
Joined: 20 Mar 2017, 07:56

Re: Q&A for n00bs

Post 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!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Q&A for n00bs

Post 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}
:idea: Please read the FAQ and How to Request Help.
b0ssem
Posts: 14
Joined: 20 Mar 2017, 07:56

Re: Q&A for n00bs

Post 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}
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Q&A for n00bs

Post 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.
:idea: Please read the FAQ and How to Request Help.
dadelayer
Posts: 5
Joined: 06 Oct 2017, 06:18

Re: Batch Rename any type of file

Post 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
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Batch Rename any type of file

Post 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.
:idea: Please read the FAQ and How to Request Help.
dadelayer
Posts: 5
Joined: 06 Oct 2017, 06:18

Re: Batch Rename any type of file

Post 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 :(
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Batch Rename any type of file

Post 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. ;)
:idea: Please read the FAQ and How to Request Help.
brunorene
Posts: 5
Joined: 21 Oct 2017, 18:57

Re: [SNAP] Grant access to /media

Post 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
Delmano
Posts: 1
Joined: 14 Oct 2017, 10:27

Re: Batch Rename any type of file

Post by Delmano »

This is so useful. Thanks for the tutorial Noah, helps newbies like me a lot.
yodaspowart
Posts: 16
Joined: 02 Jun 2017, 01:04

Re: How about sharing our format expressions?

Post 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".
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How about sharing our format expressions?

Post by rednoah »

Assuming that "3D" is part of the filename, this should do:

Code: Select all

{fn =~ /3D|2160p/ ? 'Movies 4K' : 'Movies'}
:idea: Please read the FAQ and How to Request Help.
yodaspowart
Posts: 16
Joined: 02 Jun 2017, 01:04

Re: How about sharing our format expressions?

Post 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
pyropunk2006
Posts: 1
Joined: 14 Dec 2017, 16:48

Re: [SNAP] Grant access to /media

Post by pyropunk2006 »

Any idea how to get filebot to see mounted devices? Its on automount if that makes a difference.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [SNAP] Grant access to /media

Post by rednoah »

It should work out of the box. What exactly isn't working?
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How about sharing our format expressions?

Post 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.
:idea: Please read the FAQ and How to Request Help.
yodaspowart
Posts: 16
Joined: 02 Jun 2017, 01:04

Re: How about sharing our format expressions?

Post 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 &
LouisF
Posts: 1
Joined: 29 Nov 2017, 19:46

Re: Exclude Blacklist & Series-Mappings

Post 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,
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post 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.
:idea: Please read the FAQ and How to Request Help.
jebbe
Posts: 8
Joined: 25 Dec 2017, 04:54

Re: How about sharing our format expressions?

Post 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?
jebbe
Posts: 8
Joined: 25 Dec 2017, 04:54

Re: How about sharing our format expressions?

Post 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?
Hercules40
Posts: 32
Joined: 15 Jun 2017, 00:46

Re: How about sharing our format expressions?

Post 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.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How about sharing our format expressions?

Post by rednoah »

e.g. replace ? with nothing:

Code: Select all

t.replace('?', '')
:idea: Please read the FAQ and How to Request Help.
Post Reply