mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 21:09:05 +08:00
Fixed UA not working
This commit is contained in:
parent
52fe634b60
commit
bd58aaa2a4
@ -2,15 +2,16 @@ const { HTTP } = require('./open-api');
|
|||||||
|
|
||||||
const cache = new Map();
|
const cache = new Map();
|
||||||
|
|
||||||
async function download(url, userAgent = 'Quantumult%20X') {
|
async function download(url, ua) {
|
||||||
const id = userAgent + url;
|
ua = ua || 'Quantumult%20X/1.0.29 (iPhone14,5; iOS 15.4.1)';
|
||||||
|
const id = ua + url;
|
||||||
if (cache.has(id)) {
|
if (cache.has(id)) {
|
||||||
return cache.get(id);
|
return cache.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
const $http = HTTP({
|
const $http = HTTP({
|
||||||
headers: {
|
headers: {
|
||||||
'User-Agent': userAgent
|
'User-Agent': ua
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
2
backend/sub-store.min.js
vendored
2
backend/sub-store.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user