Separate out WEBRip from WEB-DL
Separate out WEBRip from WEB-DL
Is there an easy way to separate out WEBRip from WEB-DL? I'd like to keep WEBRip as it's own source and not bundle it together with WEB-DL.
Re: Separate out WEBRip from WEB-DL
e.g. if the file says WEBRip yield WEBRip otherwise yield whatever value vs has:
You would use this as part of the folder structure to separate different sources into different folders like so:
Code: Select all
{ f =~ /WEBRip/ ? 'WEBRip' : vs }
You would use this as part of the folder structure to separate different sources into different folders like so:
Code: Select all
{ drive }/Media/{ f =~ /WEBRip/ ? 'WEBRip' : vs }/{ ny }/{ plex.name }
Please read the FAQ and How to Request Help.
Re: Separate out WEBRip from WEB-DL
Sorry, I should have be more clear. I don't want them in separate folders, I want to rename them using the vs value but instead of grouping WEBRip and WEB-DL together, I want to keep WEBRip as is.
But using your example above, I think I was able to come up with something that should work for me.
Thanks!
But using your example above, I think I was able to come up with something that should work for me.
Code: Select all
{ source.lower() =~ /webrip/ ? 'WEBRip' : vs }
Re: Separate out WEBRip from WEB-DL
e.g. you can do a case-insensitive match on the file name like so:
or so:
Code: Select all
{ fn =~ /(?i)WEBRip/ ? 'WEBRip' : vs }
Code: Select all
{ any{ fn.match(/WEBRip/) }{ vs } }
Please read the FAQ and How to Request Help.
Re: Separate out WEBRip from WEB-DL
How can I add more eg WebHD and so on?
Tried around with the but didnt get it to work.
Tried around with the
Shell: Select all
{ any{ fn.match(/WEBRip/) }{ vs } }
Last edited by iKUd on 25 Jan 2024, 18:50, edited 3 times in total.
Re: Separate out WEBRip from WEB-DL
If you want to match WebHD then you need to use /WebHD/ and not /WEBRip/ as custom regex pattern:
fn refers to the file name. If the file name contain WebHD then the snippet above will yield WebHD as a result.
Format: Select all
{ any{ fn.match(/WebHD/) }{ vs } }
Please read the FAQ and How to Request Help.
Re: Separate out WEBRip from WEB-DL
ok maybe I wasnt precise enough. I want to add WebHD in additional to the existing WebRip. And perhaps also Webxx and so on.
Re: Separate out WEBRip from WEB-DL
e.g.
If the file name contains Web<two upper-case letters> then add that to the target file path.
Format: Select all
{ fn.match(/Web[A-Z]{2}/) }
Please read the FAQ and How to Request Help.
Re: Separate out WEBRip from WEB-DL
First of all thank you for your patience
With this I get the WebHD done but the WebRip turns into WebRi.
But my question was to add more excludes in additional to WebRip so it doesnt touch WebRip, xy, zy, and so on
With this I get the WebHD done but the WebRip turns into WebRi.
But my question was to add more excludes in additional to WebRip so it doesnt touch WebRip, xy, zy, and so on
Re: Separate out WEBRip from WEB-DL
Can you list a few file paths with corresponding desired output path?
The code above is an example. You can modify the regex pattern to match your target patterns more specifically. You can write the code yourself and test it against your file paths, but if you need help our with that then we need your sample file paths as text so that we can prototype and test the code against something.
The code above is an example. You can modify the regex pattern to match your target patterns more specifically. You can write the code yourself and test it against your file paths, but if you need help our with that then we need your sample file paths as text so that we can prototype and test the code against something.
Please read the FAQ and How to Request Help.
Re: Separate out WEBRip from WEB-DL
I want not only to separate out WEBRip from WEB-DL but also WebHD and maybe even more
like
like
Shell: Select all
{ any{ fn.match(/WEBRip AND WebHD AND xxx AND yyy AND zzz/) }{ vs } }
Re: Separate out WEBRip from WEB-DL
Yes, please post sample file paths as text for each case. If we write code, then we need to create a test case first. Presumably, you are looking at the test case and can easily copy & paste it so that we don't have to randomly conjure something up.rednoah wrote: ↑27 Jan 2024, 14:03 Can you list a few file paths with corresponding desired output path?
The code above is an example. You can modify the regex pattern to match your target patterns more specifically. You can write the code yourself and test it against your file paths, but if you need help our with that then we need your sample file paths as text so that we can prototype and test the code against something.
e.g.
Format: Select all
{ any{ fn.match(/WebHD/) }{ source } }
Console Output: Select all
$ ls
Alias.1x01.WEB-DL.mp4
Alias.1x01.WebHD.mp4
Alias.1x01.WebHD.WEB-DL.mp4
Alias.1x01.WEBRip.mp4
$ filebot -mediainfo . --format "{fn} => { any{ fn.match(/WebHD/) }{ source } }"
Alias.1x01.WEB-DL => WEB-DL
Alias.1x01.WebHD => WebHD
Alias.1x01.WebHD.WEB-DL => WebHD
Alias.1x01.WEBRip => WEBRip
Please read the FAQ and How to Request Help.
Re: Separate out WEBRip from WEB-DL
Wow great - so far that looks exactly what I was looking for!
I do some more tests but atm it looks great.
Thanks alot
I do some more tests but atm it looks great.
Thanks alot