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

解决获取vip歌曲url403问题 #169

Open
onceisy opened this issue Nov 4, 2022 · 4 comments
Open

解决获取vip歌曲url403问题 #169

onceisy opened this issue Nov 4, 2022 · 4 comments

Comments

@onceisy
Copy link

onceisy commented Nov 4, 2022

No description provided.

@onceisy
Copy link
Author

onceisy commented Nov 4, 2022

部分vip歌曲获取到url,播放会403,修改/url接口的部分参数即可:

原代码:

  const result = await request({
    url: 'https://u.y.qq.com/cgi-bin/musicu.fcg',
    data: {
      '-': 'getplaysongvkey',
      g_tk: 5381,
      loginUin: uin,
      hostUin: 0,
      format: 'json',
      inCharset: 'utf8',
      outCharset: 'utf-8¬ice=0',
      platform: 'yqq.json',
      needNewCode: 0,
      data: JSON.stringify({
        req_0: {
          module: 'vkey.GetVkeyServer',
          method: 'CgiGetVkey',
          param: {
            filename: [file],
            guid: guid,
            songmid: [id],
            songtype: [0],
            uin: uin,
            loginflag: 1,
            platform: '20',
          },
        },
        comm: {
          uin: uin,
          format: 'json',
          ct: 19,
          cv: 0,
          authst: qqmusic_key,
        },
      }),
    },
  });

修改后代码:

  const result = await request({
    url: 'https://u.y.qq.com/cgi-bin/musicu.fcg',
    data: {
      '-': 'getplaysongvkey',
      g_tk: 5381,
      loginUin: uin,
      hostUin: 0,
      format: 'json',
      platform: 'yqq.json',
      needNewCode: 0,
      data: JSON.stringify({
        req_0: {
          method: 'CgiGetVkey',
          module: 'vkey.GetVkeyServer',
          param: {
            guid: guid,
            loginflag: 1,
            platform: '20',
            songtype: [0],
            songmid: [id],
            uin: uin
          },
        },
        comm: {
          uin: uin,
          format: 'json',
          authst: qqmusic_key,
          cv: 4747474,
          ct: 24,
          inCharset: 'utf-8',
          outCharset: "utf-8",
          notice: 0,
          platform: "yqq.json",
          needNewCode: 0,
          g_tk_new_20200303: 706721460,
          g_tk: 706721460
        },
      }),
    },
  });

@qheartq616
Copy link

大佬你好,想问下/url这个接口不是下载歌曲的吗?可以用作在线播放吗?
目前只这样,我想做一个在线播放接口,用的是/urls接口但是返回数据有很大几率出现purl为空的情况,能指点下怎么解决吗,感谢!

@onceisy
Copy link
Author

onceisy commented May 15, 2023 via email

@qheartq616
Copy link

可以用作播放,确认下获取的歌曲类型和账号类型吧,vip歌曲需要黑胶会员的cookies

On Tue, Apr 25, 2023 at 9:44 AM qheartq616 @.> wrote: 大佬你好,想问下/url这个接口不是下载歌曲的吗?可以用作在线播放吗? 目前只这样,我想做一个在线播放接口,用的是/urls接口但是返回数据有很大几率出现purl为空的情况,能指点下怎么解决吗,感谢! — Reply to this email directly, view it on GitHub <#169 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ6BRHCDVWOV7A5Z3NQKOT3XC4UADANCNFSM6AAAAAARXBKE4A . You are receiving this because you authored the thread.Message ID: @.>

好的感谢,我已经做好雏形了hhh

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