Discord-Scraper icon indicating copy to clipboard operation
Discord-Scraper copied to clipboard

configuration error

Open SimpleChris0 opened this issue 3 years ago • 6 comments

I keep getting this token error, i dont know whate fuck im doing wrong.

[ERROR]: Authorization token file can not be found at the following location: C:\Program Files (x86)\pycharm projects\Discord scrapper\Discord-Scraper-experimental{mytoken.token} Traceback (most recent call last): File "C:\Program Files (x86)\pycharm projects\Discord scrapper\Discord-Scraper-experimental\discord.py", line 195, in discordscraper = DiscordScraper() File "C:\Program Files (x86)\pycharm projects\Discord scrapper\Discord-Scraper-experimental\module\DiscordScraper.py", line 152, in init error('Authorization token file can not be found at the following location: {0}'.format(tokenfile)) File "C:\Program Files (x86)\pycharm projects\Discord scrapper\Discord-Scraper-experimental\module\DiscordScraper.py", line 87, in error exit() TypeError: _exit() missing required argument 'status' (pos 1)

Hope someone can help me

SimpleChris0 avatar May 26 '21 13:05 SimpleChris0

So there's two problems there:

  1. You put down the token file name in the config.json file as "{mytoken.token}" instead of "mytoken.token" or the script somehow placed that in the curly format brackets and forgot to add the trailing path separator between the token and the Discord-Scraper-experimental folder name.

  2. I forgot to put a 1 in the exit function call on line 87 which I'm about to rectify as soon as I send this response.

Dracovian avatar May 27 '21 03:05 Dracovian

Wait what?

I didn't want to close the issue.


GitHub thinks that just because titled the recent commit "Fix #issue" then that must mean that all of the things were fixed in that issue... I probably should keep that in mind for the future.

Dracovian avatar May 27 '21 03:05 Dracovian

Ok thank you, i got it working now but it still shows me HTTP 429 warnings

SimpleChris0 avatar May 28 '21 07:05 SimpleChris0

Yes, HTTP 429 is the rate limiter and I figured that the sleep time was adequate enough to prevent hitting the rate limiter but I might have to start looking into what Discord is doing regarding these recent API updates in regards to rate limiting.


There is something in the official API documents that makes me a bit nervous about how frequent this script could potentially hit the rate limiter:

https://imgur.com/KQ7DmGd

Of course the API also makes mention that their rate limiter is applied on a per-route basis, or that it can be different based on which API function is being called. And there is also a per-account rate limit setting that can be different between users based on some undocumented calculations.

There's also the case of per-route rate limits that may be shared across multiple, similar-use routes such as the one that could be used when gathering messages from a channel and from the undocumented search API endpoints (as used in this script).

So the upcoming release for this script will have to take into account the ever-changing rate limiting settings and to tailor the runtime to each account and route it appears to prevent further HTTP 429 responses.

Dracovian avatar May 28 '21 07:05 Dracovian

  1. You put down the token file name in the config.json file as "{mytoken.token}" instead of "mytoken.token" or the script

In the example config, that is how it is formatted, you have a more understandable example config in the wiki than in the repo

worldpe avatar Sep 27 '21 23:09 worldpe

Yes, I spent a good amount of time working on the wiki for this repository in hopes that it might come in real handy.

Dracovian avatar Sep 28 '21 02:09 Dracovian