UNPKG

@x4trioz925c3/rls-parser

Version:

A comprehensive NodeJS release name parser.

1,168 lines (1,129 loc) 176 kB
// rls.js // // A comprehensive Node.js port of the GO release parsing library: // https://github.com/moistari/rls // // This single file contains all necessary components: tag info, lexers, // parser, builder, and data structures. It aims to be a highly accurate // port for parsing release names. const fs = require('fs'); const path = require('path'); const { inspect } = require('util'); const RE2 = require('re2'); const he = require('he'); // ---------------------------------------------------------------------- // 1. Embedded Data (from taginfo.csv) - (Internal) // ---------------------------------------------------------------------- // Embedded data from taginfo.csv const TAGINFO_CSV_DATA = `Type,Tag,Title,Regexp,Other,ReleaseType,TypeExclusive arch,ARM64,,aarch[\\-\\_\\. ]?64|arm[\\-\\_\\. ]?64,,app,1 arch,ARM,,arm32|(?-i:ARM),,app,1 arch,64bit,,64[\\-\\_\\. ]?bit,,app, arch,32bit,,32[\\-\\_\\. ]?bit,,app, arch,16bit,,(?-i:16[\\-\\_\\. ]?[bB]it),,app, arch,DARWiN,Darwin (macOS),(?-i:DARW[iI]N),,app,1 arch,ia64,Itanium,ia?64,,app,1 arch,PPC,PowerPC,,,app,1 arch,s390,IBM System/390,,,app,1 arch,x86,,x86|intel32|i32,,app,1 arch,x64,,x64|amd64,,app,1 audio,AAC-LC,Advanced Audio Coding (LC),aac[\\-\\_\\. ]?lc,,, audio,AAC,Advanced Audio Coding,,,, audio,AC3D,,ac[\\-\\_\\. ]?3d,,movie, audio,Atmos,Dolby Atmos,,,movie, audio,24BIT,,(?-i:24B[iI]T),,music,1 audio,16BIT,,,,music,1 audio,CBR,Constant Bit Rate,,,, audio,DDPA,Dolby Digital+ Atmos (E-AC-3+Atmos),dd[p\\+]a,,movie, audio,DDP,Dolby Digital+ (E-AC-3),dd[p\\+]|e[\\-\\_\\. ]?ac3,,movie, audio,DD,Dolby Digital (AC-3),dd|ac3|dolby[\\-\\_\\. ]?digital,,movie, audio,DTS-HD.HRA,DTS (HD HRA),dts[\\-\\_\\. ]?hd[\\-\\_\\. ]?hra,,movie, audio,DTS-HD.HR,DTS (HD HR),dts[\\-\\_\\. ]?hd[\\-\\_\\. ]?hr,,movie, audio,DTS-HD.MA,DTS (HD MA),dts[\\-\\_\\. ]?hd[\\-\\_\\. ]?ma,,movie, audio,DTS-HD,DTS (HD),dts[\\-\\_\\. ]?hd,,movie, audio,DTS-MA,DTS (MA),dts[\\-\\_\\. ]?ma,,movie, audio,DTS-X,DTS (X),dts[\\-\\_\\. ]?x,,movie, audio,DTS,,,,movie, audio,DUAL.AUDIO,Dual Audio,dual(?:[\\-\\_\\. ]?audio)?|2audio,,movie, audio,EAC3D,,,,, audio,ES,Dolby Digital (ES),(?-i:ES),,movie, audio,EX,Dolby Digital (EX),(?-i:EX),,movie, audio,FLAC,Free Lossless Audio Codec,,,, audio,320Kbps,320 Kbps,320[\\-\\_\\. ]?kbps,,music,1 audio,256Kbps,256 Kbps,256[\\-\\_\\. ]?kbps,,music,1 audio,192Kbps,192 Kbps,192[\\-\\_\\. ]?kbps,,music,1 audio,128Kbps,128 Kbps,128[\\-\\_\\. ]?kbps,,music,1 audio,192khz,192 khz,192[\\-\\_\\. ]?khz,,music,1 audio,96khz,96 khz,96[\\-\\_\\. ]?khz,,music,1 audio,48khz,48 khz,48[\\-\\_\\. ]?khz,,music,1 audio,44khz,44 khz,44(?:[\\-\\_\\. ]1)?[\\-\\_\\. ]?khz,,music,1 audio,LiNE,Line,(?-i:L[iI]NE),,, audio,LOSSLESS,Lossless,,,music,1 audio,LPCM,Linear Pulse-Code Modulation (LPCM),,,, audio,MP3,MPEG-2 Audio Layer III (MP3),,,, audio,OGG,Vorbis Audio (OGG),,,, audio,OPUS,Opus,,,, audio,TrueHD,Dolby TrueHD,(?:dolby[\\-\\_\\. ]?)?true[\\-\\_\\. ]?hd,,movie, audio,VBR,Variable Bit Rate,,,music,1 channels,7.1,,7\\.1(?:[\\-\\_\\. ]?audios?)?,,, channels,7.0,,7\\.0(?:[\\-\\_\\. ]?audios?)?,,, channels,6.1,,6\\.1(?:[\\-\\_\\. ]?audios?)?,,, channels,6.0,,6\\.0(?:[\\-\\_\\. ]?audios?)?,,, channels,5.1,,5\\.1(?:[\\-\\_\\. ]?audios?)?,,, channels,5.0,,5\\.0(?:[\\-\\_\\. ]?audios?)?,,, channels,4.1,,4\\.1(?:[\\-\\_\\. ]?audios?)?,,, channels,4.0,,4\\.0(?:[\\-\\_\\. ]?audios?)?,,, channels,3.1,,3\\.1(?:[\\-\\_\\. ]?audios?)?,,, channels,3.0,,3\\.0(?:[\\-\\_\\. ]?audios?)?,,, channels,2.1,,2\\.1(?:[\\-\\_\\. ]?audios?)?,,, channels,2.0,,2\\.0(?:[\\-\\_\\. ]?audios?)?,,, channels,1.0,,1\\.0(?:[\\-\\_\\. ]?audios?)?,,, codec,DiVX.SBC,DivX SBC,(?:divx[\\-\\_\\. ]?)?sbc,,movie, codec,x264.HQ,x264 (HQ),x[\\-\\_\\. ]?264[\\-\\_\\. ]?hq,,movie, codec,MPEG-2,,mpe?g(?:[\\-\\_\\. ]?2)?,,movie, codec,H.265,,h[\\-\\_\\. ]?265,,movie, codec,H.264,,h[\\-\\_\\. ]?264,,movie, codec,H.263,,h[\\-\\_\\. ]?263,,movie, codec,H.262,,h[\\-\\_\\. ]?2[26]2,,movie, codec,H.261,,h[\\-\\_\\. ]?261,,movie, codec,dxva,Direct-X Video Acceleration,,,movie, codec,HEVC,High Efficiency Video Coding,,,movie, codec,VC-1,,vc[\\-\\_\\. ]?1,,movie, codec,x265,,x[\\-\\_\\. ]?265,,movie, codec,x264,,x[\\-\\_\\. ]?264,,movie, codec,XViD,Xvid,,,movie, codec,AVC,Advanced Video Coding,avc(?:[\\-\\_\\. ]?1)?,,movie, codec,VP9,,vp[\\-\\_\\. ]?9,,movie, codec,VP8,,vp[\\-\\_\\. ]?8,,movie, codec,VP7,,vp[\\-\\_\\. ]?7,,movie, collection,ABC,American Broadcasting Company,,,, collection,ACA.NEOGEO,Neo Geo Classics,aca[\\-\\_\\. ]?neo[\\-\\_\\. ]?geo,,game,1 collection,ALL4,All 4,,,, collection,AMZN,Amazon,amzn|amazon(?:hd)?,,, collection,Apress,,,,education,1 collection,ArtStation,,art[\\-\\_\\. ]?station(?:[\\-\\_\\. ]?com)?,,education,1 collection,AT-X,Anime Theatre X,at[\\-\\_\\. ]?x,,series, collection,ATVP,Apple TV+,atv[p\\+],,, collection,B-Global,Bilibili Global,b[\\-\\_\\. ]?global,,, collection,BBC,British Broadcasting Corporation,,,, collection,BCORE,Bravia Core,,,movie,1 collection,BOOM,Boomerang,,,, collection,BRAVO,Bravo,(?-i:BRAVO?),,, collection,Career.Academy,Career Academy,career[\\-\\_\\. ]?academy,,education,1 collection,CBC,Canadian Broadcasting Corporation,,,, collection,CBS,CBS Corporation,,,, collection,CBT.Nuggets,CBT Nuggets,cbt[\\-\\_\\. ]?nuggets(?:[\\-\\_\\. ]?com)?,,education,1 collection,CC,Comedy Central,,,, collection,CPOP,Chinese Pop,,,music,1 collection,CRAV,Crave,,,, collection,CreativeLive,,,,education,1 collection,Criterion.Collection,Criterion Collection,(?:the[\\-\\_\\. ])?(?:criterion(?:[\\-\\_\\. ]?(?:collection|edition))?),,movie, collection,CRKL,Crackle,,,, collection,CR,Crunchyroll,,,, collection,CW,The CW,,,, collection,CX,Fuji TV,,,, collection,DCU,DC Universe,,,, collection,DI.FM,Digitally Imported FM,di[\\-\\_\\. ]?fm,,music,1 collection,DigitalTutors,,digital[\\-\\_\\. ]?tutors(?:[\\-\\_\\. ]?com)?,,education,1 collection,DSCP,Discovery+,dsc[p\\+],,, collection,DSNP,Disney+,dsn[p+],,, collection,DSNY,Disney,,,, collection,eShop,Nintendo eShop,,,game,1 collection,FBWatch,Facebook Watch,,,, collection,FE,Freeform,,,, collection,3FM,NPO 3FM,,,music,1 collection,FOX,Fox Broadcasting Company,(?-i:FOX),,, collection,FREEWEB,Freeweb,,,music,1 collection,FUNi,Funimation,,,, collection,GOG,Good Old Games,gog(?:[\\-\\_\\. ]?(?:edition|classic))?,,game,1 collection,Gumroad,,gum[\\-\\_\\. ]?road(?:[\\-\\_\\. ]?com)?,,education,1 collection,Hitradio.MSOne,Hitradio MS One,hitradio[\\-\\_\\. ]?ms[\\-\\_\\. ]?one,,music,1 collection,HMAX,HBO Max,,,, collection,HTSR,Hotstar,,,, collection,HULU,Hulu Networks,,,, collection,IBM.Press,IBM Press,ibm[\\-\\_\\. ]?press,,education,1 collection,IDT.Radio,ID&T Radio,idt[\\-\\_\\. ]?radio,,music,1 collection,iGN.com,,ign\\.com,,, collection,IMAX,,(?-i:IMAX),,, collection,iPlayer,BBC iPlayer,(?-i:iP)(?:layer)?,,, collection,iTunes,,(?-i:iT)(?:unes)?,,, collection,JAV,Japanese Adult Video,,,, collection,JPOP,Japanese Pop,,,music,1 collection,KelbyOne,,kelby(?:[\\-\\_\\. ]?(?:one|training))?,,education,1 collection,Learnable.com,,learnable[\\-\\_\\. ]?com,,education,1 collection,LearnNowOnline,,,,education,1 collection,LinkedIn.Learning,LinkedIn Learning,linkedin[\\-\\_\\. ]?learning,,education,1 collection,LinuxCBT,,linux[\\-\\_\\. ]?cbt(?:[\\-\\_\\. ]?com)?,,education,1 collection,Lynda,,lynda(?:[\\-\\_\\. ]?com)?,,education,1 collection,MTV,MTV Networks,,,, collection,MUBI,Mubi,,,, collection,NBC,National Broadcasting Company,,,, collection,NF,Netflix,(?-i:NF)|netflix(?:[\\-\\_\\. ]originals)?,,, collection,NHKG,NHK General TV,,,, collection,NICK,Nickelodeon,(?-i:N[iI]CK),,, collection,OAR,Original Aspect Ratio,(?-i:OAR),,, collection,OREILLY,O'Reilly,o[\\-\\_\\. ]?reilly(?:[\\-\\_\\. ]?com)?,,education, collection,Packt,,,,education,1 collection,PCOK,Peacock,,,, collection,Percipio,,percipio(?:[\\-\\_\\. ]?com)?,,education,1 collection,PLURALSiGHT,Pluralsight,plural[\\-\\_\\. ]?sight(?:[\\-\\_\\. ]?com)?,,education,1 collection,PMTP,Paramount+,pmt[p\\+],,, collection,PPV,Pay-Per-View,ppv(?:[\\-\\_\\. ]?rip)?,,episode, collection,PSN,PlayStation Network,,,game,1 collection,Puresound.FM,Puresound FM,puresound[\\-\\_\\. ]?fm,,music,1 collection,RED,YouTube Red,(?-i:RED),,, collection,ROKU,Roku,,,, collection,SF,Shout! Factory,(?-i:SF),,, collection,SiriusXM,Sirius XM,sirius[\\-\\_\\. ]?xm,,music,1 collection,Skillfeed,,,,education,1 collection,Skillshare,,skillshare(?:[\\-\\_\\. ]?com)?,,education,1 collection,Sonic.Academy,Sonic Academy,sonic[\\-\\_\\. ]?academy(?:[\\-\\_\\. ]?com)?,,education,1 collection,STAN,Stan,,,, collection,STV,Straight-to-Video,,,movie, collection,STZ,STARZ,st(?:ar)?z,,, collection,Total.Training,Total Training,total[\\-\\_\\. ]?training,,education,1 collection,TrainSignal,,,,education,1 collection,TrainSimple,,train[\\-\\_\\. ]?simple(?:[\\-\\_\\. ]?com)?,,education,1 collection,Truefire,,truefire(?:[\\-\\_\\. ]?com)?,,education,1 collection,TutsPlus,,tutsplus(?:[\\-\\_\\. ]?com)?,,education,1 collection,TVNZ,Television New Zealand,,,, collection,Udemy,,,,education,1 collection,Video2Brain,,video2brain(?:[\\-\\_\\. ]?com)?,,education,1 collection,VMEO,Vimeo,,,, collection,VRV,Verve Streaming,,,, collection,VTC,,,,education,1 collection,WAKA,Wakanim,(?-i:WAKA),,, collection,WiiWare,WiiWare Shop,,,game,1 collection,Wiley,,wiley(?:[\\-\\_\\. ]?com)?,,education,1 collection,XBLA,Xbox Live Arcade,,,game,1 collection,XXX,Adult,(?-i:XXX),,, collection,YOUTUBE,YouTube,(?-i:YOUTUBE)|(?-i:YT),,, collection,ZEE5,ZEE5 Streaming,,,, container,AVI,Audio Video Interleave (AVI),,,, container,AZW3,Kindle eBook (AZW),azw3?,,book, container,CBR,Comic Book Archive (CBR),,,comic, container,CBZ,Comic Book Archive (CBZ),,,comic, container,DIVX,DivX,,,movie, container,ePub,Electronic Publication (ePub),,,book, container,FLV,Flash Video,,,movie, container,F4V,Flash 4 Video (F4V),,,movie, container,ISO,ISO 9660,,,, container,3LP,,,,movie, container,MKV,Matroska (MKV),,,movie, container,MOBI,Mobipocket eBook (MOBI),,,book, container,MOV,QuickTime Movie,,,movie, container,MP4,MPEG-4 Part 14 (MP4),,,movie, container,M4V,,,,movie, container,PDF,Portable Document Format (PDF),,,book, container,WMV,Windows Media Video (WMV),,,movie, cut,Censored.Cut,Censored,censored(?:[\\-\\_\\. ]cut)?,,movie, cut,Directors.Cut,Director's,director[\\-\\_\\. ']?s[\\-\\_\\. ]cut|(?-i:DC),,movie, cut,Extended.Cut,Extended,extended(?:[\\-\\_\\. ](?:version|edition|cut))?,,, cut,Final.Cut,Final,final[\\-\\_\\. ]cut,,movie, cut,International.Cut,International,international[\\-\\_\\. ]cut,,movie, cut,Original.Version,Original,original[\\-\\_\\. ](?:version|edition|cut),,, cut,Theatrical.Cut,Theatrical,theatrical(?:[\\-\\_\\. ]cut)?,,movie, cut,Uncensored.Cut,Uncensored,uncensored(?:[\\-\\_\\. ]cut)?,,movie, cut,Uncut,,uncut|ungek[uü]e?rzt,,movie, cut,Unrated.Cut,Unrated,unrated(?:[\\-\\_\\. ]cut)?,,movie, edition,Bonus.Edition,Bonus,bonus[\\-\\_\\. ]edition,,music,1 edition,Club.Edition,Club,club[\\-\\_\\. ]edition,,music,1 edition,Collectors.Edition,Collectors,collector[[\\-\\_\\. ']?s[\\-\\_\\. ]edition,,movie, edition,Complete.Edition,Complete,(?-i:Complete[\\-\\_\\. ]Edition),,game,1 edition,Definitive.Edition,Definitive,(?:the[\\-\\_\\. ])?definitive[\\-\\_\\. ]edition,,game,1 edition,Deluxe.Edition,Deluxe,deluxe[\\-\\_\\. ]edition,,, edition,Despecialized,,,,movie,1 edition,Expanded.Edition,Expanded,expanded(?:[\\-\\_\\. ](?:version|edition|cut))?,,movie, edition,Extended.Mix,Extended Mix,(?:incl[\\-\\_\\. ]+)?extended[\\-\\_\\. ]mix,,music,1 edition,Fan.Edit,Fan,fan[\\-\\_\\. ]edit,,movie,1 edition,JA,Japanese Edition,(?-i:JA),,music,1 edition,Limited.Edition,Limited,limited(?:[\\-\\_\\. ]edition)?,,, edition,Ltd.Ed,Limited,ltd[\\-\\_\\. ][\\-\\_\\. ]?ed,,music,1 edition,Noir.Edition,Noir,noir[\\-\\_\\. ]edition,,movie,1 edition,Open.Matte,Open Matte,open[\\-\\_\\. ]matte,,movie,1 edition,Remastered.Edition,Remastered,remaster(?:ed)?(?:[\\-\\_\\. ]edition)?,,, edition,Restored.Edition,Restored,restored(?:[\\-\\_\\. ]edition)?,,movie, edition,Special.Edition,Special,special[\\-\\_\\. ]edition|edicion[\\-\\_\\. ]especial,,movie, edition,Super.Deluxe,Super Deluxe,super[\\-\\_\\. ]deluxe,,movie, edition,Ultimate.Edition,Ultimate,ultimate[\\-\\_\\. ]edition,,movie, edition,$1.Anniversary.Edition,Anniversary ($1),(\\d+(?:th|st|nd|rd)?)?[\\-\\_\\. ]anniversary(?:[\\-\\_\\. ]edition)?,,movie, ext,aac,Advanced Audio Coding (aac),(?-i:aac),,music, ext,asf,Advanced Systems Format (asf),,,movie, ext,asx,Advanced Stream Redirector (asx),,,movie, ext,avc,Advanced Video Coding (avc),,,movie, ext,avi,Audio Video Interleave (avi),,,movie, ext,bin,Binary (bin),,,app, ext,bz2,BZip2 (bz2),,,app, ext,cbr,Comic Book (CBR),,,comic,1 ext,cbz,Comic Book (CBZ),,,comic,1 ext,dat,Data (dat),,,app, ext,divx,DivX,[bd]ivx,,movie, ext,dvr-ms,Microsoft Digital Video Recording (dvr-ms),,,movie, ext,flac,Free Lossless Audio Codec (flac),(?-i:flac),,music, ext,fli,FLIC Animation (fli),,,movie, ext,flv,FLV,,,movie, ext,3gp,3rd Generation Partnership Project (3gp),,,movie, ext,gz,GZip (gz),,,app, ext,ifo,IFO,,,movie, ext,img,IMG,,,app, ext,iso,ISO 9660 (iso),,,, ext,m4a,MPEG-4 Audio (m4a),,,music, ext,mk3d,MK3D,,,movie, ext,mkv,Matroska (mkv),,,movie, ext,mov,MOV,,,movie, ext,mp4,MP4,(?-i:mp4),,movie, ext,mp3,MP3,(?-i:mp3),,music, ext,mpg,MPEG,mpe?g,,movie, ext,m2ts,BluRay Disc (m2ts),,,movie, ext,m3u,M3U,,,music, ext,m4v,M4V,,,movie, ext,m2v,M2V,,,movie, ext,nrg,NRG,,,app, ext,nsv,NSV,,,movie, ext,nuv,NUV,,,movie, ext,ogm,OGM,,,movie, ext,ogv,OGV,,,movie, ext,pva,PVA,,,series, ext,qt,QuickTime (qt),,,movie, ext,rar,Roshal Archive (rar),,,, ext,raw,RAW,,,movie, ext,rmvb,Real Media (rmvb),,,movie, ext,rm,Real Media (rm),,,movie, ext,strm,Stream (strm),,,game,1 ext,svq3,SVQ3,,,movie, ext,tar.bz2,BZip2 TAR (tar.bz2),,,app, ext,tar.gz,GZip TAR (tar.gz),,,app, ext,tar,TAR,,,app, ext,torrent,Torrent,,,, ext,ts,TS,,,movie, ext,ty,TY,,,movie, ext,viv,VIV,,,movie, ext,vob,VOB,,,movie, ext,vp3,VP3,,,movie, ext,webm,WebM,,,movie, ext,wmv,WMV,,,movie, ext,wpl,WPL,,,music, ext,wtv,WTV,,,movie, ext,xvid,Xvid,,,movie, ext,7z,7-Zip (7z),,,app, ext,zip,Zip,,,, genre,Action,,,,movie, genre,Adventure,,,,movie, genre,Animation,,,,movie, genre,Anime,,,(?-i:AN[iI]ME),movie, genre,Biography,,,,movie, genre,Comedy,,,,movie, genre,Concert,,,,movie, genre,Crime,,,,movie, genre,Documentary,,do[ck](?:u(?:mentary)?)?,(?-i:DO[CK]U?),movie, genre,Drama,,,,movie, genre,Family,,,,movie, genre,Fantasy,,,,movie, genre,Film-Noir,,film[\\-\\_\\. ]?noir,,movie, genre,Food,,,,movie, genre,Game-Show,,game[\\-\\_\\. ]?show,,series, genre,History,,,,movie, genre,Horror,,,,movie, genre,Musical,,,,movie, genre,Music,,,,movie, genre,Mystery,,,,movie, genre,News,,,,series, genre,Reality-TV,,reality[\\-\\_\\. ]?tv,,series, genre,Romance,,,,movie, genre,Sci-Fi,,sci[\\-\\_\\. ]?fi|science[\\-\\_\\. ]?fiction,,movie, genre,Short,,,,movie, genre,Sport,,,,movie, genre,Stand-Up,,stand[\\-\\_\\. ]?up,,movie, genre,Talk-Show,,talk[\\-\\_\\. ]?show,,series, genre,Thriller,,,,movie, genre,Travel,,,,movie, genre,War,,,,movie, genre,Western,,,,movie, hdr,HDR10+,High Dynamic Range (10-bit+),hdr[\\-\\.]?10\\+|10\\+[\\-\\.]?bit|hdr10plus|hi10p,,movie, hdr,HDR10,High Dynamic Range (10-bit),hdr[\\-\\.]?10|10[\\-\\.]?bit|hi10,,movie, hdr,HDR+,High Dynamic Range+,hdr\\+,,movie, hdr,HDR,High Dynamic Range,,,movie, hdr,HLG,Hybrid Log-Gamma,,,movie, hdr,SDR,Standard Dynamic Range,,,movie, hdr,DV,Dolby Vision,dolby[\\-\\_\\. ]vision|dovi|dv,,movie, language,AUDiO.ADDON,Audio Addon,audio[\\-\\_\\. ]?addon,,, language,BALTIC,Baltic,,,, language,BRAZiLiAN,Brazilian,BRAZiLiAN|BR,,, language,BULGARiAN,Bulgarian,(?i:bulgarian)|BG,,, language,CHiNESE,Chinese,CH[iI]N[eE]S[eE]|CN,,, language,CHS,Chinese (simplified),(?i:chinese[\\-\\_\\. ]?simplified)|CHS,,, language,CHT,Chinese (traditional),(?i:chinese[\\-\\_\\. ]?traditional)|CHT,,, language,CZECH,Czech,CZECH|CZ,,, language,DANiSH,Danish,(?i:danish)|DK,,, language,DL,Dual Language,(?i:dual[\\-\\_\\. ]?language)|DL,,, language,DUBBED,Dubbed,(?i:(?:line[\\-\\_\\. ]?)?dubbed),,, language,DUTCH,Dutch,(?i:dutch|flemish)|NL,,, language,ENGLiSH,English,(?i:eng(?:lish)?)|EN,,, language,ESTONiAN,Estonian,(?i:estonian)|EE,,, language,FiNNiSH,Finnish,(?i:finnish)|FI,,, language,FRENCH,French,(?i:french)|FRE|FR,,, language,GERMAN,German,(?i:german)|DE,,, language,GREEK,Greek,GREEK|(?i:gr),,, language,HAiTiAN,Hatian,(?i:haitian)|HT,,, language,HARDSUB,Subs (hard),(?:hardsub),,, language,HC,Hardcoded,(?i:hard[\\-\\_\\. ]?coded|hc),,, language,HiNDI,Hindi,(?i:hindi)|HI,,, language,HUNGARiAN,Hungarian,(?i:hun(?:garian)?)|HU,,, language,iCELANDiC,Icelandic,(?i:icelandic),,, language,iTALiAN,Italian,(?i:ita(?:lian)?),,, language,JAPANESE,Japanese,(?i:japanese),,, language,KOREAN,Korean,K[oO]R[eE][aA]N|KR,,, language,LATiN,Latin,,,, language,MANDARiN,Mandarin,,,, language,MULTILANG,Multi (lang),,,, language,MULTiSUB,Subs (multi),(?i:multiple[\\-\\_\\. ]subtitles?|multi[\\-\\_\\. ]?subs?),,, language,MULTi,Multi,(?i:multi(?:[\\-\\_\\. ]?(?:lingual|language)))|MULT[iI],,, language,NORDiC,Nordic,N[oO]RD[iI]C,,, language,NORWEGiAN,Norwegian,(?i:nor(?:wegian)?)|NO,,, language,POLiSH,Polish,(?i:polish)|PL,,, language,PORTUGUESE,Portuguese,(?i:portuguese)|PT,,, language,ROMANiAN,Romanian,(?i:romanian)|RO,,, language,RUSSiAN,Russian,(?i:rus(?:sian)?)|RU,,, language,SLOVAK,Slovak,SLOVAK|SK,,, language,SPANiSH,Spanish,(?i:spanish)|SPA|ES,,, language,SUBBED,Subbed,(?i:subbed),,, language,SUBFORCED,Subbed (forced),(?i:subforced|forcedsub),,, language,SUBPACK,Subs (pack),(?i:subs?[\\-\\_\\. ]?pack),,, language,SWEDiSH,Swedish,(?i:swe(?:dish)?)|SE,,, language,SYNCED,Synced,(?i:synced),,, language,TURKiSH,Turkish,(?i:turkish)|TR,,, language,UKRAiNiAN,Ukrainian,(?i:ukrainian)|UA,,, language,UNSUBBED,Unsubbed,(?i:unsubbed),,, language,VF2,VFF et VFQ,(?i:vf2|fr2),,, language,VFB,Version Francophone Belge,(?i:vfb),,, language,VFF,Version Francophone Français,(?i:vf?f|truefrench),,, language,VFI,Version Francophone Internationale,(?i:vfi),,, language,VFO,Version Francophone Originale,(?i:vf?o),,, language,VFQ,Version Francophone Québécoise,(?i:vf?q),,, language,VOSTEN,Version Originale Sous-Titrée en Anglais,(?i:vosten),,, language,VOSTFR,Version Originale Sous-Titrée en Français,(?i:vostfr),,, language,YUGOSLOViAN,Yugoslovian,(?i:yugoslovian)|YU,,, language,$1$2UB$3,$2ubs ($1$3),([A-Zi]*)([SD])UB([A-Zi]*),,, language,MULTi$2,Multi ($2),(?i:multi)[\\-\\_\\. ]?(\\d+),,, other,ADVANCE,Advance,adv(?:anced?)?,,music,1 other,AI.Upscale,Upscaled (AI),ai[\\-\\_\\. ]upscaled?,,movie, other,All.Access.Cheat,All Access Cheat,all[\\-\\_\\. ]access[\\-\\_\\. ](?:cheats?|save),,game,1 other,BONUS.TRACKS,Bonus Tracks,bonus[\\-\\_\\. ]tracks?,,music,1 other,BONUS,Bonus,(?-i:BONUS),,, other,BOOKWARE,Bookware,,,education,1 other,BOOTLEG,Bootleg,,,music,1 other,BOXSET,Boxset,,,series, other,CFW,Custom Firmware,,,game,1 other,COMMENTARY,Commentary,(?:with[\\-\\_\\. ])commentary|(?-i:C[oO]MM[eE]NT[aA]RY),,movie, other,COMPLETE,Complete,,,movie, other,CONVERT,Convert,(?-i:CONVERT),,, other,COVER,Cover,(?-i:C[oO]V[eE]RS?),,, other,CRACKED,Cracked,,,app, other,CRACKFiX,Fix (crack),crack[\\-\\_\\. ]?fix,,app, other,CUSTOM,Custom,(?-i:C[uU]ST[oO]M),,, other,3D,,,,movie,1 other,Digital.Extras,Extras (digital),digital[\\-\\_\\. ]extras,,movie, other,DIRFIX,Fix (directory),dir[\\-\\_\\. ]?[df]ix?,,, other,Discography,,,,music,1 other,DLC,,(?:(?:plus|including|incl|inc)[\\-\\_\\. ]?)?dlc(?:[\\-\\_\\. ]unlocker)?,,game,1 other,DNR,Digital Noise Reduction,(?-i:DNR),,movie,1 other,DOX,Dox,,,, other,EAC,Exact Audio Copy,(?-i:EAC),,music,1 other,EXTRAS,Extras,(?:(?:plus|including|incl|inc)[\\-\\_\\. ]?)?extras(?:[\\-\\_\\. ]?only)?,,, other,FiNAL,Final,(?-i:F[iI]N[aA]L),,, other,FiX,Fix,(?-i:F[iI]X),,, other,FS,Fullscreen,(?-i:FS),,, other,Half-SBS,3D (half side-by-side),h(?:alf)?[\\-\\_\\. ]?sbs,,movie,1 other,HAPPY.NEW.YEAR,Holiday (new year),(?-i:HAPPY[\\-\\_\\. ]NEW[\\-\\_\\. ]YEARS?),,, other,HiGHLiGHTS,Highlights,(?-i:H[iI]GHL[iI]GHTS),,, other,HiRES,High Resolution,(?-i:H[iI]RES),,, other,HOTFiX,Hotfix,hot[\\-\\_\\. ]?fix,,app, other,HOU,3D (half-over/half-under),,,movie,1 other,HR,High Res,high[\\-\\_\\. ]?res|hr,,movie, other,HYBRiD,Hybrid,,,movie, other,IMAGESET,Image Set,image[\\-\\_\\. ]?set,,, other,IMPORT,Import,,,music,1 other,Incl.Crack,Crack,(?:(?:incl?|and)[\\-\\_\\. ]?)?crack(?:[\\-\\_\\. ](?:only|for))?,,app, other,Incl.Keygen,Keygen,(?:(?:incl?|and)[\\-\\_\\. ])?key[\\-\\_\\. ]?(?:generator|gen|(?:(?:file[\\-\\_\\. ])?)?maker)(?:[\\-\\_\\. ](?:only|for))?,,app, other,Incl.Offline.Crack,Offline Crack,(?:(?:incl?|and)[\\-\\_\\. ]?)?offline[\\-\\_\\. ]?crack(?:[\\-\\_\\. ](?:only|for))?,,app, other,Incl.Patchtool,Patchtool,(?:(?:incl?|and)[\\-\\_\\. ]?)?patch[\\-\\_\\. ]?tool(?:[\\-\\_\\. ](?:only|for))?,,app, other,Incl.Patch,Patch,(?:(?:incl?|and)[\\-\\_\\. ]?)?patch(?:[\\-\\_\\. ](?:only|for))?,,app, other,Incl.Serial,Serial,(?:(?:incl?|and)[\\-\\_\\. ]?)?serial(?:[\\-\\_\\. ](?:only|for))?,,app, other,iNJECT,Console Inject,(?-i:[iI]NJ[eE]CT),,game,1 other,INTERNAL,Internal,(?-i:[iI]NT)|internal,int,, other,JB,Jailbroken,(?-i:JB),,game,1 other,KONTAKT,Samples (Kontakt),(?-i:KONTAKT),,music,1 other,LD,Line Dubbed,,,, other,MD,Mic Dubbed,(?-i:MD),,, other,MERRY.XMAS,Holiday (xmas),(?-i:.ERRY[\\-\\_\\. ](?:XMAS|CHRISTMAS)),,, other,minimalNR,Minimal Noise-Reduction,minimal[\\-\\_\\. ]?nr,,movie,1 other,MOViE.PACK,Movie Pack,movie[\\-\\_\\. ]?pack,,movie,1 other,MULTiFORMAT,Multiformat,,,music,1 other,NFOFiX,Fix (nfo),i?nfo[\\-\\_\\. ]?fix,,, other,no-DNR,No Digital Noise Reduction,no[\\-\\_\\. ]?dnr,,movie,1 other,NoCD,Crack (no CD),,,game,1 other,NUKED,Nuked,nuked?,,, other,ONESIDED,Vinyl (onesided),,,music,1 other,OST,Soundtrack (OST),(?:original[\\-\\_\\. ](?:motion[\\-\\_\\. ]picture[\\-\\_\\. ])?)?soundtrack|ost,,music,1 other,PATCHED,Patched,,,app, other,PROMO,Promo,,,music, other,PROOFFiX,Fix (proof),,,, other,PROOF,Proof,(?-i:PROOF),,, other,PROPER,Proper,,,, other,RARFiX,Fix (rar),,,, other,READNFO,Read NFO,read[\\-\\_\\. ]?i?nfo,,, other,REAL.PROPER,Proper (real),real[\\-\\_\\. ]?proper,,, other,REAL,Real,(?-i:REAL),,, other,REGiSTERED,Registered,registered|regged,,app,1 other,REISSUE,Reissue,,,music, other,REMAKE,Remake,(?-i:REMAKE),,, other,REMASTERED,Remastered,remaster(?:ed)?,,, other,REMiX,Remix,(?:re[\\-\\_\\. ]?)?mix(?:e[sd])?(?:[\\-\\_\\. ]edition)?,,music,1 other,REMUX,Remux,,,, other,REPACK,Repack,repack(?:ed)?,,, other,RERELEASE,Re-release,re[\\-\\_\\. ]?release,,music,1 other,REREPACK,Re-repack,rerepack|repack2,,, other,RERiP,Re-rip,re[\\-\\_\\. ]?rip,,, other,RESTORATiON,Restoration,,,movie, other,RETAiL,Retail,,,, other,RiP,Rip,(?-i:RiP),,, other,SAMPLEFiX,Fix (sample),,,movie, other,SAMPLER,Sampler,(?:album[\\-\\_\\. ]?)?sampler,,music,1 other,SBS,3D (side-by-side),,,movie,1 other,SCRUBBED,Scrubbed,,,game,1 other,Serial.Fix,Fix (serial),serial[\\-\\_\\. ]?fix,,app, other,Special.Features,Special Features,(?:(?:with|incl?)?[\\-\\_\\. ])?special[\\-\\_\\. ]features,,movie, other,Strategy.Guide,Strategy Guide,strategy[\\-\\_\\. ]?guide,,book,1 other,SUB100,Sub 100,sub[\\-\\_\\. ]?100,,app, other,SYNCFiX,Fix (sync),,,movie, other,TRACKFiX,Fix (track),track[\\-\\_\\. ]?fix,,music,1 other,TUTORiAL,Tutorial,(?-i:T[uU]T[oO]R[iI][aA]L),,education,1 other,UNRELEASED,Unreleased,,,music,1 other,UPDATE,Update,,,app, other,UPSCALED,Upscaled,upscaled?,,movie,1 other,VC,Virtual Console,,,game,1 other,VERTICAL,Vertical,(?-i:V[eE]RT[iI]C[aA]L),,, other,Virtual.Crack,Crack (virtual),virtual[\\-\\_\\. ]?crack,,game,1 other,VIRUS.FREE,,virus[\\-\\_\\. ]free,,app, other,VR180,,vr[\\-\\_\\. ]?180,,movie, other,VR,,,,movie, other,WORKING,Working,(?-i:W[oO]RK[iI]NG),,app, other,WS,Widescreen,widescreen|ws,,movie, other,$1X,,((?:19|20)[\\d|x])x,,music,1 other,Plus.$2.Trainer,Trainer ($2),(?:plus[\\-\\_\\. ])?(\\d\\d?)[\\-\\_\\. ]?trainer,,game,1 platform,AIX,,,,app,1 platform,ANDROiD,Android,(?-i:ANDRO[iI]D),,app, platform,DOS,,(?-i:DOS),,app,1 platform,3DS,Nintendo 3DS,(?-i:3DS),,game,1 platform,DSi,Nintendo DSi,,,game,1 platform,FC,Nintendo Famicom,,,game,1 platform,FreeBSD,,free[\\-\\_\\. ]?bsd,,app,1 platform,GBA,Nintendo Gameboy Advanced,,,game,1 platform,GB,Nintendo Gameboy,,,game,1 platform,GCN,Nintendo GameCube (North America),,,game,1 platform,HP-UX,,hp[\\-\\_\\. ]?ux,,app,1 platform,IRIX,,,,app,1 platform,Linux,,,,app, platform,MacOSX,,(?:mac[\\-\\_\\. ]?)?osx,,app, platform,MacOS,,mac[\\-\\_\\. ]?os,,app, platform,MEGACD,Sega Mega-CD,[ms]ega[\\-\\_\\. ]?cd,,game,1 platform,MultiOS,Multi OS,,,app,1 platform,N64,Nintendo 64,,,game,1 platform,NDS,Nintendo DS,,,game,1 platform,NES,Nintendo Entertainment System,,,game,1 platform,NGC,Nintendo GameCube (Japan),,,game,1 platform,NGPC,Neo Geo Pocket Color,,,game,1 platform,NG,Neo Geo,ng|neo[\\-\\_\\. ]?geo,,game,1 platform,NSW,Nintendo Switch,ns[wp]|xci,,game,1 platform,OpenBSD,,open[\\-\\_\\. ]?bsd,,app,1 platform,PC,,(?-i:PC),,app, platform,PS5,PlayStation 5,ps[\\-\\_\\. ]?5,,game,1 platform,PS4,PlayStation 4,ps[\\-\\_\\. ]?4,,game,1 platform,PS3,PlayStation 3,ps[\\-\\_\\. ]?3,,game,1 platform,PS2,PlayStation 2,ps[\\-\\_\\. ]?(?:2|rip),,game,1 platform,PS1,PlayStation 1,ps[\\-\\_\\. ]?[x1]|(?-i:PS),,game,1 platform,PSP,PlayStation Portable,,,game,1 platform,PSV,PlayStation Vita,psv(?:ita)?,,game,1 platform,SFC,Nintendo Super Famicom,,,game,1 platform,SNES,Super Nintendo Entertainment System,,,game,1 platform,Solaris.Intel,Solaris (Intel),solaris[\\-\\_\\. ]intel,,app,1 platform,Solaris.Sparc,Solaris (SPARC),solaris[\\-\\_\\. ]sparc,,app,1 platform,TG16,TurboGrafx 16,tg[\\-\\_\\. ]?16|pce(?:[\\-\\_\\. ]?(?:cd))?,,game,1 platform,VVD,V.Flash (VTech V.Disc),,,game,1 platform,WiiU,Nintendo Wii U,wii[\\-\\_\\. ]?u,,game,1 platform,Wii,Nintendo Wii,,,game,1 platform,Win95NT4,Windows 95/NT4,(for[\\-\\_\\. ])?(?:windows|win)[\\-\\_\\. ]?95[\\-\\_\\. ]?nt4,,app, platform,Win9xNT4,Windows 9x/NT4,(for[\\-\\_\\. ])?(?:windows|win)[\\-\\_\\. ]?9x[\\-\\_\\. ]?nt4,,app, platform,Win95NT,Windows 95/NT,(for[\\-\\_\\. ])?(?:windows|win)[\\-\\_\\. ]?95[\\-\\_\\. ]?nt,,app, platform,Win9xNT,Windows 9x/NT,(for[\\-\\_\\. ])?(?:windows|win)[\\-\\_\\. ]?9x[\\-\\_\\. ]?nt,,app, platform,Win311,Windows 3.11,(for[\\-\\_\\. ])?(?:windows|win)[\\-\\_\\. ]?3[\\-\\_\\. ]?11,,app, platform,WinAll,Windows (all),(for[\\-\\_\\. ])?(?:windows|win)[\\-\\_\\. ]?all,,app, platform,WinNT4,Windows NT4,(for[\\-\\_\\. ])?(?:windows|win)[\\-\\_\\. ]?nt4,,app, platform,Win98,Windows 98,(for[\\-\\_\\. ])?(?:windows|win)[\\-\\_\\. ]?98,,app, platform,Win95,Windows 95,(for[\\-\\_\\. ])?(?:windows|win)[\\-\\_\\. ]?95,,app, platform,Win64,Windows (x64),(for[\\-\\_\\. ])?(?:windows|win)[\\-\\_\\. ]?64,,app, platform,Win32,Windows (x86),(for[\\-\\_\\. ])?(?:windows|win)[\\-\\_\\. ]?32,,app, platform,WinME,Windows ME,(for[\\-\\_\\. ])?(?:windows|win)[\\-\\_\\. ]?me,,app, platform,WinNT,Windows NT,(for[\\-\\_\\. ])?(?:windows|win)[\\-\\_\\. ]?nt,,app, platform,WinPE,Windows PE,(based[\\-\\_\\. ]on[\\-\\_\\. ])?(?:windows|win)[\\-\\_\\. ]?pe,,app, platform,Win9x,Windows 9x,(for[\\-\\_\\. ])?(?:windows|win)[\\-\\_\\. ]?9x,,app, platform,XBOX360,Xbox 360,xbox[\\-\\_\\. ]?360,,game,1 platform,XBOXONE,Xbox One,xbox[\\-\\_\\. ]?one,,game,1 platform,XBOX,Xbox,xbox(?:rip)?,,game,1 region,R0,Global (R0),,,movie, region,R1,United States (R1),,,movie, region,R2,Europe (R2),,,movie, region,R3,Southeast Asia (R3),,,movie, region,R4,Latin America (R4),,,movie, region,R5,Africa (R5),,,movie, region,R6,China (R6),,,movie, region,R7,Media (R7),,,movie, region,R8,International (R8),,,movie, region,R9,Any (R9),,,movie, region,UK,United Kingom,(?-i:UK),,, region,AUS,Australia,(?-i:AUS),,, region,CAN,Canada,(?-i:CAN),,, region,CEE,Central and Eastern Europe,,,, region,EUR,Europe,,,, region,FRA,France,(?-i:FRA|FRE),,, region,GER,Germany,(?-i:GER),,, region,INT,International,(?-i:INT),,, region,JPN,Japan,jpn|(?-i:JAP|JP),,, region,KOR,South Korea,(?-i:KOR),,, region,NOR,Norway,(?-i:NOR),,, region,POL,Poland,(?-i:POL),,, region,USA,United States,(?-i:US|USA),,, resolution,PN.Selector,PAL/NTSC Selector,p(?:al)?[\\-\\_\\. ]?n(?:tsc)?[\\-\\_\\. ]selector,,game,1 resolution,DCI4K,DCI 4k,dci[\\-\\_\\. ]?4k|4096x2160,,, resolution,DCI2K,DCI 2k,dci[\\-\\_\\. ]?2k|2048x1080,,, resolution,4320p,UltraHD 8K (4320p),4320p|7680x4320,,, resolution,3240p,6k (3240p),3240p|6k|5760x3240,,, resolution,2880p,5k (2880p),2880p|5k|5120x2880,,, resolution,2160p,UltraHD 4K (2160p),2160p|3840x2160|uhd|ultra[\\-\\_\\. ]?hd|4k,,, resolution,1800p,QHD+ (1800p),1800p|3200x1800,,, resolution,1440p,QHD (1440p),1440p|2560x1440,,, resolution,1080p,FullHD (1080p),1080[ip]|1920x1080,,, resolution,900p,HD+ (900p),900[ip]|1600x900,,, resolution,720p,HD (720p),720[ip]|1280x720,,, resolution,576p,PAL (576p),576[ip]|720x576|pal,,, resolution,540p,qHD (540p),540[ip]|960x540,,, resolution,480p,NTSC (480p),480[ip]|720x480|848x480|854x480|ntsc,,, resolution,360p,nHD (360p),360[ip]|640x360,,, resolution,$1p,Other ($1p),([123]\\d{3})p,,, size,BD50,BD (50GB),bd[\\-\\_\\. ]?50,,movie, size,BD25,BD (25GB),bd[\\-\\_\\. ]?25,,movie, size,BD9,BD (9GB),bd[\\-\\_\\. ]?9,,movie, size,BD5,BD (5GB),bd[\\-\\_\\. ]?5,,movie, size,BDRW,BD (RW),bd[\\-\\_\\. ]?rw,,movie, size,BDR,BD (R),bd[\\-\\_\\. ]?r,,movie, size,CDRW,CD (RW),cd[\\-\\_\\. ]?rw,,music, size,CDR,CD (R),cd[\\-\\_\\. ]?r,,music, size,DVD9,DVD (9GB),dvd[\\-\\_\\. ]?9,,movie, size,DVD5,DVD (5GB),dvd[\\-\\_\\. ]?5,,movie, size,DVDRW,DVD (RW),dvd[\\-\\_\\. ]?rw,,movie, size,DVDR,DVD (R),dvd[\\-\\_\\. ]?r,,movie, size,FULLDVD,DVD (full),,,game,1 size,MCD,CD (music),m[\\-\\_\\. ]?cd,,music,1 size,MDVD9,DVD (9GB music),m[\\-\\_\\. ]?dvd[\\-\\_\\. ]?9,,music,1 size,MDVD5,DVD (5GB music),m[\\-\\_\\. ]?dvd[\\-\\_\\. ]?5,,music,1 size,MDVDRW,DVD (RW music),m[\\-\\_\\. ]?dvd(?:[\\-\\_\\. ]?rw),,music,1 size,MDVDR,DVD (R music),m[\\-\\_\\. ]?dvd(?:[\\-\\_\\. ]?r),,music,1 size,MDVD,DVD (music),m[\\-\\_\\. ]?dvd,,music,1 size,512MS,MemoryStick (512mb),,,game,1 size,$1$2,$1 $2,(\\d+(?:\\.\\d+)?)?[\\-\\_\\. ]?([kmgt]i?b),,movie, source,AHDTV,High-Definition TV (analog),,,movie, source,AUDiOBOOK,Audiobook,a(?:udio[\\-\\_\\. ]?)?books?,,audiobook,1 source,BDRiP,BluRay (rip),b[dr]?[\\-\\_\\. ]?rip,,movie, source,BDSCR,BluRay (screener),b[dr][\\-\\_\\. ]?scr(?:eener)?,,movie, source,BluRay3D,,blu[\\-\\_\\. ]?ray[\\-\\_\\. ]?3d|bd3d,,movie, source,BluRayRiP,BluRay (rip),,,movie, source,BluRay,,blu[\\-\\_\\. ]?ray|bd,,movie, source,BRDRip,BluRay Disc (rip),,,movie, source,CABLE,Radio (cable),(?-i:CABLE),,music,1 source,CAMRiP,CAM (rip),cam[\\-\\_\\. ]?rip,,movie, source,CAM,,(?-i:CAM),,movie, source,CDA,Audio CD,,,music,1 source,CDEP,Extended Play (CD),cdep|epcd,,music,1 source,CDLP,Limited Play (CD),,,music,1 source,CDM,Compact Disc Maxi Single,,,music,1 source,CDREP,CD (reproduced),,,music,1 source,CDRiP,Compact Disc (rip),cd[\\-\\_\\. ]?rip,,music,1 source,CDSP,Standard Play (CD),,,music,1 source,CDS,Compact Disc Single,cds|cd[\\-\\_\\. ]?single,,music, source,CD,Compact Disc,cd[\\-\\_\\. ]?(?:album)?,,music, source,CloneCD,Clone (CD),clone[\\-\\_\\. ]?cd,,game,1 source,CloneDVD,Clone (DVD),clone[\\-\\_\\. ]?dvd,,game,1 source,COMiC,Comic,(?:classic[\\-\\_\\. ])?comics?,,comic,1 source,CVD,China Video Disc,,,movie, source,DAT,Datacable,(?-i:DAT),,music,1 source,DCPRiP,Digital Cinema Package (rip),dcp[\\-\\_\\. ]?rip,,movie, source,DCP,Digital Cinema Package,,,movie, source,DDCRiP,Digital Distribution Copy (rip),ddc[\\-\\_\\. ]?rip,,music, source,DDC,Digital Distribution Copy,,,music, source,Digipak,Digipak CD,,,music,1 source,DSRiP,Digital Satellite (rip),ds[\\-\\_\\. ]?rip|dsr,,, source,DS,Digital Satellite,,,, source,DTheater,,,,movie, source,DTHRiP,Satellite (DTH rip),dth[\\-\\_\\. ]?rip,,, source,DTH,Satellite (DTH),,,, source,DTSD,DTS (dual language),,,, source,3DTV,,,,movie, source,DTVRiP,Digital TV (rip),dtv[\\-\\_\\. ]?rip,,, source,DTV,Digital TV,,,, source,DVBC,Digital Video Broadcasting (cable),dvb[\\-\\_\\. ]?c,,music, source,DVBRiP,Digital Video Broadcasting (rip),dvb[\\-\\_\\. ]?rip,,, source,DVBS,Digital Video Broadcasting (satellite),dvb[\\-\\_\\. ]?s,,music, source,DVBT,Digital Video Broadcasting (terrestial),dvb[\\-\\_\\. ]?t,,music, source,DVB,Digital Video Brodacasting,,,music, source,DVDA,Audio DVD,,,music,1 source,DVDRiP,Digital Video Disc (rip),dvd[\\-\\_\\. ]?rip,,movie, source,DVDSCRRiP,Digital Video Disc (screener rip),(?:dvd[\\-\\_\\. ]?)?scr(?:eener)?_rip,,movie, source,DVDSCR,Digital Video Disc (screener),(?:dvd[\\-\\_\\. ]?)?scr(?:eener)?,,movie,1 source,DVDS,Digital Video Disc (single),dvds(?:ingle)?,,music,1 source,DVD,Digital Video Disc,dvd,,movie, source,DVTV,Digital Versatile Television,,,, source,eBook,,ebooks?,,book, source,EP,Extended Play,(?-i:EP),,music,1 source,FESTiVAL,Festival,(?-i:F[eE]ST[iI]V[aA]L),,movie, source,FM,,(?-i:FM),,music,1 source,HDCAM,CAM (HD),hd[\\-\\._ ]?cam,,movie, source,HDDVDRiP,High-Definition Digital Video Disc (rip),hd[\\-\\_\\. ]?dvd[\\-\\_\\. ]?rip,,movie, source,HDDVD,High-Definition Digital Video Disc,hd[\\-\\_\\. ]?dvd,,movie, source,HDRiP,High-Definition TV (rip),hd(?:tv)?[\\-\\_\\. ]?rip,,movie, source,HDTC,Telecine (HD),hd[\\-\\_\\. ]?tc,,movie, source,HDTS,Telesync (HD),hd[\\-\\_\\. ]?ts,,movie, source,HDTV,High-Definition TV,,,, source,HFR,High Frame Rate,,,movie, source,IVTC,Inverse Telecine,,,music, source,LASERDiSC,LaserDisc,,,movie, source,LP,Limited Play,(?-i:LP),,music,1 source,MAGAZiNE,Magazine,(?-i:MAGAZ[iI]NE),,magazine,1 source,MBluRay,Music BluRay,m(?:usic)?[\\-\\_\\. ]?blu[\\-\\_\\. ]?ray|mbd,,music,1 source,35mm,Film (35mm),,,movie,1 source,16mm,Film (16mm),,,movie,1 source,PDTV,Pure Digital TV,,,, source,PDVD,Digital Video Disc (pirated),,,movie,1 source,PS2CD,PlayStation 2 (CD),,,game,1 source,PS2DVD,PlayStation 2 (DVD),,,game,1 source,PSXPSP,PlayStation 1 to PlayStation Portable Backup,,,game,1 source,RADIO,Radio,(?-i:R[aA]D[iI][oO]),,music,1 source,SATRiP,Satellite (rip),sat[\\-\\_\\. ]?rip,,, source,SAT,Satellite Radio,(?-i:SAT),,music, source,SBD,Soundboard,(?-i:SBD|DAB),,music,1 source,SCAN,Comic (scan),(?-i:SCAN),,comic,1 source,SCD,Sample CD,,,music,1 source,SDTV,TV (SD),,,, source,SFCloneCD,Clone (StarForce CD),sf[\\-\\_\\. ]?clone[\\-\\_\\. ]?cd,,game,1 source,SFCloneDVD,Clone (StarForce DVD),sf[\\-\\_\\. ]?clone[\\-\\_\\. ]?dvd,,game,1 source,SFClone,Clone (StarForce),sf[\\-\\_\\. ]?clone,,game,1 source,SINGLE,Single,(?-i:S[iI]NGLE|SI),,music,1 source,SP,Standard Play,(?-i:SP),,music,1 source,STREAM,Stream,(?-i:STREAM),,music,1 source,SVCDRiP,Super Video CD (rip),svcd[\\-\\_\\. ]?rip,,music, source,SVCD,Super Video CD,,,music, source,TAPE,Tape,(?-i:TAPE),,music,1 source,TC,Telecine,telecine|tc,,movie, source,TS,Telesync,telesync|ts,,movie, source,TVHSRiP,TV HS (rip),tvhs[\\-\\_\\. ]?rip,,, source,TVRiP,TV (rip),tv[\\-\\_\\. ]?rip,,, source,UHD.BDRiP,Ultra High-Definiton BluRay (rip),uhd[\\-\\_\\. ]?(?:bd)?rip,,movie, source,UHD.WEB-DL,Ultra High-Definiton Web (dl),uhd[\\-\\_\\. ]?web[\\-\\_\\. ]?dl,,movie, source,UHD.BluRay,Ultra High-Definiton BluRay,uhd(?:[\\-\\_\\. ]?(?:blu[\\-\\_\\. ]?ray|bd))?,,movie, source,UHDTV,Ultra High-Definition TV,,,, source,UMDMOVIE,Universal Media Disc Movie,,,, source,UMDRiP,Universal Media Disc (rip),umd[\\-\\_\\. ]?rip,,game,1 source,UMD,Universal Media Disc,,,game,1 source,VCDRiP,Video CD (rip),vcd[\\-\\_\\. ]?rip,,movie, source,VCD,Video CD,,,movie, source,VHSRiP,VHS (rip),vhs[\\-\\_\\. ]?rip,,movie, source,VHS,,,,movie, source,ViNYLRiP,Vinyl (rip),,,music,1 source,ViNYL,Vinyl,vinyl|vl,,music,1 source,VLS,Vinyl (single),vls,,music,1 source,VODRiP,Video-on-Demand (rip),vod[\\-\\_\\. ]?rip,,movie, source,VOD,Video-on-Demand,,,movie, source,WEB-DL,Web (DL),web[\\-\\_\\. ]?dl,,movie, source,WEB-HD,Web (HD),web[\\-\\_\\. ]?hd,,movie, source,WEBFLAC,Web (FLAC),,,music,1 source,WebHDRiP,Web (HD rip),,,movie, source,WEBRiP,Web (rip),web[\\-\\_\\. ]?rip,,movie, source,WEBSCR,Web (screener),web[\\-\\_\\. ]?scr(?:eener)?,,movie,1 source,WebUHD,Web (UHD),,,movie, source,WEB,Web,,,, source,Whitelabel,Whitelabel Promo,whitelabel|wlp,,music,1 source,WORKPRiNT,Workprint,workprint|wp,,movie,1 source,XBOXDVD,Xbox (DVD),,,game,1 source,$1INCH.ViNYL,Vinyl ($i inch),(\\d\\d?)[\\-\\_\\. ]?inch(?:[\\-\\_\\. ]?vinyl)?,,music,1 `; // ---------------------------------------------------------------------- // 2. Enums and Data Classes (Exported) // ---------------------------------------------------------------------- /** @enum {number} */ const TagType = { WHITESPACE: 0, DELIM: 1, TEXT: 2, PLATFORM: 3, ARCH: 4, SOURCE: 5, RESOLUTION: 6, COLLECTION: 7, DATE: 8, SERIES: 9, VERSION: 10, DISC: 11, CODEC: 12, HDR: 13, AUDIO: 14, CHANNELS: 15, OTHER: 16, CUT: 17, EDITION: 18, LANGUAGE: 19, SIZE: 20, REGION: 21, CONTAINER: 22, GENRE: 23, ID: 24, GROUP: 25, META: 26, EXT: 27, }; /** @enum {string} */ const ReleaseType = { UNKNOWN: "unknown", APP: "app", AUDIOBOOK: "audiobook", BOOK: "book", COMIC: "comic", EDUCATION: "education", EPISODE: "episode", GAME: "game", MAGAZINE: "magazine", MOVIE: "movie", MUSIC: "music", SERIES: "series", }; /** * Parses a release type from a string. * @param {string} s The string to parse. * @returns {ReleaseType} The corresponding release type enum. */ ReleaseType.fromString = function(s) { if (!s) return this.UNKNOWN; const sUpper = s.toUpperCase(); for (const key in this) { if (key === sUpper) { return this[key]; } } return this.UNKNOWN; }; /** * Checks if the release type is one of the provided types. * @param {ReleaseType} self The release type instance to check. * @param {...ReleaseType} types A variable number of types to check against. * @returns {boolean} True if the type is in the provided list, false otherwise. */ ReleaseType.isIn = function(self, ...types) { return types.includes(self); } /** * Describes a single entry from the tag info database (e.g., taginfo.csv). * It holds the canonical tag, its regex, title, and other metadata. */ class TagInfo { /** * Describes tag information. * @param {string} tag The canonical tag string (e.g., 'BDRip'). * @param {string} title The display title for the tag (e.g., 'BluRay (rip)'). * @param {string} regexp The regex pattern used to match this tag. * @param {string} other An alternative or related tag string. * @param {ReleaseType} typ The primary release type this tag is associated with. * @param {boolean} excl Whether this tag is exclusive to its release type. */ constructor(tag, title, regexp, other, typ, excl) { this.tag = tag; this.title = title; this.regexp = regexp; this.other = other; this.typ = typ; this.excl = excl; try { if (this.regexp === "collector[[\\-\\_\\. ']?s[\\-\\_\\. ]edition") { this.regexp = "collector[\\-\\_\\. ]?s[\\-\\_\\. ]edition"; } /** @type {import('re2')} */ this.rePattern = null; const basePattern = this.getRePattern(); const finalPattern = `^(?:${basePattern})$`; this.rePattern = new RE2(finalPattern, 'i'); } catch (e) { const err = new Error(`Tag '${this.tag}' has invalid regexp '${this.regexp}': ${e.message}`); err.cause = e; throw err; } } /** * Returns the tag info regexp string. * @returns {string} The raw regular expression string for the tag. */ getRePattern() { if (this.regexp && this.regexp.length > 0) return this.regexp; const escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); return escapeRegex(this.tag); } /** * Matches the tag info to a given string. * @param {string} s The string to match against the tag's regex. * @returns {boolean} True if the string matches, false otherwise. */ match(s) { return this.rePattern.test(s); } } /** * Represents a single parsed token (a "tag") from a release string. * It contains the tag's type, its original text, and any captured values from the regex match. */ class Tag { /** * Represents a parsed tag from a release string. * @param {TagType} typ The type of the tag. * @param {string[]} v An array of strings, where `v[0]` is the original matched text and subsequent elements are captured groups. * @param {FindFunc | null} findFunc A function to find associated metadata (TagInfo) for this tag. * @param {TagType} prevTyp The previous type of the tag, used for reverting changes. * @param {FindFunc | null} prevFindFunc The previous find function. */ constructor(typ, v, findFunc, prevTyp, prevFindFunc) { this.typ = typ; this.v = v; this.findFunc = findFunc; this.prevTyp = prevTyp; this.prevFindFunc = prevFindFunc; } /** * Creates a new tag. * @param {TagType} typ The type of the tag. * @param {FindFunc | null} findFunc The function to find associated tag info. * @param {...(string|Buffer|null|undefined|number)} byteVals The values for the tag. The first is the original matched string, subsequent values are captures. * @returns {Tag} The newly created tag. * @throws {Error} If less than two values are provided. */ static new(typ, findFunc, ...byteVals) { if (byteVals.length < 2) { throw new Error("Must provide at least 2 values to new_tag"); } const strVals = []; for (const v of byteVals) { if (Buffer.isBuffer(v)) { strVals.push(v.toString('utf-8', 'replace')); } else { strVals.push(v != null ? String(v) : ""); } } return new Tag(typ, strVals, findFunc, typ, findFunc); } /** * Returns a copy of the tag as a tag of the specified type. * @param {TagType} newTyp The new tag type. * @param {FindFunc | null} newFindFunc The new find function. * @returns {Tag} A new tag with the specified type. */ as(newTyp, newFindFunc) { return new Tag( newTyp, this.v, newFindFunc, this.typ, this.findFunc ); } /** * Returns a copy of the tag as the tag's previous type. * @returns {Tag} A new tag with the previous type and find function. */ revert() { return new Tag( this.prevTyp, this.v, this.prevFindFunc, this.prevTyp, this.prevFindFunc ); } /** * Checks if the tag is of one of the specified types. * @param {...TagType} types A variable number of tag types to check against. * @returns {boolean} True if the tag's type matches any of the provided types. */ is(...types) { return types.includes(this.typ); } /** * Checks if the tag's previous type was one of the specified types. * @param {...TagType} types A variable number of tag types to check against. * @returns {boolean} True if the tag's previous type matches any of the provided types. */ was(...types) { return types.includes(this.prevTyp); } } /** * Retrieves the tag's associated tag info. * @returns {TagInfo | null} The associated TagInfo object, or null if not found. */ Tag.prototype.info = function() { if (this.findFunc) { return this.findFunc(this.normalize()); } return null; }; /** * Checks if the tag represents a single episode (e.g., "E01" without a season). * @returns {boolean} True if the tag is a series tag for a single episode without a season. */ Tag.prototype.singleEp = function() { if (this.typ === TagType.SERIES) { const [s, e] = this.series(); return s === 0 && e !== 0 && this.v[1] === "" && this.v[0] === this.v[2]; } return false; }; /** * Returns the associated release type from the tag's info. * @returns {ReleaseType} The release type (e.g., Movie, Music) from the tag's metadata. */ Tag.prototype.infoType = function() { const info = this.info(); return info ? info.typ : ReleaseType.UNKNOWN; }; /** * Returns the exclusivity flag from the tag's info. * @returns {boolean} True if the tag is exclusive to its release type. */ Tag.prototype.infoExcl = function() { const info = this.info(); return info ? info.excl : false; }; /** * Retrieves the tag's title from its info, substituting any placeholders. * @returns {string} The formatted title string from the tag's metadata. */ Tag.prototype.infoTitle = function() { const info = this.info(); if (info) { let s = info.title; this.v.slice(1).forEach((val, i) => { s = s.replace(`$${i + 1}`, val); }); return s; } return ""; }; /** * Normalizes a string by looking up its info and replacing placeholders. * @param {string} s The string to normalize. * @param {...string} v Values to substitute into placeholders like $1, $2. * @returns {string} The normalized string. * @private */ Tag.prototype._normalizeWithFunc = function(s, ...v) { if (this.findFunc) { const info = this.findFunc(s); if (info) { s = info.tag; } } for (let i = 0; i < v.length; i++) { s = s.replace(`$${i + 1}`, v[i]); } return s; }; /** * Returns the normalized string for the tag based on its type. * @returns {string} The normalized string representation of the tag. */ Tag.prototype.normalize = function() { switch (this.typ) { case TagType.WHITESPACE: return this.whitespace(); case TagType.DELIM: return this.delim(); case TagType.TEXT: return this.text(); case TagType.PLATFORM: return this.platform(); case TagType.ARCH: return this.arch(); case TagType.SOURCE: return this.source(); case TagType.RESOLUTION: return this.resolution(); case TagType.COLLECTION: return this.collection(); case TagType.DATE: { const [year, month, day] = this.date(); if (month && day) { return `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`; } return String(year); } case TagType.SERIES: { const [series, episode] = this.series(); if (episode) { return `S${String(series).padStart(2, '0')}E${String(episode).padStart(2, '0')}`; } return `S${String(series).padStart(2, '0')}`; } case TagType.VERSION: return this.version(); case TagType.DISC: return this.disc(); case TagType.CODEC: return this.codec(); case TagType.HDR: return this.hdr(); case TagType.AUDIO: return this.audio(); case TagType.CHANNELS: return this.channels(); case TagType.OTHER: return this.other(); case TagType.CUT: return this.cut(); case TagType.EDITION: return this.edition(); case TagType.LANGUAGE: return this.language(); case TagType.SIZE: return this.size(); case TagType.REGION: return this.region(); case TagType.CONTAINER: return this.container(); case TagType.GENRE: return this.genre(); case TagType.ID: return this.id_(); case TagType.GROUP: return this.group(); case TagType.META: { const [typ, s] = this.meta(); if (typ === "site" || typ === "sum") return `[${s}]`; if (typ === "pass") return `{{${s}}}`; if (typ === "req") return "[REQ]"; return `[[${typ}:${s}]]`; } case TagType.EXT: return this.ext(); default: return ""; } }; /** * Formats the tag into a string based on the verb. * * Format Options: * - `q`: All values including captured values, quoted (e.g., `["2009", "2009", "", ""]`) * - `o`: Original matched string (e.g., `2009`) * - `v`: Tag type followed by colon and quoted capture values (e.g., `Date:["2009", "", ""]`) * - `e`: Tag type and normalized value in angle brackets (e.g., `<Date:2009>`) * - `s`, `r`: Normalized value (e.g., `2009`) * @param {string} verb The formatting verb. * @returns {string} The formatted string. */ Tag.prototype.format = function(verb) { switch (verb) { case 'q': return `"${inspect(this.v)}"`; case 'o': return this.v[0]; case 'v': return `${Object.keys(TagType).find(k => TagType[k] === this.typ)}:${inspect(this.v.slice(1))}`; case 'e': { const s = this.normalize(); return `<${Object.keys(TagType).find(k => TagType[k] === this.typ)}:${s}>`; } case 's': case 'r': return this.normalize(); } return ""; }; /** * Returns the original matched string for the tag. * @returns {string} The original text that this tag was parsed from. */ Tag.prototype.toString = function() { return this.format('o'); }; /** * Determines if a string matches the tag. * @param {string} s The string to match. * @param {string} verb The formatting verb to use for comparison ('o', 's', 'r', etc.). * @param {...TagType} types Optional types to filter by; if provided, the tag must be one of these types. * @returns {boolean} True if the string matches the tag. */ Tag.prototype.match = function(s, verb, ...types) { if (types.length > 0 && !types.includes(this.typ)) { return false; } let v = this.format(verb); if (!s) { return true; } if (this.findFunc && verb === 's') { const info = this.findFunc(s); if (info) { s = info.tag; } } if (verb === 'r') { return new RegExp(s).test(v); } return s === v; }; /** Normalizes the whitespace value. */ Tag.prototype