get-got / discord-downloader-go

A Discord bot program to download and otherwise handle files sent in Discord channels with extensive configuration. Can be used as a genuine Discord Bot or user account / self-bot
MIT License
271 stars 30 forks source link

2.5.1 - Stuck retrying a failed download #130

Closed kauffy closed 5 months ago

kauffy commented 5 months ago

I'm using 2.5.1, and I think I've incorporated all the appropriate changes, but I'm still getting errors like this-- which I presume are DDG trying to grab an image prompt from a midjourney-shorted URL, but it's coming back as Forbidden.

My quick hunch would be that you have code to retry on failure for any reason, as opposed to handling a case like this 403 error.

image

get-got commented 5 months ago

It would only be spamming that much if you have your downloadRetryMax at a high value or that link has been sent numerous times.

With 2.5.0 I made it treat 403 as any other error, it'll retry X times until it hits downloadRetryMax, where previously it would immediately bail upon 403 or 404.

Recently there were constant Discord 403 errors popping up where retries would sometimes work. The other fixes I implemented for 403's made this unnecessary so I've re-added the immediate bail with https://github.com/get-got/discord-downloader-go/commit/a65ca364aec4f703c8639ccaa8cead149e574a52 for the next patch.

In the meantime just filter block that domain or lower your retry #.

kauffy commented 5 months ago

Here's what that section looks like in my .config. I'm pretty sure I've never touched these values:

    "discordLogLevel": 0,         
    "discordTimeout": 180,        
    "downloadTimeout": 60,        
    "downloadRetryMax": 3,        
    "exitOnBadConnection": false, 
    "githubUpdateChecking": true, 

I wouldn't want to block that domain, as mj.run is where images come from.