UNPKG

chzzk-z

Version:

chzzk-z is naver streaming platform Chzzk Library

20 lines 670 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getContents = void 0; const getContents = (url, method, option) => { let headers = {}; const { nidAuth, nidSession } = option; if (nidAuth && nidSession) { headers["Cookie"] = `NID_AUT=${option.nidAuth};NID_SES=${option.nidSession}`; } headers["User-Agent"] = ""; return fetch(url, { method, headers, }) .then((res) => res.json()) .then((data) => data["content"] ?? null) .catch((error) => console.error("Fetch Error:", error)); }; exports.getContents = getContents; //# sourceMappingURL=api.repository.js.map