Skip to content

Commit

Permalink
change to work with Pixiv's changed ranking URL's
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowbluesky committed Feb 22, 2020
1 parent 73ed109 commit fc2be2f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/src/main/java/com/antony/muzei/pixiv/PixivArtWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -322,16 +322,14 @@ private Response getRemoteFileExtension(String url) throws IOException
Log.i(LOG_TAG, "Getting remote file extensions");
Response response;

// All urls have predictable formats, so we can simply do substring replacement
String uri0 = url
.replace("c/240x480/", "")
.replace("img-master", "img-original")
String uri0 = "https://i.pximg.net/img-original" + url.substring(url.indexOf("/img/"));
String uri1 = uri0
.replace("_master1200", "");
String uri1 = uri0.substring(0, uri0.length() - 4);
String uri2 = uri1.substring(0, uri1.length() - 4);

for (String suffix : IMAGE_SUFFIXS)
{
String uri = uri1 + suffix;
String uri = uri2 + suffix;
response = PixivArtService.sendGetRequestRanking(HttpUrl.parse(uri));
if (response.code() == 200)
{
Expand Down

0 comments on commit fc2be2f

Please sign in to comment.