Skip to content

Commit

Permalink
Fix cover download using Quasar cover providers.
Browse files Browse the repository at this point in the history
katastrofos.net is now using secure HTTP, replying
with a 301 moved permanently when polled on HTTP only.

Avoid HTML parsing on the result by using the query.php
method instead of the HTML frontend provided by index.php.
  • Loading branch information
dcaliste committed Dec 7, 2023
1 parent 869a3b6 commit 91b442d
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/loadwebimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,8 @@ void WebThread::checkAll()
//QString url = "http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=7f338c7458e7d1a9a6204221ff904ba1";

// QUASAR
QString url = "http://coverart.katastrophos.net/index.php?";
url += "&artist="+QUrl::toPercentEncoding(artist)+"&album="+QUrl::toPercentEncoding(album)+"&search=Search";

QString url = "https://coverart.katastrophos.net/query.php?";
url += "&artist="+QUrl::toPercentEncoding(artist)+"&album="+QUrl::toPercentEncoding(album)+"&mode=imageurls&limit=1";


//AMAZON - SIMPLE
Expand Down Expand Up @@ -211,16 +210,9 @@ void WebThread::downloaded(QNetworkReply *respuesta)

QString tmp = datos1;


//QUASAR
if (tmp.contains("<ul title=\"Cover Arts\">"))
if (tmp.startsWith("http"))
{
int x = tmp.indexOf("<li><a href=\"");
tmp.remove(0,x+13);
x = tmp.indexOf("\">");
tmp.remove(x,tmp.length()-x);
tmp = tmp.trimmed();

qDebug() << "Link for" << files[0][0] << files[0][1] << tmp;

downloadImage(tmp);
Expand Down

0 comments on commit 91b442d

Please sign in to comment.