MCPcopy Create free account
hub / github.com/FreeMovieIR/freemovieir.github.io / switchToNextKey

Method switchToNextKey

apiKeySwitcher.js:19–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17 }
18
19 switchToNextKey() {
20 if (this.userToken) {
21 console.log('توکن کاربر استفاده می‌شود، تعویض کلید غیرفعال است.');
22 return; // اگر توکن کاربر باشد، تعویض کلید غیرفعال است
23 }
24 this.currentIndex = (this.currentIndex + 1) % this.keys.length;
25 console.log(`تعویض به کلید API جدید: ${this.getCurrentKey()}`);
26 }
27
28 async fetchWithKeySwitch(urlTemplate, maxRetriesPerKey = 3) {
29 let attempts = 0;

Callers 1

fetchWithKeySwitchMethod · 0.95

Calls 1

getCurrentKeyMethod · 0.95

Tested by

no test coverage detected