hydrusnetwork / hydrus

A personal booru-style media tagger that can import files and tags from your hard drive and popular websites. Content can be shared with other users via user-run servers.
http://hydrusnetwork.github.io/hydrus/
Other
2.34k stars 152 forks source link

Regex defined keys in parser #506

Open Zweibach opened 4 years ago

Zweibach commented 4 years ago

Regex defined keys in parser. Example, derpibooru uses both q and sbq as query key, defining this as q|sbq would make both work.

bbappserver commented 2 years ago

Regex can be used to extract data from a string but not the reverse(for weird technical reasons I'm not going to get into). But if you've ever tried to use a password cracker on a archive or something you'll know that everyone tries to reinvent the syntax for actually generating key sequences. I would recommend either a very limited syntax, or just a set of possible keys to test for. I expect for this particular application that would not be to onerous.

Zweibach commented 2 years ago

The point of the request was to be able to just make a single URL class that catches both cases rather than one for q and one for sbq, not adding them to the string or whatever else you've got going on in your head.