Deytron / lutris-art-downloader

A simple and dirty script to download Lutris covers and banners
23 stars 6 forks source link

IndexError: list index out of range #1

Closed Vundult closed 2 years ago

Vundult commented 2 years ago

Hello, thank you for making this script.

This error occurs when running the script via python3 main.py

Cover type set to Vertical (600x900)

Getting API Key...

Cover for Osu already exists
Cover for Star Wars Galaxies already exists
Cover for Archerage already exists
Cover for Star Wars The Force Unleashed Ultimate Sith Edition already exists
Cover for Remnant From The Ashes already exists
Cover for Star Wars The Old Republic already exists
Cover for Wizard101 already exists
Cover for The Elder Scrolls V Skyrim Se already exists
Cover for The Elder Scrolls Online already exists
Found game Swg Attack Of The Clones
Traceback (most recent call last):
  File "/home/arch/Documents/.builds/lutris-art-downloader-main/main.py", line 130, in <module>
    main()
  File "/home/arch/Documents/.builds/lutris-art-downloader-main/main.py", line 23, in main
    GetGamesList(co)
  File "/home/arch/Documents/.builds/lutris-art-downloader-main/main.py", line 124, in GetGamesList
    DownloadCover(title)
  File "/home/arch/Documents/.builds/lutris-art-downloader-main/main.py", line 104, in DownloadCover
    gameid = SearchGame(name)
  File "/home/arch/Documents/.builds/lutris-art-downloader-main/main.py", line 99, in SearchGame
    id = res["data"][0]["id"]
IndexError: list index out of range
Deytron commented 2 years ago

Hey, thank you for reporting the issue! As I thought, if a cover is not found for a game, the message 'Could not find cover for game "game"' should appear. Turns out I'm not that good at handling errors. This error is fixed in 214d084f0a383fb851c3d15dc26a2262e1ce5b2a use git pull to update the script on your end

Also, report back if it is not fixed

Vundult commented 2 years ago

New error

Cover for Osu already exists
Cover for Star Wars Galaxies already exists
Cover for Archerage already exists
Cover for Star Wars The Force Unleashed Ultimate Sith Edition already exists
Cover for Remnant From The Ashes already exists
Cover for Star Wars The Old Republic already exists
Cover for Wizard101 already exists
Cover for The Elder Scrolls V Skyrim Se already exists
Cover for The Elder Scrolls Online already exists
Traceback (most recent call last):
  File "/home/arch/Documents/.builds/lutris-art-downloader-main/main.py", line 130, in <module>
    main()
  File "/home/arch/Documents/.builds/lutris-art-downloader-main/main.py", line 23, in main
    GetGamesList(co)
  File "/home/arch/Documents/.builds/lutris-art-downloader-main/main.py", line 124, in GetGamesList
    DownloadCover(title)
  File "/home/arch/Documents/.builds/lutris-art-downloader-main/main.py", line 104, in DownloadCover
    gameid = SearchGame(name)
  File "/home/arch/Documents/.builds/lutris-art-downloader-main/main.py", line 95, in SearchGame
    if len(res["data"]) == 0:
KeyError: 'data'
Vundult commented 2 years ago

Seems like it runs fine after running the script the second time for some reason.

All done ! Restart Lutris for the changes to take effect

Deytron commented 2 years ago

Huh, strange bug. It might be related to SteamGridDB API somehow. Thanks for your tests!

LethalManBoob commented 1 year ago

having this bug now with ubisoft connect integration