From 93808d6b0beb88d44f0fb5072751a1b6d02b8033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=80=81=E6=B9=BF?= <36294803+z52c@users.noreply.github.com> Date: Tue, 31 Jul 2018 13:19:53 +0800 Subject: [PATCH] Add files via upload --- musicDownloader.pro | 2 +- neteaseplaylist.cpp | 8 +++++++- neteaseplaylist.h | 2 ++ neteasesong.cpp | 7 ++++++- neteasesong.h | 1 + 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/musicDownloader.pro b/musicDownloader.pro index d89e5d2..afb7c45 100644 --- a/musicDownloader.pro +++ b/musicDownloader.pro @@ -81,4 +81,4 @@ DISTFILES += \ 1.jpg \ 1.ico -VERSION = 1.8.1 +VERSION = 1.8.2 diff --git a/neteaseplaylist.cpp b/neteaseplaylist.cpp index 3ebc349..1b635ff 100644 --- a/neteaseplaylist.cpp +++ b/neteaseplaylist.cpp @@ -7,7 +7,7 @@ neteasePlaylist::neteasePlaylist(QObject *parent) : QObject(parent) d->setUserAgent(UA); connect(d,SIGNAL(finished()),this,SLOT(htmlGot())); connect(d,SIGNAL(downloadError(QString)),this,SLOT(htmlGotFailed(QString))); - connect(d,SIGNAL(redirected(QString)),this,SLOT(htmlGotFailed(QString))); + connect(d,SIGNAL(redirected(QString)),this,SLOT(htmlGotRedirected(QString))); s=new neteaseSong(); connect(s,SIGNAL(finished(int,bool,QString)),this,SLOT(neteaseSongFinished(int,bool,QString))); } @@ -54,6 +54,12 @@ void neteasePlaylist::htmlGotFailed(QString errorString) finished(-1,infoList); } +void neteasePlaylist::htmlGotRedirected(QString redirectString) +{ + d->init(redirectString,SONGHTMLFILE); + d->doGet(); +} + void neteasePlaylist::htmlGot() { QFile file(SONGHTMLFILE); diff --git a/neteaseplaylist.h b/neteaseplaylist.h index 836aa7b..1652f4d 100644 --- a/neteaseplaylist.h +++ b/neteaseplaylist.h @@ -27,7 +27,9 @@ class neteasePlaylist : public QObject public slots: void htmlGot(); void htmlGotFailed(QString errorString); + void htmlGotRedirected(QString redirectString); void neteaseSongFinished(int inFlag,bool inIsGray,QString inString); + private: QString mid; downloader *d; diff --git a/neteasesong.cpp b/neteasesong.cpp index 6d51510..89427c2 100644 --- a/neteasesong.cpp +++ b/neteasesong.cpp @@ -6,7 +6,7 @@ neteaseSong::neteaseSong(QObject *parent) : QObject(parent) d->setUserAgent(UA); connect(d,SIGNAL(finished()),this,SLOT(htmlFileGot())); connect(d,SIGNAL(downloadError(QString)),this,SLOT(htmlFileGotFailed(QString))); - connect(d,SIGNAL(redirected(QString)),this,SLOT(htmlFileGotFailed(QString))); + connect(d,SIGNAL(redirected(QString)),this,SLOT(htmlGotRedirected(QString))); search=new qqMusicSearch(); connect(search,SIGNAL(finished(int,QString)),this,SLOT(searchResultGot(int,QString))); @@ -20,6 +20,11 @@ void neteaseSong::doJob(QString inMid) d->doGet(); } +void neteaseSong::htmlGotRedirected(QString redirectString) +{ + d->init(redirectString,QString(SONGHTMLFILE)); + d->doGet(); +} void neteaseSong::htmlFileGotFailed(QString errorString) { diff --git a/neteasesong.h b/neteasesong.h index 80c8995..3d320d1 100644 --- a/neteasesong.h +++ b/neteasesong.h @@ -18,6 +18,7 @@ class neteaseSong : public QObject public slots: void htmlFileGot(); void htmlFileGotFailed(QString errorString); + void htmlGotRedirected(QString redirectString); void searchResultGot(int inFlag,QString inString); private: downloader *d;