Merge pull request #149 from cyian-1756/8muses

8muses ripper now works with latest site update
This commit is contained in:
cyian-1756 2017-11-07 21:10:23 -05:00 committed by GitHub
commit 47a1981d32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View File

@ -178,10 +178,8 @@ public class EightmusesRipper extends AbstractHTMLRipper {
sendUpdate(STATUS.LOADING_RESOURCE, imageUrl); sendUpdate(STATUS.LOADING_RESOURCE, imageUrl);
logger.info("Getting full sized image from " + imageUrl); logger.info("Getting full sized image from " + imageUrl);
Document doc = new Http(imageUrl).get(); // Retrieve the webpage of the image URL Document doc = new Http(imageUrl).get(); // Retrieve the webpage of the image URL
Element fullSizeImage = doc.select(".photo").first(); // Select the "photo" element from the page (there should only be 1) String imageName = doc.select("input[id=imageName]").attr("value"); // Select the "input" element from the page
// subdir is the sub dir the cdn has the image stored in return "https://www.8muses.com/image/fm/" + imageName;
String subdir = doc.select("input#imageDir").first().attr("value");
return "https://cdn.ampproject.org/i/s/www.8muses.com/" + subdir + "small/" + fullSizeImage.children().select("#imageName").attr("value");
} }
@Override @Override

View File

@ -47,9 +47,7 @@ public class BasicRippersTest extends RippersTest {
} }
public void testEightmusesAlbum() throws IOException { public void testEightmusesAlbum() throws IOException {
EightmusesRipper ripper = new EightmusesRipper(new URL("http://www.8muses.com/index/category/jab-hotassneighbor7")); EightmusesRipper ripper = new EightmusesRipper(new URL("https://www.8muses.com/album/jab-comics/a-model-life"));
testRipper(ripper);
ripper = new EightmusesRipper(new URL("https://www.8muses.com/album/jab-comics/a-model-life"));
testRipper(ripper); testRipper(ripper);
} }