Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: 听歌打卡 #8

Open
lizr2004 opened this issue May 13, 2020 · 4 comments
Open

Feature Request: 听歌打卡 #8

lizr2004 opened this issue May 13, 2020 · 4 comments

Comments

@lizr2004
Copy link

听歌时调用网易云音乐的听歌打卡api,使之更新日推和私人FM的推荐 ,同时增加计数器升级

https://github.com/Binaryify/NeteaseCloudMusicApi/blob/master/module/scrobble.js
(可能是这个api吧)

另外网页版抓包发现 https://sdk1xyajs-data.xycdn.com/o_vod_h5sdk_cycle 也会传输听歌的实时数据(音频文件的 url 和目前时间等信息)不确定与智能推荐有没有关系(

@cosven
Copy link
Member

cosven commented May 13, 2020

试了下上面的那个接口,接口确实可以调用成功。但是不知道实际上有没有效果。

@cosven
Copy link
Member

cosven commented May 13, 2020

我在网页端抓了一下包,发现实际上它和 NeteaseCloudMusicApi 的 scrobble.js 的实现有点不一样

我抓到的结果大概如下:

  • 一首歌曲播放开始的时候
  • 在歌曲结束的时候
  • 歌曲切换的时候。切换分两种,一种是点击下一曲,一种是点击一首其他的歌曲。

歌曲开始时,会发送这样的请求

id: "28987626" 
source: "list" 
sourceid: "16199365" 
type: "song"  

souorce 可以是 list, artist, album 三种。id 指的是歌曲 id。list 指歌单。

歌曲结束时,会发送

download: 0 
end: "ui" 
id: 28987626 
source: "list" 
sourceId: "16199365" 
time: 231 
type: "song" 
wifi: 0   

end 是歌曲终止的类型,目前看这个字段有两种值:

  • interrupt -> 人为点击一首歌曲播放
  • ui -> 人为点击下一首,或者自然进入下一首

time 指歌曲终止的时候,进度条在哪个地方。

@cosven
Copy link
Member

cosven commented May 13, 2020

  • 通过手机端的“最近播放”可以看到调用 API 是否真的有效
  • 或者通过 web 端的个人主页的“最后一周”也能看到

@cosven
Copy link
Member

cosven commented May 13, 2020

写了个 demo,测试了下,会有效果。但不是特别的严谨,估计还有点 bug,欢迎改进它哇 ~

把 gist 中的这段代码放到 ~/.fuorc 文件中即可
https://gist.github.com/cosven/577e97c8caf71514e4585fcd4fd771b5


UPDATE 05-14 00:47 似乎会有效果...
UPDATE 05-14 08:36 似乎没有效果...
UPDATE 05-14 13:11 似乎对网页端是有效果的,对移动端没有...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants