mirror of
https://github.com/TheBeastLT/torrentio-scraper.git
synced 2026-05-18 06:41:45 +00:00
remove rd infringing items from cache
Some checks failed
Deploy Addon / build (SSH_HOST_2, SSH_KEY_2) (push) Has been cancelled
Deploy Addon / build (SSH_HOST_3, SSH_KEY_3) (push) Has been cancelled
Deploy Addon / build (SSH_HOST_4, SSH_KEY_4) (push) Has been cancelled
Deploy Addon / build (SSH_HOST_5, SSH_KEY_5) (push) Has been cancelled
Some checks failed
Deploy Addon / build (SSH_HOST_2, SSH_KEY_2) (push) Has been cancelled
Deploy Addon / build (SSH_HOST_3, SSH_KEY_3) (push) Has been cancelled
Deploy Addon / build (SSH_HOST_4, SSH_KEY_4) (push) Has been cancelled
Deploy Addon / build (SSH_HOST_5, SSH_KEY_5) (push) Has been cancelled
This commit is contained in:
parent
fc5eeec654
commit
e99fedb494
2 changed files with 4 additions and 0 deletions
|
|
@ -77,6 +77,9 @@ export function cacheAvailabilityResults(infoHash, fileIds) {
|
||||||
|
|
||||||
export function removeAvailabilityResults(infoHash, fileIds) {
|
export function removeAvailabilityResults(infoHash, fileIds) {
|
||||||
const key = `${AVAILABILITY_KEY_PREFIX}:${infoHash}`;
|
const key = `${AVAILABILITY_KEY_PREFIX}:${infoHash}`;
|
||||||
|
if (fileIds === undefined) {
|
||||||
|
return mongoCache.delete(key);
|
||||||
|
}
|
||||||
const fileIdsString = fileIds.toString();
|
const fileIdsString = fileIds.toString();
|
||||||
return mongoCache.get(key)
|
return mongoCache.get(key)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,7 @@ export async function resolve({ ip, isBrowser, apiKey, infoHash, fileIndex }) {
|
||||||
}
|
}
|
||||||
if (isInfringingFileError(error)) {
|
if (isInfringingFileError(error)) {
|
||||||
console.log(`Infringing file removed from RealDebrid ${infoHash} [${fileIndex}]`);
|
console.log(`Infringing file removed from RealDebrid ${infoHash} [${fileIndex}]`);
|
||||||
|
removeAvailabilityResults(infoHash);
|
||||||
return StaticResponse.FAILED_INFRINGEMENT;
|
return StaticResponse.FAILED_INFRINGEMENT;
|
||||||
}
|
}
|
||||||
if (isLimitExceededError(error)) {
|
if (isLimitExceededError(error)) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue