Varstahl / GOG-Galaxy-HTML5-exporter

Uses the Galaxy 2 exported CSV to build a searchable HTML5 game library list.
MIT License
33 stars 7 forks source link

Cover images not working #4

Open Zackyist opened 2 years ago

Zackyist commented 2 years ago

Love the project, it's a perfect visualization tool for someone like me with a ton of games!

However, I'm having trouble getting any of the game cover images to work - none of them are showing in the HTML file because of bad filenames. I'm not sure if this is due to a change in the image APIs or a bug in the rename function or something else.

I cloned the latest repo, I've installed the required Python libraries, and I'm trying to use it with the following commands on elementary OS:

python3 csv_parser.py --image-list
wget -nc -P images -i ./imagelist.txt
python3 csv_parser.py --html5

I also tried --embed with the last one but it changed nothing. I got the output:

Purged 3835 unused images
HTML5 list exported

Meaning that every single one of my downloaded cover images had been deleted so I had to re-download them again. I found that the files wget downloads for me are named e.g.:

0a0adce567d4ca859e21cd9009b4251e7b2648207a67a0c0e644a4d91b5c60cb_glx_vertical_cover.webp?namespace=gamesdb
0a1a41d732c1cfe817e038e3636c1cf61f2aacababd64c0d8d7d6f4b5f24024a_glx_vertical_cover.webp?namespace=gamesdb
0a4de1578573132f7b1be302f9d91b3cf76abdc7c9e38f6546655b4c17585a13_glx_vertical_cover.webp?namespace=gamesdb

The filenames stay the same after running the script if I comment out the deletion line so the script is not renaming them properly, i.e. removing the ?namespace=gamesdb part from the end. I manually renamed a few and the images immediately showed up in the HTML file.

bassclarinetl2 commented 2 years ago

I'm experiencing the same behavior. All downloaded images in .\images are deleted when running csv_parser --html5

mplx commented 2 years ago

you'd need to rename the images to get rid of ?namespace=gamesdb before running the html5-export.

i.e. perl-rename 's/\?namespace=gamesdb//' images/* on linux machines

Varstahl commented 2 years ago

Well, it's clear that my fix for these issues clearly isn't working anymore, I'll have to update the CSV exporter and check again where the problem seems to be.

EffortlessFury commented 2 years ago

Something worth noting (may not be entirely related, I'm just getting back to looking at this project) is that these images are already cached locally with the exact same filename (minus the query params). Mine are currently stored at "C:\ProgramData\GOG.com\Galaxy\webcache{I think this is a GOG user ID}{platform}".

Perhaps it is worth enumerating all of the webp files in the webcache and doing a lookup for the URL filenames and copying them from the webcache to avoid redundant downloads, and perhaps even consider symlinking to the originals instead? Might be overkill, but just wanted to bring this to your attention.

0rdnave commented 8 months ago

I opened a PR aiming to fix that issue. #6