MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / probeWebmAlpha

Function probeWebmAlpha

quote/quote.ts:897–915  ·  view source on GitHub ↗
(buffer: Buffer)

Source from the content-addressed store, hash-verified

895 if (size > 0 && size === lastSize) {
896 stable += 1;
897 if (stable >= 2) return fs.readFileSync(filePath);
898 } else {
899 stable = 0;
900 lastSize = size;
901 }
902 }
903 } catch (err) {
904 console.debug("[quote] waitForStableFile loop error:", err?.message || err);
905 }
906 await sleepMs(120);
907 }
908 try {
909 if (fs.existsSync(filePath) && fs.statSync(filePath).size > 0) return fs.readFileSync(filePath);
910 } catch (err) {
911 console.debug("[quote] waitForStableFile loop error:", err?.message || err);
912 }
913 return undefined;
914}
915
916async function downloadMediaToBuffer(client: any, target: any): Promise<Buffer | undefined> {
917 if (!client || !target) return undefined;
918 const mediaPath = path.join(os.tmpdir(), `telebox_quote_media_${Date.now()}_${Math.random().toString(16).slice(2)}`);

Callers 1

Calls 1

execFileCaptureAsyncFunction · 0.85

Tested by

no test coverage detected