bump dependencies
This commit is contained in:
@@ -1,37 +1,8 @@
|
||||
const UserAgent = require('user-agents');
|
||||
const HttpsProxyAgent = require('https-proxy-agent');
|
||||
|
||||
const PROXY_HOSTS = process.env.PROXY_HOSTS && process.env.PROXY_HOSTS.split(',');
|
||||
const PROXY_PORT = 89;
|
||||
const PROXY_USERNAME = process.env.PROXY_USERNAME;
|
||||
const PROXY_PASSWORD = process.env.PROXY_PASSWORD;
|
||||
const userAgent = new UserAgent();
|
||||
|
||||
function getRandomUserAgent() {
|
||||
return userAgent.random().toString();
|
||||
}
|
||||
|
||||
function getRandomProxy() {
|
||||
if (PROXY_HOSTS && PROXY_HOSTS.length && PROXY_USERNAME && PROXY_PASSWORD) {
|
||||
const index = new Date().getHours() % PROXY_HOSTS.length;
|
||||
const proxyHost = PROXY_HOSTS[index];
|
||||
console.log(`${new Date().toISOString()} Using ${proxyHost} proxy`);
|
||||
return `https://${PROXY_USERNAME}:${PROXY_PASSWORD}@${proxyHost}:${PROXY_PORT}`;
|
||||
}
|
||||
console.warn('No proxy configured!');
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function getProxyAgent(proxy) {
|
||||
return proxy && new HttpsProxyAgent(proxy);
|
||||
}
|
||||
|
||||
function blacklistProxy(proxy) {
|
||||
const proxyHost = proxy.replace(/.*@/, '');
|
||||
console.warn(`${new Date().toISOString()} Blacklisting ${proxyHost}`);
|
||||
if (PROXY_HOSTS && PROXY_HOSTS.indexOf(proxyHost) > -1) {
|
||||
PROXY_HOSTS.splice(PROXY_HOSTS.indexOf(proxyHost), 1);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { getRandomUserAgent, getRandomProxy, getProxyAgent, blacklistProxy };
|
||||
module.exports = { getRandomUserAgent };
|
||||
677
addon/package-lock.json
generated
677
addon/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -10,25 +10,24 @@
|
||||
"dependencies": {
|
||||
"@putdotio/api-client": "^8.32.0",
|
||||
"all-debrid-api": "^1.1.0",
|
||||
"axios": "^0.21.4",
|
||||
"axios": "^0.27.2",
|
||||
"bottleneck": "^2.19.5",
|
||||
"cache-manager": "^3.4.4",
|
||||
"cache-manager-mongodb": "^0.3.0",
|
||||
"debrid-link-api": "^1.0.1",
|
||||
"express-rate-limit": "^5.5.1",
|
||||
"https-proxy-agent": "^5.0.0",
|
||||
"express-rate-limit": "^6.4.0",
|
||||
"magnet-uri": "^6.2.0",
|
||||
"named-queue": "^2.2.1",
|
||||
"offcloud-api": "^1.0.0",
|
||||
"parse-torrent-title": "git://github.com/TheBeastLT/parse-torrent-title.git#e94682462d748a9ecd256a37fab98a20f0306255",
|
||||
"pg": "^8.7.1",
|
||||
"pg": "^8.7.3",
|
||||
"pg-hstore": "^2.3.4",
|
||||
"premiumize-api": "^1.0.3",
|
||||
"real-debrid-api": "git://github.com/TheBeastLT/node-real-debrid.git#874f150f4c0b6ea5c67535c82b47f75ad96e50b8",
|
||||
"request-ip": "^2.1.3",
|
||||
"sequelize": "^4.43.0",
|
||||
"request-ip": "^2.2.0",
|
||||
"sequelize": "^6.21.0",
|
||||
"stremio-addon-sdk": "^1.6.1",
|
||||
"ua-parser-js": "^1.0.2",
|
||||
"user-agents": "^1.0.559"
|
||||
"user-agents": "^1.0.1050"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user