AB1908 / GOG-Galaxy-Export-Script

Export your list of games from GOG Galaxy
MIT License
152 stars 27 forks source link

DLC parser: 'NoneType' object is not iterable #44

Closed mplx closed 3 years ago

mplx commented 3 years ago

DLC parser breaks by parsing the entry of Shadowrun Returns Deluxe Upgrade: '{"dlcs":null}'.

$ python galaxy_library_export.py -a
Parsing failed on: ('gog_1411891779,epic_d919e78b3fc049678e63df7ff49cf65d', '{"title":"Shadowrun Returns Deluxe Upgrade"}', '{"isModifiedByUser":false,"title":"Shadowrun Returns Deluxe Upgrade"}', '{"summary":"The year is 2054. Magic has returned to the world, awakening powerful creatures of myth and legend. Technology merges with flesh and consciousness. Elves, trolls, orks and dwarves walk among us, while ruthless corporations bleed the world dry. You are a shadowrunner – a mercenary living on the fringes of society, in the shadows of massive corporate arcologies, surviving day-by-day on skill and instinct alone. When the powerful or the desperate need a job done, you get it done… by any means necessary. \\r\\n \\r\\n \\r\\n \\r\\nThe unique cyberpunk-meets-fantasy world of Shadowrun has gained a huge cult following since its creation nearly 25 years ago. Now, creator Jordan Weisman returns to the world of Shadowrun, modernizing this classic game setting as a single player, turn-based tactical RPG. \\r\\n \\r\\n \\r\\n \\r\\nWith the Shadowrun Returns Editor, everyone is empowered to create and share their own stories and campaigns with the Steam Workshop community. You can even explore the entire Shadowrun Returns Seattle campaign in the Editor directly – see how it was built and borrow as much as you need to jump-start your own creations! No advanced coding or art skills are required to create content using the SRR Editor."}', '{"criticsScore":null,"developers":[],"genres":["Role-playing (RPG)","Adventure","Strategy"],"publishers":[],"releaseDate":1374710400,"themes":["Action","Fantasy","Historical","Science fiction"]}', 0, None, '{"dlcs":null}', '{"background":null,"squareIcon":null,"verticalCover":null}')
Traceback (most recent call last):
  File ".../galaxy_library_export.py", line 491, in <module>
    extractData(args)
  File ".../galaxy_library_export.py", line 411, in extractData
    raise e
  File ".../galaxy_library_export.py", line 385, in extractData
    for dlc in jld('dlcs', True):
TypeError: 'NoneType' object is not iterable
$ python --version
Python 3.9.6

Database is from Galaxy Client version 2.0.40.

TheMelmacian commented 3 years ago

@mplx I don't know when @AB1908 will find the time to review all the open pull requests. I recommend that you add the changed lines yourself to your local galaxy_library_export.py file till the change is merged: https://github.com/AB1908/GOG-Galaxy-Export-Script/pull/45/files

mplx commented 3 years ago

@TheMelmacian - applied the patch #45 and it works great! Thanks a lot! :)