rsshub
Version:
Make RSS Great Again!
54 lines (52 loc) • 1.32 kB
JavaScript
import "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import { t as ofetch_default } from "./ofetch-BIyrKU3Y.mjs";
import "./config-not-found-Dyp3RlZZ.mjs";
import { t as utils_default } from "./utils-DrMb85iG.mjs";
//#region lib/routes/spotify/artists-top.ts
const route = {
path: "/top/artists",
categories: ["multimedia"],
example: "/spotify/top/artists",
parameters: {},
features: {
requireConfig: [
{
name: "SPOTIFY_CLIENT_ID",
description: ""
},
{
name: "SPOTIFY_CLIENT_SECRET",
description: ""
},
{
name: "SPOTIFY_REFRESHTOKEN",
description: ""
}
],
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["open.spotify.com/"] }],
name: "Personal Top Artists",
maintainers: ["outloudvi"],
handler,
url: "open.spotify.com/"
};
async function handler() {
return {
title: `Spotify: My Top Artists`,
allowEmpty: true,
item: (await ofetch_default(`https://api.spotify.com/v1/me/top/artists`, {
method: "GET",
headers: { Authorization: `Bearer ${await utils_default.getPrivateToken()}` }
})).items.map((element) => utils_default.parseArtist(element))
};
}
//#endregion
export { route };