Comments (3)
Are you setting the value of parsePattern
manually or using the --set-default
option?
If you're doing it manually any backslashes in the regex will have to be escaped as double backslashes, otherwise the JSON isn't valid.
In my testing the --set-default
option automatically escapes the backslashes.
from autotag.
I was setting parsePattern
manually within conf.json using a text editor. I'd escaped the backslashes that repent the Windows directory delimiters but not any that need to be interpreted as RegEx special characters. For the directory structure of:
"\Series-name\Season #\Episode #.mkv"
I was using the pattern:
".*\(?.+)\Season (?\d+)\Episode (?\d+)"
I tried --set-default
to see how it wrote my above pattern to the JSON and see now that even the special character backslash needs to be escaped. So, \d
must instead be \\d
. However, I was surprised to see that any Windows directory delimiters need to be triple-escaped. I was theorizing I might see them be double escaped based on your comment, but not triple escaped. So, \\
must instead be written \\\\
. I was also even more surprised to see that a number of other characters were rewritten into their C/C++/Java Unicode versions:
<
becomes \u003C
>
... \u003E
+
... \u002B
So, this is the full pattern that was written to the JSON by using --set-default
and --pattern .*\\(?<SeriesName>.+)\\Season (?<Season>\d+)\\Episode (?<Episode>\d+)
at the command line:
.*\\\\(?\u003CSeriesName\u003E.\u002B)\\\\Season (?\u003CSeason\u003E\\d\u002B)\\\\Episode (?\u003CEpisode\u003E\\d\u002B)
Now the RegEx pattern within the JSON works without error. It seems the best way to edit the JSON parsePattern
field - at least on a Windows machine - is via CLI with --pattern
and --set-default
rather than manually with a text editor.
from autotag.
The angle brackets also being escaped/encoded has been fixed in v3.1.2. There's a "feature" in System.Text.Json that escapes some characters to prevent XSS attacks by default.
Obviously that feature is useless in this application, so it's now disabled.
from autotag.
Related Issues (19)
- Problem with Finding Some Shows Correct Title HOT 5
- Suggestions for additional Matroska MKV tags HOT 2
- macOS, some mp4 tags missing HOT 7
- [Question] tvRenamePattern doesn't reflect the rename HOT 2
- [Question] is the scope of this project to rename .srt file too? HOT 3
- Suggestion: Language support HOT 3
- Autoselect a Default Option HOT 1
- File Name Character Substitution HOT 1
- Running autotag always results in "No files found" since updating to v3.5.3 HOT 2
- mkv - file not writeable HOT 3
- Suggestion "Sort HOT 4
- extended tagging on mkv - suggestions HOT 1
- AutoTag hangs and then breaks the file HOT 1
- Error: Unable to parse series name from filename HOT 8
- TV Episodes with "?" in title fail to rename HOT 6
- README regex section for Windows
- Error: Failed to write tags to file (InvalidOperationException: File not writeable.) HOT 6
- Tagging differs from Matroska conventions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autotag.