Closed mertushka closed 3 years ago
🤔 not a bad idea tbh. I think discord-player should detect api keys from process.env
instead of having options?
for example: process.env.YOUTUBE_API_KEY
or process.env.SPOTIFY_API_KEY
Yes, it could be possible. Actually we switched to scraping because a lot of users were ratelimited in a short period of time, but we could support both scraping and the official API.
🤔 not a bad idea tbh. I think discord-player should detect api keys from
process.env
instead of having options? for example:process.env.YOUTUBE_API_KEY
orprocess.env.SPOTIFY_API_KEY
Good idea.
Yes, it could be possible. Actually we switched to scraping because a lot of users were ratelimited in a short period of time, but we could support both scraping and the official API.
i think discord-player should support ipv6 for requests to avoid ratelimit
This would be really helpful as my bot is getting rate limited.
Fully agree with this
This would be really helpful as my bot is getting rate limited.
you mean youtube 429? If you are talking about youtube 429 then no, api keys wont solve your problem
API keys is a good idea and it would be even better if the module detected ratelimits and switched to scraping automatically so there would be lesser errors / close to none
+1
@ThaddeusKKR yeah, if you are okay with slow response (api request > failed > scrape) 😀
@ThaddeusKKR yeah, if you are okay with slow response (api request > failed > scrape) 😀
i guess once the api fails once it could be disabled until the bot instance is restarted / api is manually reenabled so the lag will only occur once.
A suggestion would be:
client.player.useYTAPI = {boolean}
and if spotify keys are added client.player.useSpotifyAPI = {boolean}
@ThaddeusKKR yeah, good idea. I will start working on api based youtube search
You should be able to use youtube api
like this:
require("youtube-sr").default.set("api", "YOUTUBE_API_KEY");
it should automatically switch to api mode
. And to go back to scraper
, you can set it to false
or use YouTube.delete("api")
done for YouTube
, not gonna do it for others (soundcloud
uses api key when required)
To get faster results and optimize ram cpu usage, there should be an api key option, when we set our api key there, module must make queries through the api, not via youtube-sr. If the api key is not specified, module must make search through youtube-sr.