Lacro59 / playnite-successstory-plugin

This plugin shows the game achievements in Playnite.
https://playnite.link
MIT License
173 stars 30 forks source link

Endless download loop on downloading a faulty achievement image. #285

Open shakeyourbunny opened 2 years ago

shakeyourbunny commented 2 years ago

The plugin tries endlessly to download an achievement image if the image has (on the server's side) problems and does not yield a valid image.

30-03 18:15:59.694|ERROR|SuccessStory#Common:Error on download https://images.gog.com/480eaf138a82838ee1f293d4c767e52a9f355928e1d635f7bd3ddf867da2df3f_gac_60.jpg|D:\GitHub\Lacro59\playnite-successstory-plugin\source\playnite-plugincommon\CommonPluginsShared\Web.cs|60 System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.WebClient.DownloadFile(Uri address, String fileName) at System.Net.WebClient.DownloadFile(String address, String fileName) at CommonPlayniteShared.Common.Web.Downloader.DownloadFile(String url, String path) in D:\GitHub\Lacro59\playnite-successstory-plugin\source\playnite-plugincommon\CommonPlayniteShared\Common\Web\Downloader.cs:line 130 at CommonPlayniteShared.Common.Web.HttpDownloader.DownloadFile(String url, String path) in D:\GitHub\Lacro59\playnite-successstory-plugin\source\playnite-plugincommon\CommonPlayniteShared\Common\Web\HttpDownloader.cs:line 62 at CommonPlayniteShared.HttpFileCache.GetWebFile(String url) in D:\GitHub\Lacro59\playnite-successstory-plugin\source\playnite-plugincommon\CommonPlayniteShared\HttpFileCache.cs:line 64 at CommonPluginsShared.Web.d__3.MoveNext() in D:\GitHub\Lacro59\playnite-successstory-plugin\source\playnite-plugincommon\CommonPluginsShared\Web.cs:line 60

Trying to download it directly with wget:

$ wget https://images.gog.com/480eaf138a82838ee1f293d4c767e52a9f355928e1d635f7bd3ddf867da2df3f_gac_60.jpg --2022-03-30 18:26:30-- https://images.gog.com/480eaf138a82838ee1f293d4c767e52a9f355928e1d635f7bd3ddf867da2df3f_gac_60.jpg Resolving images.gog.com (images.gog.com)... 192.229.233.146 Connecting to images.gog.com (images.gog.com)|192.229.233.146|:443... connected. HTTP request sent, awaiting response... 500 Internal Server Error 2022-03-30 18:26:31 ERROR 500: Internal Server Error.

Trying to "spider" the URL (only header)

$ wget -S --spider https://images.gog.com/480eaf138a82838ee1f293d4c767e52a9f355928e1d635f7bd3ddf867da2df3f_gac_60.jpg Spider mode enabled. Check if remote file exists. --2022-03-30 18:27:18-- https://images.gog.com/480eaf138a82838ee1f293d4c767e52a9f355928e1d635f7bd3ddf867da2df3f_gac_60.jpg Resolving images.gog.com (images.gog.com)... 192.229.233.146 Connecting to images.gog.com (images.gog.com)|192.229.233.146|:443... connected. HTTP request sent, awaiting response... HTTP/1.1 500 Internal Server Error Access-Control-Allow-Origin: Age: 678 Cache-Control: no-cache Content-Type: application/json Date: Wed, 30 Mar 2022 16:27:18 GMT Server: nginx Timing-Allow-Origin: https://www.gog.com, https://www.gogalaxy.com, https://embed.gog.com Content-Length: 93 --2022-03-30 18:27:19-- (try: 2) https://images.gog.com/480eaf138a82838ee1f293d4c767e52a9f355928e1d635f7bd3ddf867da2df3f_gac_60.jpg Reusing existing connection to images.gog.com:443. HTTP request sent, awaiting response... HTTP/1.1 500 Internal Server Error Access-Control-Allow-Origin: Age: 679 Cache-Control: no-cache Content-Type: application/json Date: Wed, 30 Mar 2022 16:27:19 GMT Server: nginx Timing-Allow-Origin: https://www.gog.com, https://www.gogalaxy.com, https://embed.gog.com Content-Length: 93 Remote file does not exist -- broken link!!!

If you manage to download the "picture", you get a JSON with this content:

{ "error": "error", "error_description": "Can\u0027t format image img_cache_8rBWSM" }

IMHO the plugin should catch this error (HTTP Error 500) and or the JSON skips the download (and not throw the exception).

Lacro59 commented 3 months ago

Is the issue still present?