Spaces:
Paused
Paused
Download src/providers/spotify/index.js from ZSCGR/Meting-API: direct link, hf CLI and curl.
- Browser
- Download file 503 Bytes
-
https://huggingface.co/spaces/ZSCGR/Meting-API/resolve/main/src/providers/spotify/index.js
- Command line
-
hf download hf://spaces/ZSCGR/Meting-API/src/providers/spotify/index.js
-
curl -L -o index.js https://huggingface.co/spaces/ZSCGR/Meting-API/resolve/main/src/providers/spotify/index.js
503 Bytes
| import { SPOTIFY_API } from "./config.js" | |
| const support_type = ['song', 'playlist'] | |
| const handle = async (type, id, cookie = '') => { | |
| let result | |
| const query = `?server=spotify&type=${type}&id=${id}` | |
| if (support_type.includes(type)) { | |
| result = await fetch(SPOTIFY_API + query) | |
| result = await result.json() | |
| } else { | |
| result = -1 | |
| } | |
| return result | |
| } | |
| export default { | |
| register: (ctx) => { | |
| ctx.register('spotify', { handle, support_type }) | |
| } | |
| } | |