Regex for tags and removal for "Unknown" values in file name
-
- Posts: 9
- Joined: Wed Jun 05, 2024 12:58 pm
Regex for tags and removal for "Unknown" values in file name
Is it possible to get the same sort of regex editor that exists for the file name added to tags? Some tags I'm receiving seem to have the sites count for that tag existing and that really doesn't make sense to store in the metadata file.
Also not sure if I should create a different request for this, but in the file name if something comes back as unknown is it possible to not write that to the file name at all? Right now I'm using "[%ARTIST%] %TITLE% (%Magazine%)" for the file name, but if its not from a magazine I would like to not write any value for that part of the file name (and ideally not the parenthesis I have around it as well).
Also not sure if I should create a different request for this, but in the file name if something comes back as unknown is it possible to not write that to the file name at all? Right now I'm using "[%ARTIST%] %TITLE% (%Magazine%)" for the file name, but if its not from a magazine I would like to not write any value for that part of the file name (and ideally not the parenthesis I have around it as well).
Re: Regex for tags and removal for "Unknown" values in file name
What sites does this happen with? This was happening with HentaiNexus recently, but I uploaded a fix the other day. This is something I feel should be fixed at the module level instead of forcing the user to remove them with a regex.Hunger4837 wrote: ↑Wed Jun 05, 2024 1:03 pmIs it possible to get the same sort of regex editor that exists for the file name added to tags? Some tags I'm receiving seem to have the sites count for that tag existing and that really doesn't make sense to store in the metadata file.
Something like this should work:Hunger4837 wrote: ↑Wed Jun 05, 2024 1:03 pmAlso not sure if I should create a different request for this, but in the file name if something comes back as unknown is it possible to not write that to the file name at all? Right now I'm using "[%ARTIST%] %TITLE% (%Magazine%)" for the file name, but if its not from a magazine I would like to not write any value for that part of the file name (and ideally not the parenthesis I have around it as well).
Code: Select all
[%artist%] %title% %if(%magazine%,"("%magazine%")")%
if
token can be used to check if a value is "unknown" or not. In this case, it checks if it has a value, and if it does, outputs the following argument ("("%magazine%")"
). The quotes around the parentheses are just there to avoid confusing the parser and won't be in the output.I'm the admin and developer of HDoujin Downloader.
-
- Posts: 9
- Joined: Wed Jun 05, 2024 12:58 pm
Re: Regex for tags and removal for "Unknown" values in file name
Yes it was specifically HentaiNexus and it appears I am using the latest version.
Re: Regex for tags and removal for "Unknown" values in file name
Did you add the URLs to the download queue prior to the fix? Metadata is extracted as soon as a URL is added, so if it already has malformed tags they'll remain that way.
You can can re-add the URLs, effectively refreshing their metadata, by selecting everything, right-clicking, and going to Remove > Remove and enqueue again. I would copy the URLs first just in case any of them fail to be added again (Ctrl+C).
You can can re-add the URLs, effectively refreshing their metadata, by selecting everything, right-clicking, and going to Remove > Remove and enqueue again. I would copy the URLs first just in case any of them fail to be added again (Ctrl+C).
I'm the admin and developer of HDoujin Downloader.
-
- Posts: 9
- Joined: Wed Jun 05, 2024 12:58 pm
Re: Regex for tags and removal for "Unknown" values in file name
Nope I didnt know that was the workflow, I have done so now. I have noticed thought that %convention% does not appear to show for hentainexus, it looks like they use event for that on the page. Is there a different flag I should be using? This is what Im trying to do with the file name, (Im trying to match a quasi e-hentai naming convention):
%if(%convention%,"("%convention%") ")%[%if(%circle%,""%circle%" (")%%artist%%if(%circle%,")")%] %title%%if(%magazine%," ("%magazine%")")%
%if(%convention%,"("%convention%") ")%[%if(%circle%,""%circle%" (")%%artist%%if(%circle%,")")%] %title%%if(%magazine%," ("%magazine%")")%
Re: Regex for tags and removal for "Unknown" values in file name
That's the right token to use. I actually hadn't added support for convention metadata to the Lua API, which is used to implement the HentaiNexus module.
I'll do that-- Expect it to be working with the program update, which I hope to have available soon. I'm sorry for the wait!
I'll do that-- Expect it to be working with the program update, which I hope to have available soon. I'm sorry for the wait!
I'm the admin and developer of HDoujin Downloader.
-
- Posts: 9
- Joined: Wed Jun 05, 2024 12:58 pm
Re: Regex for tags and removal for "Unknown" values in file name
No worries, Im new to using the program and you have been very helpful. Thanks
Who is online
Users browsing this forum: No registered users and 3 guests