Skip to content

Commit

Permalink
remove test for ytmusic if api not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
xizeyoupan committed Aug 30, 2023
1 parent 4176fb4 commit 9ce9c41
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Meting后端的api结构较为复杂,基础是一个[接口](https://github.co
| youtube music | √² ||
| spotify music | √² ||

⁰youtube和spotify的歌词由于不易访问,由 https://github.com/rtcq/syncedlyrics 检索而来,歌词匹配准确度不会很高。spotify的音乐源由 https://github.com/spotDL/spotify-downloader 检索而来,歌曲匹配准确度不会很高,并且获取url的时间极长,会反映在spotify歌曲加载缓慢
⁰youtube和spotify的歌词由于不易访问,由 https://github.com/xizeyoupan/syncedlyrics_aio 检索而来,歌词匹配准确度不会特别高。spotify的音乐源由 https://github.com/spotDL/spotify-downloader 检索而来,歌曲匹配准确度不会很高,并且获取url的时间较长,使spotify歌曲加载缓慢

¹使用jsonp,**需要替换前端插件**https://cdn.jsdelivr.net/npm/[email protected]/dist/Meting.min.js => https://cdn.jsdelivr.net/npm/@xizeyoupan/meting@latest/dist/Meting.min.js , or
https://unpkg.com/[email protected]/dist/Meting.min.js => https://unpkg.com/@xizeyoupan/meting@latest/dist/Meting.min.js
Expand All @@ -69,7 +69,7 @@ More info https://github.com/xizeyoupan/MetingJS
以下参数均由环境变量配置

- YT_API
默认的youtube music和spotify的api地址。国内可用性取决于YT_API的连通性。已经内置了一个。(每月限额,用完即止)如果你需要自己部署youtube music和spotify的api[此仓库](https://github.com/xizeyoupan/ytmusic-api-server)提供示例。
默认的youtube music和spotify的api地址。国内可用性取决于YT_API的连通性。**你需要自己部署youtube music和spotify的api**[此仓库](https://github.com/xizeyoupan/ytmusic-api-server)提供示例。
- OVERSEAS
用于判断是否部署于国外。设为1会启用qq音乐的jsonp返回,同时需要替换[前端插件](https://github.com/xizeyoupan/MetingJS),能实现国内访问国外api服务解析qq音乐。部署在国内不用设置这个选项。当部署到vercel上时,此选项自动设为1。
- PORT
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { get_runtime } from "./util.js"

let OVERSEAS = globalThis?.Deno?.env?.get("OVERSEAS") || globalThis?.process?.env?.OVERSEAS
const YT_API = globalThis?.Deno?.env?.get("YT_API") || globalThis?.process?.env?.YT_API || 'https://yt-ra.2333332.xyz/api'
const YT_API = globalThis?.Deno?.env?.get("YT_API") || globalThis?.process?.env?.YT_API
const runtime = get_runtime()

if (['cloudflare', 'vercel'].includes(runtime)) OVERSEAS = true
Expand Down
6 changes: 6 additions & 0 deletions test/providers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ test('test provider support_type', () => {
})
})

const YT_API = globalThis?.Deno?.env?.get("YT_API") || globalThis?.process?.env?.YT_API

test('test api', async () => {
for (const provider_name in examples) {
if (["ytmusic", "spotify"].includes(provider_name) && !YT_API) {
console.log("external api not found, skipping...")
continue
}
for (const type in examples[provider_name]) {

const url = `http://localhost:3000/api?server=${provider_name}&type=${type}&id=${examples[provider_name][type].value}`
Expand Down

1 comment on commit 9ce9c41

@vercel
Copy link

@vercel vercel bot commented on 9ce9c41 Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.