Compare commits
No commits in common. "d9b02065a2ebe2f4864c69061512817f391d66fc" and "6d5fb27c999c4a7e98b6febee8f9c9476dfbe930" have entirely different histories.
d9b02065a2
...
6d5fb27c99
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "real-debrid-downloader",
|
||||
"version": "1.6.72",
|
||||
"version": "1.6.71",
|
||||
"description": "Desktop downloader",
|
||||
"main": "build/main/main/main.js",
|
||||
"author": "Sucukdeluxe",
|
||||
|
||||
@ -679,8 +679,6 @@ class MegaDebridClient {
|
||||
|
||||
private static cachedApiTokenAt = 0;
|
||||
|
||||
private static pendingConnect: Promise<string | null> | null = null;
|
||||
|
||||
public constructor(login: string, password: string, preferApi: boolean, megaWebUnrestrict?: MegaWebUnrestrictor) {
|
||||
this.login = login;
|
||||
this.password = password;
|
||||
@ -694,18 +692,6 @@ class MegaDebridClient {
|
||||
return MegaDebridClient.cachedApiToken;
|
||||
}
|
||||
|
||||
// Deduplicate parallel connectUser calls — only one in-flight request at a time
|
||||
if (MegaDebridClient.pendingConnect) {
|
||||
return MegaDebridClient.pendingConnect;
|
||||
}
|
||||
|
||||
MegaDebridClient.pendingConnect = this.doConnectApi(signal).finally(() => {
|
||||
MegaDebridClient.pendingConnect = null;
|
||||
});
|
||||
return MegaDebridClient.pendingConnect;
|
||||
}
|
||||
|
||||
private async doConnectApi(signal?: AbortSignal): Promise<string | null> {
|
||||
const url = `${MEGA_DEBRID_API_BASE}?action=connectUser&login=${encodeURIComponent(this.login)}&password=${encodeURIComponent(this.password)}`;
|
||||
const response = await fetch(url, {
|
||||
headers: { "User-Agent": DEBRID_USER_AGENT },
|
||||
@ -1728,12 +1714,9 @@ export class DebridService {
|
||||
if (!result) {
|
||||
throw new Error("Real-Debrid-Web-Fallback nicht verfügbar");
|
||||
}
|
||||
result.sourceLabel = "Web";
|
||||
return result;
|
||||
}
|
||||
const result = await new RealDebridClient(settings.token).unrestrictLink(link, signal);
|
||||
result.sourceLabel = "API";
|
||||
return result;
|
||||
return new RealDebridClient(settings.token).unrestrictLink(link, signal);
|
||||
}
|
||||
if (provider === "megadebrid") {
|
||||
return new MegaDebridClient(settings.megaLogin, settings.megaPassword, settings.megaDebridPreferApi, this.options.megaWebUnrestrict).unrestrictLink(link, signal);
|
||||
@ -1744,12 +1727,9 @@ export class DebridService {
|
||||
if (!result) {
|
||||
throw new Error("AllDebrid-Web-Fallback nicht verfügbar");
|
||||
}
|
||||
result.sourceLabel = "Web";
|
||||
return result;
|
||||
}
|
||||
const adResult = await new AllDebridClient(settings.allDebridToken).unrestrictLink(link, signal);
|
||||
adResult.sourceLabel = "API";
|
||||
return adResult;
|
||||
return new AllDebridClient(settings.allDebridToken).unrestrictLink(link, signal);
|
||||
}
|
||||
if (provider === "ddownload") {
|
||||
return this.getDdownloadClient(settings.ddownloadLogin, settings.ddownloadPassword).unrestrictLink(link, signal);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user