Giter Site home page Giter Site logo

yun-playlist-downloader's Introduction

yun-playlist-downloader

网易云音乐 - 歌单 - 下载器

Build Status Coverage Status npm version npm downloads node version license

特性

  • 支持歌单 / 专辑 / 电台
  • 音质选择
  • 下载超时 / 重试
  • 再次下载默认跳过已下载部分, 使用 content-length 匹配
  • 自定义文件名
  • 下载进度显示

注意

本项目不支持越权使用, VIP 歌曲请开通 VIP 后结合 --cookie 使用. see #54

安装

# pnpm (recommend)
$ pnpm add -g yun-playlist-downloader

# npm
$ npm i yun-playlist-downloader -g

使用

Usage: yun <url> [options]

位置:
  url  歌单/专辑的链接                                                  [字符串]

选项:
      --retryTimeout  下载超时(分)                            [数字] [默认值: 3]
      --retryTimes    下载重试次数                            [数字] [默认值: 3]
      --cover         下载封面                            [布尔] [默认值: false]
      --cookie        cookie文件             [字符串] [默认值: "yun.cookie.txt"]
  -h, --help          显示帮助信息                                        [布尔]
  -v, --version       显示版本号                                          [布尔]
  -c, --concurrency   同时下载数量                                        [数字]
  -f, --format        文件格式                                          [字符串]
  -q, --quality       音质                                                [数字]
  -s, --skip          对于已存在文件且大小合适则跳过                      [布尔]
  -p, --progress      是否显示进度条                                      [布尔]

示例:
  yun -c 10 <url>                          10首同时下载
  yun -f ":singer - :songName.:ext" <url>  下载格式为 "歌手 - 歌名"

帮助 & 文档: https://github.com/magicdawn/yun-playlist-downloader

--retry-timeout 重试超时

设置下载超时, 单位为分, 默认 3 分钟

--retry-times 重试次数

设置下载重试次数, 需要与 --retry-timeout 搭配使用,默认 3 次

--cover 下载封面

默认不下载

--cookie 已登录 cookie 存放地址

docs/cookie.md

-c, --concurrency 下载并发

下载并发

-f, --format 自定义文件名

token 含义 备注
:type = album or playlist
:typeText = 专辑 or 列表
:name 专辑名称 or 播放列表名称
:singer 歌手名
:songName 歌名(aka 标题)
:albumName 所属专辑
:ext 文件后缀,如 mp3 不带 .
:index 01 , 02 ... 12
:rawIndex 0 1 ... 11
:programDate 电台节目发布日期 仅电台可用
:programOrder 数字, 电台第几期 仅电台可用
  • 默认值 = :name/:singer - :songName.:ext
  • 电台默认 = :name/:programDate 第:programOrder 期 - :songName.:ext

-q, --quality 自定义下载音质

取值 含义 备注
128 128kbits/s
192 192kbits/s
320 320kbits/s 默认

-s, --skip 是否跳过下载

  • 对于文件已存在, 而且文件大小与要下载的网络文件的 content-length 大小一致, 则跳过下载
  • 默认启用
  • 使用 --skip false 关闭该特性

-p, --progress 是否显示进度条

  • 默认 true, 显示进度条, 使用 false 不显示进度条
  • 使用了模块 ascii-progress, 问题比较多, 比如非 tty, 在控制台输入一些东西进度显示就乱了, 故提供选项关闭该特性

.yunrc

该工具使用了 rc 模块, 会去遍历读取 .yunrc 配置文件 具体规则见 rc 模块 README https://github.com/dominictarr/rc#standards

截图

更新记录

CHANGELOG.md

License

the MIT License http://magicdawn.mit-license.org

yun-playlist-downloader's People

Contributors

dependabot[bot] avatar magicdawn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yun-playlist-downloader's Issues

新特性

  • 支持下载部分歌曲
  • 支持 skip 参数, 对于已经存在的可以跳过

下载包含较多数量歌曲的歌单,报错Cannot read property 'map' of undefined

下载https://music.163.com/#/playlist?id=4954140120 歌单,报错了:

yun https://music.163.com/\#/playlist\?id\=4954140120                                                    

当前参数
concurrency:    5
format:         :name/:singer - :songName.:ext
retry-timeout:  3 (分钟)
retry-times:    3 (次)
quality:        320
skip:           true
progress:       true
cover:          false

[cookie] cookie 文件不存在: /yun.cookie.txt
正在下载『银河漫游企划 国内独立乐队辑 持续更新』,请稍候...
TypeError: Cannot read property 'map' of undefined
    at PlaylistAdapter.filterSongs (/usr/local/lib/node_modules/yun-playlist-downloader/lib/adapter/base.js:74:31)
    at PlaylistAdapter.getSongs (/usr/local/lib/node_modules/yun-playlist-downloader/lib/adapter/playlist.js:49:36)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
    at async main (/usr/local/lib/node_modules/yun-playlist-downloader/lib/bin.js:145:19)

测试了另一个两千多首歌的歌单,好像歌里单超过1000首歌就会报错。能确认下这个问题吗?如果是因为歌曲太多了,可以支持下包含了较多数量数量的歌单下载吗

PS:还有另一个小问题,想下载的时候设置文件名中包含专辑名,比如
image
最后下载的文件名大概是陈奕迅-U87-浮夸.mp3这样,-f参数里能设置吗?我尝试设置了下-f发现都不生效,感谢回答

跑不起来啊,好像不是Electron没安装好啊

C:\Users\Administrator>yun
C:\Users\Administrator\AppData\Roaming\npm\node_modules\yun-playl
node_modules\electron\index.js:9
throw new Error('Electron failed to install correctly, please d
les/' + path.basename(__dirname) + ' and try installing again')
^

Error: Electron failed to install correctly, please delete node_m
and try installing again
at Object. (C:\Users\Administrator\AppData\Roaming
es\yun-playlist-downloader\node_modules\electron\index.js:9:9)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (C:\Users\Administrator\AppData\Roaming
es\yun-playlist-downloader\node_modules\nightmare\lib\nightmare.j
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)

缺少依赖

小老弟,阔以哟,这个东西很方便哟,不过第一次用报错了
Ubuntu 20.04
npm 8.1.2
nodejs 10.19.0

  1. 下载专辑提示缺少依赖

`
当前参数
concurrency: 5
format: :name/:singer - :songName.:ext
retry-timeout: 3 (分钟)
retry-times: 3 (次)
quality: 320
skip: true
progress: true
cover: false

正在下载『舞剧《李白》音乐(完整版)』,请稍候...
ℹ 可下载 24/24 首
Error: Cannot find module '@magicdawn/ascii-progress'
Require stack:

  • /usr/local/lib/node_modules/yun-playlist-downloader/lib/index.js
  • /usr/local/lib/node_modules/yun-playlist-downloader/lib/bin.js
  • /usr/local/lib/node_modules/yun-playlist-downloader/bin/yun
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.exports.downloadSongWithProgress (/usr/local/lib/node_modules/yun-playlist-downloader/lib/index.js:41:25)
    at Object.exports.downloadSong (/usr/local/lib/node_modules/yun-playlist-downloader/lib/index.js:34:24)
    at Object. (/usr/local/lib/node_modules/yun-playlist-downloader/lib/bin.js:162:24)
    at /usr/local/lib/node_modules/yun-playlist-downloader/node_modules/promise.map/src/index.js:29:30
    at replenish (/usr/local/lib/node_modules/yun-playlist-downloader/node_modules/promise.map/src/index.js:38:11)
    at /usr/local/lib/node_modules/yun-playlist-downloader/node_modules/promise.map/src/index.js:40:7`
  1. 试图自己安装依赖 npm i @magicdawn/ascii-progress
npm ERR! code 1
npm ERR! path /home/feeco/Desktop/test/node_modules/@magicdawn/get-cursor-position
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! make: Entering directory '/home/feeco/Desktop/test/node_modules/@magicdawn/get-cursor-position/build'
npm ERR!   CXX(target) Release/obj.target/pos/src/pos.o
npm ERR!   SOLINK_MODULE(target) Release/obj.target/pos.node
npm ERR! make: Leaving directory '/home/feeco/Desktop/test/node_modules/@magicdawn/get-cursor-position/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/feeco/.nvm/versions/node/v16.13.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/feeco/Desktop/test/node_modules/@magicdawn/get-cursor-position/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/feeco/.nvm/versions/node/v16.13.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/feeco/.cache/node-gyp/16.13.1/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/feeco/.cache/node-gyp/16.13.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/feeco/.nvm/versions/node/v16.13.1/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/feeco/.cache/node-gyp/16.13.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/feeco/Desktop/test/node_modules/@magicdawn/get-cursor-position',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! ../src/pos.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE Method(Nan::NAN_METHOD_ARGS_TYPE)’:
npm ERR! ../src/pos.cc:244:9: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
npm ERR!   244 |     int ret, row, col;
npm ERR!       |         ^~~
npm ERR! In file included from ../src/pos.cc:2:
npm ERR! ../src/pos.cc: At global scope:
npm ERR! /home/feeco/.cache/node-gyp/16.13.1/include/node/node.h:821:43: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
npm ERR!   821 |       (node::addon_register_func) (regfunc),                          \
npm ERR!       |                                           ^
npm ERR! /home/feeco/.cache/node-gyp/16.13.1/include/node/node.h:855:3: note: in expansion of macro ‘NODE_MODULE_X’
npm ERR!   855 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
npm ERR!       |   ^~~~~~~~~~~~~
npm ERR! ../src/pos.cc:266:1: note: in expansion of macro ‘NODE_MODULE’
npm ERR!   266 | NODE_MODULE(hello, Init)
npm ERR!       | ^~~~~~~~~~~
npm ERR! /usr/bin/ld: Release/obj.target/pos/src/pos.o: relocation R_X86_64_PC32 against symbol `_Z6MethodRKN3Nan20FunctionCallbackInfoIN2v85ValueEEE' can not be used when making a shared object; recompile with -fPIC
npm ERR! /usr/bin/ld: final link failed: bad value
npm ERR! collect2: error: ld returned 1 exit status
npm ERR! make: *** [pos.target.mk:141: Release/obj.target/pos.node] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/home/feeco/.nvm/versions/node/v16.13.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Linux 5.11.0-43-generic
npm ERR! gyp ERR! command "/home/feeco/.nvm/versions/node/v16.13.1/bin/node" "/home/feeco/.nvm/versions/node/v16.13.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/feeco/Desktop/test/node_modules/@magicdawn/get-cursor-position
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v8.3.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/feeco/.npm/_logs/2022-01-06T16_43_11_231Z-debug.log

install的时候出现一个异常

hi 大神,昨天clone下来的源码在 npm install 的时候会出一个异常

79 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...oli-uglify-js":"^0.2.'
79 verbose stack     at JSON.parse (<anonymous>)
79 verbose stack     at parseJson (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-better-errors/index.js:7:17)
79 verbose stack     at consumeBody.call.then.buffer (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/body.js:96:50)
79 verbose stack     at <anonymous>
79 verbose stack     at process._tickCallback (internal/process/next_tick.js:160:7)

另外还有一行显示如下

silly fetchPackageMetaData error for [email protected] Unexpected end of JSON input while parsing near '...oli-uglify-js":"^0.2.'

呃,我这里为了速度把npm的源设置为了淘宝,会不会是这个原因。拜谢

ReferenceError: URL is not defined

当前参数
concurrency: 5
format: :name/:singer - :songName.:ext
retry-timeout: 3 (分钟)
retry-times: 3 (次)
quality: 320
skip: true
progress: true

ReferenceError: URL is not defined
at exports.getId (C:\Users\Lee\AppData\Roaming\npm\node_modules\yun-playlist-downloader\lib\util.js:45:13)
at AlbumAdapter.getId (C:\Users\Lee\AppData\Roaming\npm\node_modules\yun-playlist-downloader\lib\adapter\base.js:27:12)
at AlbumAdapter.getDetail (C:\Users\Lee\AppData\Roaming\npm\node_modules\yun-playlist-downloader\lib\adapter\album.js:11:21)
at exports.getSongs (C:\Users\Lee\AppData\Roaming\npm\node_modules\yun-playlist-downloader\lib\index.js:209:29)
at main (C:\Users\Lee\AppData\Roaming\npm\node_modules\yun-playlist-downloader\bin\yun:141:23)
at
at process._tickCallback (internal/process/next_tick.js:188:7)

大佬,哪里不对吗?

Unexpected token ...

/usr/local/lib/node_modules/yun-playlist-downloader/node_modules/yargs/node_modules/find-up/index.js:29
const foundPath = await runMatcher({...options, cwd: directory});
^^^
SyntaxError: Unexpected token ...
at Object.exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:543:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at pkgUp (/usr/local/lib/node_modules/yun-playlist-downloader/node_modules/yargs/yargs.js:570:20)
at guessVersion (/usr/local/lib/node_modules/yun-playlist-downloader/node_modules/yargs/yargs.js:900:17)

安装报错

fatal error C
1083: 无法打开包括文件: “nan.h”: No such file or directory

老大,什么时候更新下

yun http://music.163.com/#/playlist?id=12583200

当前参数
concurrency: 5
timeout: 3
max-times: 3
quality: 320
format: :name/:singer - :songName.:ext
skip: true

SyntaxError: Unexpected token H in JSON at position 0
at JSON.parse ()
at Object.exports.getSongs (C:\Users\Administrator.USER-20171126FM\AppData\R
oaming\npm\node_modules\yun-playlist-downloader\lib\index.js:236:20)
at main (C:\Users\Administrator.USER-20171126FM\AppData\Roaming\npm\node_mod
ules\yun-playlist-downloader\bin\yun:116:27)
at

请问毫无编程基础 如何使用这个

你好。我毫无编程基础,搜索到这里。 这个工具要怎么使用呢?

下载了 node-v6.95-win-x64.zip, 下载的对吗?
解压后 这node似乎是不用/不能安装?
也下载了您写的工具,但是好像也是不能直接安装

对一个完全的小白来说,使用这个工具的话
具体的步骤是怎样呢?

非常感谢

是否能够下载自己的歌单?

这边不用cookie下载公开的歌单是正常的,用cookie下载自己的歌单(URL里面换上自己的歌单id),会报错

当前参数
concurrency: 1
format: :songName_:singer_:name.:ext
retry-timeout: 3 (分钟)
retry-times: 3 (次)
quality: 320
skip: true
progress: true
cover: true

[cookie] 使用 cookie 文件: /Users/XXX/Desktop/down_music/yun.cookie.txt
{
status: 502,
body: {
code: 502,
msg: Error: aborted
at connResetException (node:internal/errors:631:14)
at TLSSocket.socketCloseListener (node:_http_client:434:19)
at TLSSocket.emit (node:events:388:22)
at node:net:666:12
at TCP.done (node:_tls_wrap:573:7) {
code: 'ECONNRESET',
config: [Object],
request: [ClientRequest],
response: undefined,
isAxiosError: true,
toJSON: [Function: toJSON]
}
},
cookie: []
}

我的node 版本v0.10.25,报了SyntaxError: Use of const in strict mode的错误,该怎样解决?

具体如下:

yun -c 10 https://music.163.com/#/playlist?id=523729488

/usr/local/lib/node_modules/yun-playlist-downloader/bin/yun:5
const path = require('path')
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:902:3

基于night的下载,不正常?

尝试下载歌单,输出了一些信息,发现..
利用night 下载的方式似乎是挂了..

await night.goto('http://music.163.com')

这一步直接跳出了...
也没有任何错误弹出..
一开始我以为是运行环境的问题(最开始我跑在树莓派上),但是...
我换到阿里云的centos7上依旧不工作...
不过,把方式换成基于sdk下载,就能正常运作

安装报错

运行npm i yun-playlist-downloader -g出现以下错误

added 218 packages, and audited 219 packages in 25s
16 packages are looking for funding
  run `npm fund` for details
12 vulnerabilities (2 moderate, 10 high)
To address all issues (including breaking changes), run:
  npm audit fix --force
Run `npm audit` for details.

运行npm audit fix --force出现以下错误

Will install [email protected], which is a breaking change
node_modules/string
  @magicdawn/music-api  *
  Depends on vulnerable versions of string
  node_modules/@magicdawn/music-api
    yun-playlist-downloader  *
    Depends on vulnerable versions of @magicdawn/music-api
    Depends on vulnerable versions of cheerio
    Depends on vulnerable versions of dl-vampire
    Depends on vulnerable versions of nightmare
    Depends on vulnerable versions of umi-request
    node_modules/yun-playlist-downloader
13 vulnerabilities (2 moderate, 11 high)
To address all issues (including breaking changes), run:
  npm audit fix --force

运行npm audit出现以下错误

13 vulnerabilities (2 moderate, 11 high)
To address all issues (including breaking changes), run:
  npm audit fix --force

好像用不了?

你好,试了一下,好像出问题了。能否看一下。

$ yun
module.js:338
throw err;
^

Error: Cannot find module 'superagent/node_modules/cookiejar'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/usr/local/lib/node_modules/yun-playlist-downloader/lib/index.js:4:24)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/usr/local/lib/node_modules/yun-playlist-downloader/bin/yun:7:11)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)

安装时候没问题,版本和log如下:
node v4.0.0
npm v3.3.3

$ npm i yun-playlist-downloader -g
/usr/local/bin/yun -> /usr/local/lib/node_modules/yun-playlist-downloader/bin/yun
/usr/local/lib
└─┬ [email protected]
├── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ └── [email protected]
└── [email protected]

成功率很低

很难下载成功,总是报下面这两类错误,偶尔能成功下载,是网易增强了防范吗?

$yun https://music.163.com/\#/playlist\?id\=7569767313

当前参数
concurrency:    5
format:         :name/:singer - :songName.:ext
retry-timeout:  3 (分钟)
retry-times:    3 (次)
quality:        320
skip:           true
progress:       true
cover:          false

[cookie] cookie 文件不存在: /mnt/e/music/yun.cookie.txt
FetchError: request to https://music.163.com/playlist?id=7569767313&csrf_token=6817f1ae5c9664c9076e301c537afc29 failed, reason: connect ETIMEDOUT 52.12.99.35:443
    at ClientRequest.<anonymous> (/usr/lib/node_modules/yun-playlist-downloader/node_modules/node-fetch/index.js:133:11)    at ClientRequest.emit (events.js:314:20)
    at TLSSocket.socketErrorListener (_http_client.js:427:9)
    at TLSSocket.emit (events.js:314:20)
    at emitErrorNT (internal/streams/destroy.js:92:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
$yun 'https://music.163.com/#/playlist?id=7569767313'

当前参数
concurrency:    5
format:         :name/:singer - :songName.:ext
retry-timeout:  3 (分钟)
retry-times:    3 (次)
quality:        320
skip:           true
progress:       true
cover:          false

[cookie] cookie 文件不存在: /mnt/e/music/yun.cookie.txt
正在下载『2022网络爆火流行歌曲推荐』,请稍候...
{
  status: 502,
  body: {
    code: 502,
    msg: Error: connect ETIMEDOUT 52.12.99.35:443
        at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16) {
      errno: 'ETIMEDOUT',
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '52.12.99.35',
      port: 443,
      config: [Object],
      request: [Writable],
      response: undefined,
      isAxiosError: true,
      toJSON: [Function: toJSON]
    }
  },
  cookie: []
}

无法修改音乐下载路径,而且只有给予root权限后,才能运行

系统环境:MacBook Air, OS X 10.13.2

如果在普通用户下执行,部分报错如下:

⚠ 15/19  1次失败 /Richard Clayderman - Mariage d'amour.mp3
⚠ 15/19  2次失败 /Richard Clayderman - Mariage d'amour.mp3
⚠ 15/19  3次失败 /Richard Clayderman - Mariage d'amour.mp3
✖ 15/19 下载失败 /Richard Clayderman - Mariage d'amour.mp3
Error: tried function <anonymous> 3 times with timeout = 180000ms
    at /usr/local/lib/node_modules/yun-playlist-downloader/node_modules/promise.retry/index.js:61:11
    at Generator.throw (<anonymous>)
    at onRejected (/usr/local/lib/node_modules/yun-playlist-downloader/node_modules/co/index.js:81:24)
    at <anonymous>

无论当前位于哪个目录,获取root权限后下载位置始终为根目录 / 下

Catalina 安装失败

系统

  • Catalina 10.15
  • xcode-select version 2370
  • nodejs v12.13

报错信息

> [email protected] install /Users/zhangniansong/node_modules/get-cursor-position
> node-gyp rebuild

  CXX(target) Release/obj.target/pos/src/pos.o
../src/pos.cc:272:22: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations]
    pos->Set(String::NewFromUtf8(isolate, "row"), Number::New(isolate, row));
                     ^
/Users/zhangniansong/Library/Caches/node-gyp/12.13.0/include/node/v8.h:2934:10: note: 'NewFromUtf8' has been explicitly marked
      deprecated here
  static V8_DEPRECATED(
         ^
/Users/zhangniansong/Library/Caches/node-gyp/12.13.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../src/pos.cc:272:10: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
    pos->Set(String::NewFromUtf8(isolate, "row"), Number::New(isolate, row));
         ^
/Users/zhangniansong/Library/Caches/node-gyp/12.13.0/include/node/v8.h:3402:3: note: 'Set' has been explicitly marked deprecated
      here
  V8_DEPRECATED("Use maybe version",
  ^
/Users/zhangniansong/Library/Caches/node-gyp/12.13.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../src/pos.cc:273:22: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations]
    pos->Set(String::NewFromUtf8(isolate, "col"), Number::New(isolate, col));
                     ^
/Users/zhangniansong/Library/Caches/node-gyp/12.13.0/include/node/v8.h:2934:10: note: 'NewFromUtf8' has been explicitly marked
      deprecated here
  static V8_DEPRECATED(
         ^
/Users/zhangniansong/Library/Caches/node-gyp/12.13.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../src/pos.cc:273:10: warning: 'Set' is deprecated: Use maybe version [-Wdeprecated-declarations]
    pos->Set(String::NewFromUtf8(isolate, "col"), Number::New(isolate, col));
         ^
/Users/zhangniansong/Library/Caches/node-gyp/12.13.0/include/node/v8.h:3402:3: note: 'Set' has been explicitly marked deprecated
      here
  V8_DEPRECATED("Use maybe version",
  ^
/Users/zhangniansong/Library/Caches/node-gyp/12.13.0/include/node/v8config.h:311:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../src/pos.cc:277:6: error: variable has incomplete type 'void'
void Init(Handle<Object> exports) {
     ^
../src/pos.cc:277:11: error: use of undeclared identifier 'Handle'
void Init(Handle<Object> exports) {
          ^
../src/pos.cc:277:18: error: 'Object' does not refer to a value
void Init(Handle<Object> exports) {
                 ^
/Users/zhangniansong/Library/Caches/node-gyp/12.13.0/include/node/v8.h:3400:17: note: declared here
class V8_EXPORT Object : public Value {
                ^
../src/pos.cc:277:26: error: use of undeclared identifier 'exports'
void Init(Handle<Object> exports) {
                         ^
../src/pos.cc:277:34: error: expected ';' after top level declarator
void Init(Handle<Object> exports) {
                                 ^
                                 ;
4 warnings and 5 errors generated.
make: *** [Release/obj.target/pos/src/pos.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/zhangniansong/node_modules/get-cursor-position
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open '/Users/zhangniansong/package.json'
npm WARN zhangniansong No description
npm WARN zhangniansong No repository field.
npm WARN zhangniansong No README data
npm WARN zhangniansong No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/zhangniansong/.npm/_logs/2019-10-27T17_24_11_725Z-debug.log

树莓派3B+无法使用,报错如下

运行环境:
Linux OSMC32G 4.14.34-5-osmc 基于Debian
nodejs:v8.12.0
npm:6.4.1
electron:v1.8.8-linux-arm(安装时默认的版本)
nodejs和npm为已编译的arm7版本
electron尝试默认版本和手动安装最新版本,安装成功,仍旧报错

报错如下:
`osmc@OSMC32G:~/Music$ sudo yun https://music.163.com/#/playlist?id=2418285525

当前参数
concurrency: 5
timeout: 3
max-times: 3
quality: 320
format: :name/:singer - :songName.:ext
skip: true

RequestError: Error: connect ETIMEDOUT 59.111.160.197:443
at new RequestError (/usr/lib/node_modules/yun-playlist-downloader/node_modules/request-promise-core/lib/errors.js:14:15)
at Request.plumbing.callback (/usr/lib/node_modules/yun-playlist-downloader/node_modules/request-promise-core/lib/plumbing.js:87:29)
at Request.RP$callback [as _callback] (/usr/lib/node_modules/yun-playlist-downloader/node_modules/request-promise-core/lib/plumbing.js:46:31)
at self.callback (/usr/lib/node_modules/yun-playlist-downloader/node_modules/request/request.js:185:22)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at Request.onRequestError (/usr/lib/node_modules/yun-playlist-downloader/node_modules/request/request.js:881:8)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at TLSSocket.socketErrorListener (_http_client.js:387:9)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:66:8)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickCallback (internal/process/next_tick.js:181:9)
`
在Windows环境下测试同一链接无问题~

添加了 Cookie 下载个人喜欢返回 502

按照文档要求使用 Chrome 插件导出了 Cookie 并保存为 yun.cookie.txt
内容类似下面这样.

[
{
    "domain": ".163.com",
    "expirationDate": 1697034245.287346,
    "hostOnly": false,
    "httpOnly": false,
    "name": "_ntes_nnid",
    "path": "/",
    "sameSite": "unspecified",
    "secure": false,
    "session": false,
    "storeId": "0",
    "value": "xxx",
    "id": 1
},......
]

程序输出

当前参数
concurrency:    5
format:         :name/:singer - :songName.:ext
retry-timeout:  3 (分钟)
retry-times:    3 (次)
quality:        320
skip:           true
progress:       true
cover:          false

[cookie] 使用 cookie 文件: /home/xxx/yun.cookie.txt
{
  status: 502,
  body: {
    code: 502,
    msg: Error: aborted
        at connResetException (node:internal/errors:692:14)
        at TLSSocket.socketCloseListener (node:_http_client:414:19)
        at TLSSocket.emit (node:events:539:35)
        at node:net:709:12
        at TCP.done (node:_tls_wrap:582:7) {
      code: 'ECONNRESET',
      config: [Object],
      request: [ClientRequest],
      response: undefined,
      isAxiosError: true,
      toJSON: [Function: toJSON]
    }
  },
  cookie: []
}

很抱歉,不知道为何安装不上

Windows,nodejs12环境,安装失败
Windows,WSL Ubuntu 19.10+nodejs12环境,安装失败
Ubuntu 19.10,nodejs12环境,安装失败
是nodejs版本问题吗?
放上错误信息

@magicdawn/[email protected] install /usr/lib/node_modules/yun-playlist-downloader/node_modules/@magicdawn/get-cursor-position
node-gyp rebuild

gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/root/.cache/node-gyp/12.13.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/yun-playlist-downloader/node_modules/@magicdawn/get-cursor-position/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/yun-playlist-downloader/node_modules/@magicdawn/get-cursor-position/.node-gyp'
gyp ERR! System Linux 4.4.0-18362-Microsoft
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/yun-playlist-downloader/node_modules/@magicdawn/get-cursor-position
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @magicdawn/[email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @magicdawn/[email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-11-28T16_41_56_502Z-debug.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.