Page 1 of 2
Source Media {vs} and {source}
Posted: 21 Nov 2019, 15:06
by rednoah
The source media
(e.g. BluRay, WEB-DL, etc) can only be detected based on the file name.
- {vs} ... the standardized source media value regardless of which exact pattern was a match (e.g. any match for BluRay / BDRip / BD50 / etc yields BluRay)
- {source} ... the exact pattern match based on the file name (e.g. match for BD50 yields BD50)
{vs} and
{source} are
filename-based bindings.

FileBot uses the following patterns:
https://github.com/filebot/data/blob/master/media-sources.txt

Changes in classification and additional patterns can be added upon request. Please post change requests
(including example file paths) here.
Re: Source Media {vs} and {source}
Posted: 18 May 2020, 15:16
by devster
Is source now an exact match for case as well?
It seems that the following happens:
Code: Select all
fn: aaaaa.s01e01.hdtv.mkv => nice name - S01E01 - hdtv.mkv
fn: aaaaa.s01e01.HDTV.mkv => nice name - S01E01 - HDTV.mkv
As a corollary, how could I get the same behaviour as before (capital HDTV on non-capital match) or alternatively how could I choose
{vs} over
{source} only for specific values?
Re: Source Media {vs} and {source}
Posted: 18 May 2020, 16:27
by rednoah
You can do {vs.upper()} and {source.upper()} if you want an uppercase value.
Re: Source Media {vs} and {source}
Posted: 18 May 2020, 17:11
by devster
Not quite, I want BluRay and HDTV from
{vs}, but I do my own matching for anything WEB.*
Hence the difference.
I'm currently doing:
Code: Select all
String src
if (['BluRay', 'HDTV'].contains(vs) {
src = vs
} else {
src = source
}
just wondering if there's a better way.
Re: Source Media {vs} and {source}
Posted: 18 May 2020, 17:29
by rednoah
Well, I guess I'd write it like this:
Code: Select all
def src = vs =~ /BluRay|HDTV/ ? vs : source
Re: Source Media {vs} and {source}
Posted: 14 Jun 2020, 20:57
by DevXen
So.. VOD Isn't a valid source anymore?
Re: Source Media {vs} and {source}
Posted: 14 Jun 2020, 21:40
by kim
Code: Select all
WEB-DL (?:(?:ABC|ATVP|AMZN|BBC|CBS|CC|CR|CW|DCU|DSNP|DSNY|FBWatch|FREE|FOX|HMAX|HULU|iP|LIFE|MTV|NBC|NICK|NF|RED|TF1|STZ)[.-])?(?:WEB.?DL|WEB.?DLRip|WEB.?Cap|WEB.?Rip|HC|HD.?Rip|VODR|VODRip|PPV|PPVRip|iTunesHD|ithd|AmazonHD|NetflixHD|NetflixUHD|(?<=\d{3,4}[p].)WEB|WEB(?=.[hx]\d{3}))
so same as before, but now converted to WEB-DL
Re: Source Media {vs} and {source}
Posted: 14 Jun 2020, 23:52
by mterrill
kim wrote: ↑14 Jun 2020, 21:40
Code: Select all
WEB-DL (?:(?:ABC|ATVP|AMZN|BBC|CBS|CC|CR|CW|DCU|DSNP|DSNY|FBWatch|FREE|FOX|HMAX|HULU|iP|LIFE|MTV|NBC|NICK|NF|RED|TF1|STZ)[.-])?(?:WEB.?DL|WEB.?DLRip|WEB.?Cap|WEB.?Rip|HC|HD.?Rip|VODR|VODRip|PPV|PPVRip|iTunesHD|ithd|AmazonHD|NetflixHD|NetflixUHD|(?<=\d{3,4}[p].)WEB|WEB(?=.[hx]\d{3}))
I get "SyntaxError: Unexpected input: ','; Expecting <EOF>" when trying to use this, can I get some help on this one?
Re: Source Media {vs} and {source}
Posted: 15 Jun 2020, 01:11
by kim
it's not format code
standardized =
correct way

=
but you can use this:
Code: Select all
{fn.replaceAll(/(?i)(?:(?:ABC|ATVP|AMZN|BBC|CBS|CC|CR|CW|DCU|DSNP|DSNY|FBWatch|FREE|FOX|HMAX|HULU|iP|LIFE|MTV|NBC|NICK|NF|RED|TF1|STZ)[.-])?(?:WEB.?DL|WEB.?DLRip|WEB.?Cap|WEB.?Rip|HC|HD.?Rip|VODR|VODRip|PPV|PPVRip|iTunesHD|ithd|AmazonHD|NetflixHD|NetflixUHD|(?<=\d{3,4}[p].)WEB|WEB(?=.[hx]\d{3}))/,'WEB-DL')}
Re: Source Media {vs} and {source}
Posted: 15 Jun 2020, 05:05
by mterrill
kim wrote: ↑15 Jun 2020, 01:11
it's not format code
Thanks, I think i need to work out what is doing what in there..... i.e. the basics of what (?<=\d{3,4}[p].) does etc....
I guess what I was looking for was a spaced out output and keeping it sort of simple, i.e. only naming a webrip, webdl and if not labelled then I know it is blu ray...
Thanks for explaining the error though

Re: Source Media {vs} and {source}
Posted: 15 Jun 2020, 18:41
by kim
it's Regular Expressions
https://regexr.com/
= e.g. 720p or 1080p
Re: Source Media {vs} and {source}
Posted: 25 Jun 2020, 22:06
by devster
Is there a way to customise the map {vs} uses?
I find it a bit too restrictive.
Re: Source Media {vs} and {source}
Posted: 26 Jun 2020, 03:57
by rednoah
You can always create your own map and your own code and conditions. A couple of lines of Groovy code at most, so it's more straight-forward to just write your own code.
Things can be added to the map though, if you find something missing.
Re: Source Media {vs} and {source}
Posted: 26 Jun 2020, 23:29
by devster
Any examples for these lines of code?
My customisation is related to web sources, which you currently bundle in WEB-DL, I have some lines to match them separately.
Another small issue is that {source} seems to respect original case now dvdrip will result in dvdrip instead of DVDRip as before, not sure if it's because of my code.
Re: Source Media {vs} and {source}
Posted: 27 Jun 2020, 05:11
by rednoah
e.g.
Code: Select all
def input = 'Avatar DVDRip'
def patterns = [
'DVD' : 'DVD|DVDRip'
]
patterns.findResult{ s, p -> input.findMatch(p) ? s : null }
{source} is supposed to return the pattern match, but one or two older versions did indeed incorrectly force uppercase.
Re: Source Media {vs} and {source}
Posted: 18 Aug 2020, 23:45
by andy22
Anidb uses '
www' as web-dl tag and also has '
HD-DVD' see:
https://wiki.anidb.net/Content:Files#Qu ... itle_files
Re: Source Media {vs} and {source}
Posted: 19 Aug 2020, 02:22
by rednoah
I've added www but if it causes false positives or other indirect issues I might remove it again.
Re: Source Media {vs} and {source}
Posted: 29 Sep 2023, 06:54
by infamous
Regarding Web sources, could you add keywords for
MAX in particular since HBO MAX rebranded.
Also is there a way for {source} to pick up when spaces separate the words in the filename? As it is now it works if the filename contains something like
but not
Re: Source Media {vs} and {source}
Posted: 29 Sep 2023, 07:58
by rednoah

Can you provide real-world file paths for context and testing?
Re: Source Media {vs} and {source}
Posted: 03 Oct 2023, 00:43
by infamous
Just noticed you implemented it already, thanks @rednoah!
Re: Source Media {vs} and {source}
Posted: 13 Oct 2023, 11:37
by PukeStinkLikeRye
Can we add CRAV and iT to accecptable networks that can be used for figuring out {source}
examples are:
Code: Select all
Anne.with.an.E.2017.S03E01.A.Secret.Which.I.Desired.to.Divine.1080p.iT.WEB-DL.DD5.1.H.264-NYH (all of season 3 uses this)
Letterkenny.2016.S10E01.King.of.Suckers.1080p.CRAV.WEB-DL.DD5.1.H.264-NTb (all of season 10 uses this)
Thanks!
Re: Source Media {vs} and {source}
Posted: 16 Oct 2023, 01:09
by PukeStinkLikeRye
Can PCOK get added as well please?
Poker Face 2023 - Network Peacock.
eg. Poker.Face.2023.S01E05.Time.of.the.Monkey.2160p.PCOK.WEB-DL.HDR10.DDP5.1.H.265-NTb.mkv
Thanks in advance!
Re: Source Media {vs} and {source}
Posted: 16 Oct 2023, 01:21
by PukeStinkLikeRye
Can PMTP get added as well?
Rabbit Hole 2023 - Network Paramount+
eg. Rabbit.Hole.2023.S01E04.The.Person.In.Your.Ear.2160p.PMTP.WEB-DL.HDR10+.DDP5.1.H.265-NTb.mkv
Thanks!
Re: Source Media {vs} and {source}
Posted: 21 Oct 2023, 18:37
by rednoah
Added. Deployment might take 1-2 weeks.
Re: Source Media {vs} and {source}
Posted: 21 Oct 2023, 21:24
by PukeStinkLikeRye
rednoah wrote: ↑21 Oct 2023, 18:37
Added. Deployment might take 1-2 weeks.
THANK YOU!!! Just wondering if PCOK above it got added? I can give many more examples if need be!