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

Showing all time help #3

Closed timgir closed 3 years ago

timgir commented 3 years ago

Hi !

Thanks for your work !

When I execute csv_parser.py, the script show every time the help message :

timothee@arch-game ~/p/p/GOG-Galaxy-HTML5-exporter (master)> python csv_parser.py
usage: csv_parser.py [-h] [-d CHARACTER] [-i FN] [-l FN] [-o FN] [--image-list] [--html5] [--title TITLE] [--embed] [--py-lists]

GOG Galaxy 2 export converter: parses the “GOG Galaxy 2 exporter” CSV to generate a list of cover images and/or a searchable HTML5 list of games.

optional arguments:
  -h, --help          show this help message and exit
  -d CHARACTER        CSV field separator, defaults to comma
  -i FN, --input FN   CSV file path
  -l FN, --list FN    pathname of the generated list of cover URLs
  -o FN, --output FN  pathname of the generated HTML5 games list
  --image-list        create an image list
  --html5             export the game list in html5 format
  --title TITLE       title of the HTML5 file
  --embed             embeds CSS & JS instead of linking the resources
  --py-lists          the CSV has Python parseable instead of delimiter separated strings

or

timothee@arch-game ~/p/p/GOG-Galaxy-HTML5-exporter (master)> python csv_parser.py -i ../GOG-Galaxy-Export-Script/gameDB.csv
usage: csv_parser.py [-h] [-d CHARACTER] [-i FN] [-l FN] [-o FN] [--image-list] [--html5] [--title TITLE] [--embed] [--py-lists]

GOG Galaxy 2 export converter: parses the “GOG Galaxy 2 exporter” CSV to generate a list of cover images and/or a searchable HTML5 list of games.

optional arguments:
  -h, --help          show this help message and exit
  -d CHARACTER        CSV field separator, defaults to comma
  -i FN, --input FN   CSV file path
  -l FN, --list FN    pathname of the generated list of cover URLs
  -o FN, --output FN  pathname of the generated HTML5 games list
  --image-list        create an image list
  --html5             export the game list in html5 format
  --title TITLE       title of the HTML5 file
  --embed             embeds CSS & JS instead of linking the resources
  --py-lists          the CSV has Python parseable instead of delimiter separated strings

Test with Python 3.8.5 & 3.9.2, same issue.

Can you help me please ?

IAmKontrast commented 3 years ago

Did you export the csv file first? GOG Galaxy 2.0 Export Script

timgir commented 3 years ago

Yes, as you can see in my second example.

IAmKontrast commented 3 years ago

You have to create the image list with --image-list before. Then download the images with wget for example and after that you can export the html-game-list-file with --html5

@mmodrow did an awesome job to simplify all steps at GOG-Galaxy-Export python .\csv_parser.py -i "$outputPath\gogExport.csv" -o "$outputPath\gogExport.html" -d " " --html5 --image-list

Varstahl commented 3 years ago

Sorry, I just received the notification today, the issue went under my radar. The initial syntax is correct, but (I think) there are no default actions. As @IAmKontrast said, you either need to use --html5, --image-list or both.

So a basic syntax would be

$ python csv_parser.py -i ../GOG-Galaxy-Export-Script/gameDB.csv --html5 --image-list

Delimiters and export file names are not necessary if you're using defaults.

Edit: let me know if you have further questions.

IAmKontrast commented 3 years ago

@Varstahl Are you going to do some further improvements like displaying the game title below the cover and not only in the dialog? I got some more ideas but I ain't really familiar into Frontend development.

Varstahl commented 3 years ago

I think there are improvements to be done but I'm not sure if I already developed the customisation in deep enough detail. In theory it should be possible to customize everything however you want, both the HTML output and how things display, but I just realised I might also do some sort of presets with a few variations.

Any work probably won't come soon, I've been heavily time restricted lately, but I'm not one to abandon projects, if that's what you're asking. If you have good ideas, feel free to open new issues with feature requests :)

timgir commented 3 years ago

Thanks for help @IAmKontrast & @Varstahl, it's works now !

@Varstahl don't worries about your reply time, it's ok ;)

I was confused because I believe --html5 & --image-list are been optionals arguments.

I have 2 troubles.

First, with image names. They now call .webp?namespace=gamesdb extension but you expect .webp. So I write quickly a little script for this : https://gist.github.com/timgir/7f36daa24c63e63ba88e4a8caf4a857e

Secondly, witch research in HTML page, I have this error in web console Uncaught SyntaxError: JSON.parse: expected ',' or ']' after array element at line 1 column 24 of the JSON data onSearch file:///home/timothee/prog/python/GOG-Galaxy-HTML5-exporter/templates/script.js:140 If I have time, I will try to find & fix it but it's not critical error :)

Varstahl commented 3 years ago

Oof, I forgot to put it in the documentation. After you download the image list, if you run an html5 export it will automatically rename all the image files, without the need to do it manually. As for the search I can confirm it's currently broken, there must have been some standard changing in browsers, because afair it was working before. I'll take a look at it.

Varstahl commented 3 years ago

The issue should be fixed with 304071893292477a6d8d41d3fb33646245250890, it was introduced with the new episodes of "3 out of 10" in my case, where they started using double quotes. You can grab the python file and run it. Thanks for noticing, also.