s12mmm3 / QCloudMusicApi

Qt C++版 网易云音乐 API
https://s12mmm3.github.io/QCloudMusicApi/
MIT License
66 stars 13 forks source link

Fix cookie and support to use base64 as file in upload to cloud #35

Closed zeyugao closed 3 months ago

zeyugao commented 3 months ago

Fix when cookie is QString

Support pass songFile as base64 encoded string when uploading to cloud

Better handle the ext in cloud interface

s12mmm3 commented 3 months ago

ApiHelper类不是对QString类型Cookie做处理了么🤔

s12mmm3 commented 3 months ago

歌曲上传那块还没试过,没问题的话我先合并这一块吧

zeyugao commented 3 months ago

https://github.com/s12mmm3/QCloudMusicApi/blob/2e25539a7d1a46ea95149038e7c73b2a88ccb2ea/QCloudMusicApi/apihelper.cpp#L22 没做变成map的处理吧,后面api method的时候tomap一下都变空了

s12mmm3 commented 3 months ago

image 有的,做了两次判断;去年写的Test小工具就是传的map类型

zeyugao commented 3 months ago

就是指在api method里面按照是cookie是map来处理的,但是apihelper里面对于qstring还是保留了qstring,没有变成qmap,就让一些api坏掉了,我用cloud这个接口就有这个问题。用capi调用的时候,拿到的和传类型都是string。

s12mmm3 commented 3 months ago

我明白了,ApiHelper转map以后没把map塞回去,那还是改下ApiHelper吧

zeyugao commented 3 months ago

在request函数里面得到的cookie是拍平的,而且也有对类型的检查

https://github.com/s12mmm3/QCloudMusicApi/blob/dev/QCloudMusicApi/util/request.cpp#L80-L102

如果把这个request的重建为map的过程放到apihelper里面,就等于强制要求用apihelper了,应该保持直接调用api method的兼容性吧

s12mmm3 commented 3 months ago

这个没关系,本来就是推荐用ApiHelper类的,后续这种小修改都是在helper上改比较方便

s12mmm3 commented 3 months ago

nodejs版在module也是默认cookie是map类型,这块保持一致就行

zeyugao commented 3 months ago

那应该要让request返回的时候一定已经是map了

https://github.com/s12mmm3/QCloudMusicApi/blob/2e25539a7d1a46ea95149038e7c73b2a88ccb2ea/QCloudMusicApi/util/request.cpp#L198-L202