Web Sources

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
User avatar
devster
Posts: 196
Joined: 06 Jun 2017, 22:56

Web Sources

Post by devster » 15 Apr 2019, 23:41

More and more streaming services exist. More and more releases come from them.
The current {source} binding takes care of identifying the broad "WEBDL" or "WEBRip" and similar, but does not include where exactly from.
I'll share my solution to this particularly pointless problem.

Code: Select all

      { def file = new File('/scripts/websources.txt')
        def websources = file.exists() ? readLines(file).join("|") : null // to avoid non-existing paths failing the whole block
        def isWeb = (source ==~ /WEB.*/)
        // or def isWeb = source.matches(/WEB.*/) don't know which one is preferrable
        def lfr = { if (isWeb) fn.match(/($websources)\.(?i)WEB/) } // logo free release
        return allOf{fn.match(/(?i)(UHD).$source/).upper()}{lfr}{source}.join(".") } // it also specifies that source is downscaled from a 4K stream 
the magic happens in the websources.txt file which contains a fairly comprehensive list of shortcode for websources.

Code: Select all

9NOW
AE
AUBC
AMBC
AS
AJAZ
AMZN
AMC
ATK
ANPL
ANLB
AOL
ARD
iP
BRAV
CNLP
CN
CBC
CBS
4OD
CHGD
CMAX
CNBC
CC
CCGC
COOK
CMT
CRKL
CR
CSPN
CTV
CUR
CWS
DSKI
DHF
DEST
DDY
DTV
DISC
DSNY
DIY
DOCC
DPLY
ETV
ETTV
EPIX
ESPN
ESQ
FAM
FJR
FOOD
FOX
FREE
FYI
GLBL
GLOB
GO90
GC
HLMK
HBO
HGTV
HIDI
HIST
HULU
TOU
IFC
ID
iT
ITV
KNOW
LIFE
LN
MNBC
MTOD
MTV
NATG
NBA
NBC
NF
NFLN
NFL
NICK
NRK
PLUZ
PBS
PBSK
PSN
RSTR
RTE
SBS
SESO
SHMI
SPIK
SNET
SPRT
STAN
STZ
SVT
SWER
SYFY
TBS
TEN
TFOU
TLC
TRVL
TUBI
TV3
TV4
TVL
VH1
VICE
VMEO
UFC
UKTV
UNIV
VLCT
VIAP
VRV
WNET
WME
WWEN
XBOX
YHOO
RED
ZDF
I only work in black and sometimes very, very dark grey. (Batman)

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests