rsshub
Version:
Make RSS Great Again!
15 lines (13 loc) • 738 B
JavaScript
import { t as config } from "./config-MQ-7ebJ_.mjs";
import { t as ofetch_default } from "./ofetch-DKl_Ma9g.mjs";
import { t as cache_default } from "./cache-SV6W5EPy.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 };