benbarden / switchscores

The code behind switchscores.com.
9 stars 1 forks source link

Provide override square image URL where mapping doesn't work #160

Closed benbarden closed 8 months ago

benbarden commented 1 year ago

@cosmo0 you mentioned that some of the square images don't download. I think I'll need to hard-code the square image URLs for these, either as a new field on the screen or in code. Here is a list of the current failures.

You can easily get to a game from its ID by going to e.g. https://www.switchscores.com/games/9440 It will then redirect you to the correct page.

Hopping Girl Kohane EX [ID: 9440] Expected URL: https://fs-prod-cdn.nintendo-europe.com/media/images/11_square_images/games_18/nintendo_switch_download_software/1x1_NSwitchDS_HoppingGirlKohaneEx_image500w.jpg

The Legend of Zelda: Tears of the Kingdom [ID: 9452] Expected URL: https://fs-prod-cdn.nintendo-europe.com/media/images/11_square_images/games_18/nintendo_switch_5/1x1_NSwitch_TloZTearsOfTheKingdom_Gamepage_image500w.jpg

Heartbeat Hospital: Love, Lies and Betrayal [ID: 9990] Expected URL: https://fs-prod-cdn.nintendo-europe.com/media/images/11_square_images/games_18/nintendo_switch_download_software/1x1_NSwitchDS_HeartbeatHospitalLoveLiesAndBetrayal_01_image500w.jpg

Farming Simulator 23 [ID: 10017] Expected URL: https://fs-prod-cdn.nintendo-europe.com/media/images/11_square_images/games_18/nintendo_switch_5/1x1_NSwitch_FarmingSimulator23NintendoSwitchEdition_enGB_image500w.jpg

Round People [ID: 10052] Expected URL: https://fs-prod-cdn.nintendo-europe.com/media/images/11_square_images/games_18/nintendo_switch_download_software/1x1_NSwitchDS_RoundPeople_image500w.jpg

What are the correct image URLs for these? How did you find them?

cosmo0 commented 1 year ago

@cosmo0 you mentioned that some of the square images don't download.

Yeah it was here: https://github.com/benbarden/switchscores/issues/154#issuecomment-1455753524

What are the correct image URLs for these? How did you find them?

By searching for the game, the square image is in the search results, ex for "hopping girl": https://www.nintendo.co.uk/Search/Search-299117.html?q=hopping%20girl&f=147393.

I think you'll have to provide an "override" field? I don't see how you can easily do it another way, the search results are not easily parseable (they're loaded through ajax), and not consistent: sometimes you search for an exact game name and it's the 3rd or 4th result.

benbarden commented 8 months ago

Field added; will go through and fix missing records.