UNPKG

rsshub

Version:
15 lines (13 loc) 738 B
import { t as config } from "./config-C37vj7VH.mjs"; import { t as ofetch_default } from "./ofetch-BIyrKU3Y.mjs"; import { t as cache_default } from "./cache-Bo__VnGm.mjs"; import { load } from "cheerio"; //#region lib/routes/apple/utils.ts const appstoreBearerToken = () => cache_default.tryGet("apple:podcast:bearer", async () => { const baseUrl = "https://apps.apple.com"; const $ = load(await ofetch_default(`${baseUrl}/us/iphone/today`)); const moduleAddress = new URL($("head script[type=\"module\"]").attr("src"), baseUrl).href; return (await ofetch_default(moduleAddress, { parseResponse: (txt) => txt })).match(/="(eyJhbGci.*?)"/)[1]; }, config.cache.contentExpire, false); //#endregion export { appstoreBearerToken as t };