Added User agents support

This commit is contained in:
killer069
2021-12-07 10:43:23 +05:30
parent e0c30e9853
commit 327bcce360
10 changed files with 86 additions and 267 deletions

View File

@@ -1,3 +1,4 @@
import { setUserAgent } from './Request/useragent';
import { setSoundCloudToken } from './SoundCloud';
import { setSpotifyToken } from './Spotify';
import { setCookieToken } from './YouTube/utils/cookie';
@@ -15,6 +16,7 @@ interface tokenOptions {
youtube?: {
cookie: string;
};
useragent?: string[];
}
/**
* Sets
@@ -25,6 +27,8 @@ interface tokenOptions {
*
* iii> Spotify :- client ID, client secret, refresh token, market.
*
* iv> Useragents :- array of string.
*
* locally in memory.
* @param options {@link tokenOptions}
*/
@@ -32,4 +36,5 @@ export function setToken(options: tokenOptions) {
if (options.spotify) setSpotifyToken(options.spotify);
if (options.soundcloud) setSoundCloudToken(options.soundcloud);
if (options.youtube) setCookieToken(options.youtube);
if (options.useragent) setUserAgent(options.useragent);
}