-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File Metadata error when parsing HDoujin Downloader's info.json files inside zip files #40
Comments
Actually, it is not all of them. I am trying to identify the differences but I am guessing it has something to do with the structure of some info files. |
Ok I found the issue. It has something to do with special characters when zipped. This Json works when unzipped but not when zipped: |
@Dystasia Also, I don't get duplicate galleries with unzipped folders when scanning for new galleries. If galleries are zipped, I always get duplicates of every gallery regardless of "Scan only for new galleries" option being selected. Every scan adds another duplicate. These two issues are probably related to each other as they both are solved by unzipping. |
Just an update of how I attempted to fix this. First, the exception actually thrown when trying to parse is: This probably means, the reading of the file is happening without utf-8 encoding. The reading and parsing of the file is happening in: plugins/plugins/File Metadata/extractors/common.py Lines 85 to 86 in 6472a37
even tho the encoding seems to get set at: plugins/plugins/File Metadata/extractors/common.py Lines 82 to 83 in 6472a37
this doesn't seem to work for compressed info.json files. Attempting to remove the if condition I get the exception: open() got an unexpected keyword argument 'encoding'
I can't see the content of @twiddli have any inputs? is this something that needs to be fixed in hpx core instead of the plugin? |
Hello, thank you guys for the troubleshooting. This is such a weird issue as I still can't repro it yet.
works totally fine, I even put the character ❤ in the filename for good measure and got no issues. Can you check if the file is utf-8 encoded? Also, for more insight on what's happening on that line of code, it checks if the file is inside the archive and omits specifying the encoding because the archive handler from the std lib doesn't accept an encoding parameter when opening files from inside the archive. I think this is because it is assumed the encoding is utf-8. Saving the |
All my files generated by E-Hentai Downloader have a UTF-8 info.txt. Sample info file: |
File Metadata parser fails for info.json files generated from HDoujin Downloader when inside zip files. Same info.json when extracted parses with no issues whatsoever.
Here is the plugin.log:
Sep-09 00:16:49--INFO pluginctx.file-metadata.main: Attempting with DataType.eze
Sep-09 00:16:49--WARNING pluginctx.file-metadata.extractors.common: An error occured while trying to parse file into a dict
Sep-09 00:16:49--INFO pluginctx.file-metadata.main: Skipping DataType.eze
Sep-09 00:16:49--INFO pluginctx.file-metadata.main: Attempting with DataType.hdoujin
Sep-09 00:16:49--WARNING pluginctx.file-metadata.extractors.common: An error occured while trying to parse file into a dict
Sep-09 00:16:49--INFO pluginctx.file-metadata.main: Skipping DataType.hdoujin
Let me know if you need an exmaple, but really this is happening with all my files.
The text was updated successfully, but these errors were encountered: