1
- #include < QJsonDocument>
1
+ #include < QJsonDocument>
2
2
#include < QJsonArray>
3
3
#include < QJsonObject>
4
4
#include < QNetworkRequest>
@@ -779,7 +779,7 @@ QVariantMap Api::cloud_match(QVariantMap query) {
779
779
// 云盘上传
780
780
QVariantMap Api::cloud (QVariantMap query) {
781
781
QString ext = " mp3" ;
782
- if (query[" songFile" ].toMap ()[" name" ].toString ().indexOf (" flac" ) > -1 ) {
782
+ if (query[" songFile" ].toMap ()[" name" ].toString ().toLower (). indexOf (" flac" ) > -1 ) {
783
783
ext = " flac" ;
784
784
}
785
785
QString filename = query[" songFile" ].toMap ()[" name" ].toString ()
@@ -802,6 +802,13 @@ QVariantMap Api::cloud(QVariantMap query) {
802
802
}
803
803
};
804
804
}
805
+
806
+ if (query.contains (" dataAsBase64" )) {
807
+ auto songFile = query[" songFile" ].toMap ();
808
+ songFile[" data" ] = QByteArray::fromBase64 (songFile[" data" ].toByteArray ());
809
+ query[" songFile" ] = songFile;
810
+ }
811
+
805
812
if (!query[" songFile" ].toMap ().contains (" md5" )) {
806
813
auto songFile = query[" songFile" ].toMap ();
807
814
auto data = songFile[" data" ].toByteArray ();
@@ -831,6 +838,16 @@ QVariantMap Api::cloud(QVariantMap query) {
831
838
QString album = " " ;
832
839
QString songName = " " ;
833
840
841
+ if (query.contains (" artist" )) {
842
+ artist = query[" artist" ].toString ();
843
+ }
844
+ if (query.contains (" album" )) {
845
+ album = query[" album" ].toString ();
846
+ }
847
+ if (query.contains (" songName" )) {
848
+ songName = query[" songName" ].toString ();
849
+ }
850
+
834
851
const auto tokenRes = request (
835
852
POST,
836
853
" https://music.163.com/weapi/nos/token/alloc" ,
0 commit comments