.replaceAll(/[`´‘’ʻ]/, "'") turning into .replaceAll(/[`-¦GÇÿGÇÖ-+]/, ')

Support for Windows users
Post Reply
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

.replaceAll(/[`´‘’ʻ]/, "'") turning into .replaceAll(/[`-¦GÇÿGÇÖ-+]/, ')

Post by ZeroByDivide »

Trying to change my format expressions back to how they used to be but for some reason I can't get

Code: Select all

.replaceAll(/[`´‘’ʻ]/, "'")
to work correctly.. whenever it's going through it ends up turning into

Code: Select all

 .replaceAll(/[`-¦GÇÿGÇÖ-+]/, ')
which ends up causing filebot to error out

Code: Select all

Run script [fn:amc] at [Sun Dec 18 11:13:20 CST 2016]
Parameter: ut_dir = C:\Users\JourneyOver\Desktop\QBT\The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION
Parameter: ut_kind = multi
Parameter: ut_title = The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION
Parameter: excludeList = C:/Users/JourneyOver/Dropbox/Public/Folders/Filebot/logs/filebot-history.log
Parameter: music = false
Parameter: subtitles = en
Parameter: artwork = false
Parameter: extras = false
Parameter: plex = *****
Parameter: storeReport = false
Parameter: skipExtract = false
Parameter: clean = true
Parameter: deleteAfterExtract = true
Parameter: seriesFormat = /TV Shows/{N}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{N.replaceTrailingBrackets()} - {episode.special ? 'S00E'+special.pad(2) : S00E00} - {T.replaceAll(/[`-¦GÇÿGÇÖ-+]/, ').lowerTrail().replacePart(', Part $1')}
Parameter: animeFormat = /Anime/{N}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{N.replaceTrailingBrackets()} - {episode.special ? 'S00E'+special.pad(2) : S00E00} - {T.lowerTrail().replacePart(', Part $1')}
Parameter: movieFormat = /Movies/{N} [{y}]/{N.replaceTrailingBrackets()} [{y}]
Parameter: exec = cmd /c C:\Users\JourneyOver\Dropbox\Public\Folders\Filebot\MyStuff\callpowershell.bat
Use excludes: C:\Users\JourneyOver\Dropbox\Public\Folders\Filebot\logs\filebot-history.log
Read archive [hawkings.kids.1011.720p-dimension.rar] and extract to [C:\Users\JourneyOver\Desktop\QBT\The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION\hawkings.kids.1011.720p-dimension\The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION]
Extracting files [C:\Users\JourneyOver\Desktop\QBT\The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION\hawkings.kids.1011.720p-dimension\The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION\The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION.mkv]
Input: C:\Users\JourneyOver\Desktop\QBT\The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION\hawkings.kids.1011.720p-dimension\The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION\The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION.mkv
Group: [tvs:the big bang theory] => [The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION.mkv]
Get [English] subtitles for 1 files
Looking up subtitles by hash via OpenSubtitles
Fetching [English] subtitles [The.Big.Bang.Theory.S10E11.HDTV.x264-LOL.srt] from [OpenSubtitles]
Export [The.Big.Bang.Theory.S10E11.HDTV.x264-LOL.srt] as [SubRip / UTF-8]
Writing [The.Big.Bang.Theory.S10E11.HDTV.x264-LOL.srt] to [The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION.eng.srt]
SyntaxError: unexpected char: '`'
Delete archive C:\Users\JourneyOver\Desktop\QBT\The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION\hawkings.kids.1011.720p-dimension.rar
Delete archive volume C:\Users\JourneyOver\Desktop\QBT\The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION\hawkings.kids.1011.720p-dimension.r00
Delete archive volume C:\Users\JourneyOver\Desktop\QBT\The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION\hawkings.kids.1011.720p-dimension.r01
Delete archive volume C:\Users\JourneyOver\Desktop\QBT\The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION\hawkings.kids.1011.720p-dimension.r02
Delete archive volume C:\Users\JourneyOver\Desktop\QBT\The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION\hawkings.kids.1011.720p-dimension.r03
Delete archive volume C:\Users\JourneyOver\Desktop\QBT\The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION\hawkings.kids.1011.720p-dimension.r04
Delete archive volume C:\Users\JourneyOver\Desktop\QBT\The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION\hawkings.kids.1011.720p-dimension.r05
Delete archive volume C:\Users\JourneyOver\Desktop\QBT\The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION\hawkings.kids.1011.720p-dimension.r06
Delete archive volume C:\Users\JourneyOver\Desktop\QBT\The.Big.Bang.Theory.S10E11.720p.HDTV.X264-DIMENSION\hawkings.kids.1011.720p-dimension.r07
Clean clutter files and empty folders
Finished without processing any files
Failure (°_°)
this is my current script while testing things. --

Code: Select all

@ECHO OFF

:: Media file processing script for Filebot
:: This script gets triggered by some means (inotify, auditd, cron, etc.) and processes media files in some locations.
:: It will run the filebot amc.groovy script against these files and output them into user defined locations.

:: Set up some logging
set LOGDIR=C:/Users/JourneyOver/Dropbox/Public/Folders/Filebot/logs

:: Base destinations to move files, no trailing slash.  The subfolder is defined in the format string.
set DESTINATION=D:/Shows

:: Passing Args from Qbittorrent
set TORRENT_NAME="%1"
set TORRENT_PATH="%2"
::set TORRENT_LABEL="%3"

:: Rename action i.e: move | copy | keeplink | symlink | hardlink
set ACTION=move

:: Conflict resolution i.e: override | skip | fail
set CONFLICT=override

:: Episode age filtering
set AGE=14

:: Process music files
set MUSIC=false

:: Download subtitles for the given languages i.e: en | de | fr
set SUBTITLES=en

:: Fetch artwork/nfo
set ARTWORK=false

:: Generate *.url files and fetch all available backdrops
set EXTRAS=false

:: Tell the given Kodi/XBMC instance to rescan it's library
::Set KODI=host[:port]

:: Tell the given Plex instance to rescan it's library. Plex Home instances require an authentication token
set PLEX=localhost

:: Tell the given Emby instance to rescan it's library
::set EMBY=host:apikey

:: Save reports to local filesystem
set STOREREPORT=false

:: Do not extract archives
set SKIPEXTRACT=false

:: Automatically remove empty folders and clutter files that may be left behind after moving the video files, or temporary extracted files after copying
set CLEAN=true

:: Delete archives after extraction
set DELETEAFTEREXTRACT=true

:: Format strings for filebot, please see: http://www.filebot.net/naming.html
set TV_FORMAT=/TV Shows/{N}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{N.replaceTrailingBrackets()} - {episode.special ? 'S00E'+special.pad(2) : S00E00} - {T.replaceAll(/[`´‘’ʻ]/, "'").lowerTrail().replacePart(', Part $1')}
set ANIME_FORMAT=/Anime/{N}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{N.replaceTrailingBrackets()} - {episode.special ? 'S00E'+special.pad(2) : S00E00} - {T.lowerTrail().replacePart(', Part $1')}
set MOVIE_FORMAT=/Movies/{N} [{y}]/{N.replaceTrailingBrackets()} [{y}]

:: Run filebot script
filebot -script fn:amc ^
					--output "%DESTINATION%" ^
					--log-file "%LOGDIR%/filebot-amc.log" ^
					--action %ACTION% ^
					--conflict %CONFLICT% ^
					-non-strict ^
					-no-xattr ^
					--filter ^
					"age < %AGE%" ^
					--def ^
					ut_dir=%TORRENT_PATH% ^
					ut_kind=multi ^
					ut_title=%TORRENT_NAME% ^
					excludeList="%LOGDIR%/filebot-history.log" ^
					music=%MUSIC% ^
					subtitles=%SUBTITLES% ^
					artwork=%ARTWORK% ^
					extras=%EXTRAS% ^
					plex="%PLEX%" ^
					storeReport=%STOREREPORT% ^
					skipExtract=%SKIPEXTRACT% ^
					clean=%CLEAN% ^
					deleteAfterExtract=%DELETEAFTEREXTRACT% ^
					"seriesFormat=%TV_FORMAT%" ^
					"animeFormat=%ANIME_FORMAT%" ^
					"movieFormat=%MOVIE_FORMAT%" ^
					--def ^
					exec="cmd /c C:\Users\JourneyOver\Dropbox\Public\Folders\Filebot\MyStuff\callpowershell.bat"
Using Notepad++ and encoding is on utf-8
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: .replaceAll(/[`´‘’ʻ]/, "'") turning into .replaceAll(/[`-¦GÇÿGÇÖ-+]/, ')

Post by rednoah »

Does CMD support UTF-8 script files? My educated guess would be no.

In my experience, CMD scripts are not suitable for anything that exceeds simple command-line calls with very basic arguments, and will give you very bad headache if you try to do anything that isn't dead simple.

I'd pass arguments via text files, so you don't have to worry about encoding and escaping:
viewtopic.php?f=3&t=3244
:idea: Please read the FAQ and How to Request Help.
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

Re: .replaceAll(/[`´‘’ʻ]/, "'") turning into .replaceAll(/[`-¦GÇÿGÇÖ-+]/, ')

Post by ZeroByDivide »

That seems to have worked though it makes it turn into

Code: Select all

.replaceAll(/[`´‘’ʻ]/, "'")
but it at least seems to be working and not just throwing out an error now. >..<

oh and question why does

Code: Select all

--filter "age < 14 || !model.any{ it.age < 14 }"
slow the script down to a crawl, if I use

Code: Select all

--filter "age < 14"
the script only takes at most 1 minute to finish everything, but if I use the other age filter it takes a good 5-10 minutes before it finishes everything.
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: .replaceAll(/[`´‘’ʻ]/, "'") turning into .replaceAll(/[`-¦GÇÿGÇÖ-+]/, ')

Post by rednoah »

I don't know. Depends on the files and episode data. Matching can be slow depending on how badly the files are named and how well it matches the episode data. If your filter already limits the episode data that is considered from the get go, then FileBot will not have to spend time on considering it. The model filter itself doesn't scale well either, because it'll have to check every episode for every episode, so it'll take exponentially more time for larger episode lists.
:idea: Please read the FAQ and How to Request Help.
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

Re: .replaceAll(/[`´‘’ʻ]/, "'") turning into .replaceAll(/[`-¦GÇÿGÇÖ-+]/, ')

Post by ZeroByDivide »

Ah well
The model filter itself doesn't scale well either, because it'll have to check every episode for every episode, so it'll take exponentially more time for larger episode lists.
would probably explain it, because even if it's something as simple as this

Code: Select all

Auto-detected query: [Humans]
Fetching episode data for [Humans]
Fetching episode data for [Real Humans]
Fetching episode data for [Humans Mutants]
Fetching episode data for [Humans & Households]
Apply Filter: {age < 14}
Include [Humans - 2x07 - Episode 7]
Include [Humans - 2x08 - Episode 8]
Include [Humans - 2xSpecial 2 - Season 2 Trailer]
it would take an exceptionally long time with the model filter, even if the file data was easy to determine what the data was

Code: Select all

humans.s02e08.720p.hdtv.x264-moritz.mkv
Post Reply