Skip to content

Commit

Permalink
Merge branch 'UnblockNeteaseMusic:enhanced' into enhanced
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleRey authored Aug 31, 2023
2 parents af727f8 + 37481b0 commit 5e0e488
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 76 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ node app.js -o bilibili ytdlp
| 咪咕音乐 | `migu` || 需要准备自己的 `MIGU_COOKIE`(请参阅下方〈环境变量〉处)。 |
| JOOX | `joox` | | 需要准备自己的 `JOOX_COOKIE`(请参阅下方〈环境变量〉处)。似乎有严格地区限制。 |
| YouTube(纯 JS 解析方式) | `youtube` | | 需要 Google 认定的**非中国大陆区域** IP 地址。 |
| yt-download | `ytdownload` | | **似乎不能使用**|
| YouTube(通过 `youtube-dl`) | `youtubedl` | | 需要自行安装 `youtube-dl`|
| YouTube(通过 `yt-dlp`) | `ytdlp` || 需要自行安装 `yt-dlp``youtube-dl` 仍在活跃维护的 fork)。 |
| B 站音乐 | `bilibili` || |
Expand Down
1 change: 0 additions & 1 deletion src/consts.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const PROVIDERS = {
migu: require('./provider/migu'),
joox: require('./provider/joox'),
youtube: require('./provider/youtube'),
ytdownload: require('./provider/yt-download'),
youtubedl: require('./provider/youtube-dl'),
ytdlp: require('./provider/yt-dlp'),
bilibili: require('./provider/bilibili'),
Expand Down
10 changes: 2 additions & 8 deletions src/provider/match.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ const logger = logScope('provider/match');
const isHttpResponseOk = (code) => code >= 200 && code <= 299;

/** @type {Map<string, string>} */
const headerReferer = new Map([
['bilivideo.com', 'https://www.bilibili.com/'],
['yt-download.org', 'https://www.yt-download.org/'],
]);
const headerReferer = new Map([['bilivideo.com', 'https://www.bilibili.com/']]);

/**
* @typedef {{ size: number, br: number | null, url: string | null, md5: string | null }} AudioData
Expand Down Expand Up @@ -215,10 +212,7 @@ async function check(url) {
) || 0;

// Check if the Content-Length equals 8192.
if (
!isHost('yt-download.org') &&
headers['content-length'] !== '8192'
) {
if (headers['content-length'] !== '8192') {
// I'm not sure how to describe this.
// Seems like not important.
return Promise.reject();
Expand Down
63 changes: 0 additions & 63 deletions src/provider/yt-download.js

This file was deleted.

3 changes: 0 additions & 3 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,6 @@ const proxy = {
req.headers['referer'] = 'https://www.bilibili.com/';
req.headers['user-agent'] = 'okhttp/3.4.1';
}
if (isHost(req.url, 'yt-download.org')) {
req.headers['referer'] = 'https://www.yt-download.org/';
}
const url = parse(req.url);
const options = request.configure(req.method, url, req.headers);
ctx.proxyReq = request
Expand Down

0 comments on commit 5e0e488

Please sign in to comment.