diff --git a/pom.xml b/pom.xml index 3a435565..f30312c3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rarchives.ripme ripme jar - 1.1.8 + 1.1.9 ripme http://rip.rarchives.com diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/ImgurRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/ImgurRipper.java index 0e963422..bfe37b3f 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/ImgurRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/ImgurRipper.java @@ -167,14 +167,14 @@ public class ImgurRipper extends AlbumRipper { .get(); // Try to use embedded JSON to retrieve images - Pattern p = Pattern.compile("^.*Imgur\\.Album\\.getInstance\\((.*)\\);.*$", Pattern.DOTALL); + Pattern p = Pattern.compile("^.*Imgur\\.Album\\.getInstance\\((.*?)\\);.*$", Pattern.DOTALL); Matcher m = p.matcher(doc.body().html()); if (m.matches()) { try { JSONObject json = new JSONObject(m.group(1)); JSONObject jsonAlbum = json.getJSONObject("album"); ImgurAlbum imgurAlbum = new ImgurAlbum(url, jsonAlbum.getString("title_clean")); - JSONArray images = json.getJSONObject("images").getJSONArray("items"); + JSONArray images = json.getJSONObject("images").getJSONArray("images"); int imagesLength = images.length(); for (int i = 0; i < imagesLength; i++) { JSONObject image = images.getJSONObject(i); @@ -193,19 +193,20 @@ public class ImgurRipper extends AlbumRipper { logger.debug("Error while parsing JSON at " + url + ", continuing", e); } } - p = Pattern.compile("^.*= new ImgurShare\\((.*)\\);.*$", Pattern.DOTALL); + p = Pattern.compile("^.*widgetFactory.mergeConfig\\('gallery', (.*?)\\);.*$", Pattern.DOTALL); m = p.matcher(doc.body().html()); if (m.matches()) { try { ImgurAlbum imgurAlbum = new ImgurAlbum(url); JSONObject json = new JSONObject(m.group(1)); - JSONArray images = json.getJSONArray("hashes"); + JSONArray images = json.getJSONObject("image") + .getJSONObject("album_images") + .getJSONArray("images"); int imagesLength = images.length(); for (int i = 0; i < imagesLength; i++) { JSONObject image = images.getJSONObject(i); URL imageURL = new URL( - "http:" + json.getString("cdnUrl") - + "/" + "http://i.imgur.com/" + image.getString("hash") + image.getString("ext")); ImgurImage imgurImage = new ImgurImage(imageURL); diff --git a/src/main/java/com/rarchives/ripme/ui/UpdateUtils.java b/src/main/java/com/rarchives/ripme/ui/UpdateUtils.java index b689e0d7..31ffa3e3 100644 --- a/src/main/java/com/rarchives/ripme/ui/UpdateUtils.java +++ b/src/main/java/com/rarchives/ripme/ui/UpdateUtils.java @@ -21,7 +21,7 @@ import com.rarchives.ripme.utils.Utils; public class UpdateUtils { private static final Logger logger = Logger.getLogger(UpdateUtils.class); - private static final String DEFAULT_VERSION = "1.1.8"; + private static final String DEFAULT_VERSION = "1.1.9"; private static final String updateJsonURL = "http://rarchives.com/ripme.json"; private static final String updateJarURL = "http://rarchives.com/ripme.jar"; private static final String mainFileName = "ripme.jar"; diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ImgurRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ImgurRipperTest.java index 7f9f9318..0f15cc1b 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ImgurRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ImgurRipperTest.java @@ -33,7 +33,6 @@ public class ImgurRipperTest extends RippersTest { public void testImgurAlbums() throws IOException { List contentURLs = new ArrayList(); // URLs that should return more than 1 image - contentURLs.add(new URL("http://imgur.com/a/hqJIu")); // Vertical layout contentURLs.add(new URL("http://imgur.com/a/dS9OQ#0")); // Horizontal layout contentURLs.add(new URL("http://imgur.com/a/YpsW9#0")); // Grid layout contentURLs.add(new URL("http://imgur.com/a/WxG6f/layout/vertical#0")); diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/InstagramRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/InstagramRipperTest.java index 1f4a9e44..984bc29f 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/InstagramRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/InstagramRipperTest.java @@ -27,7 +27,7 @@ public class InstagramRipperTest extends RippersTest { public void testInstagramAlbums() throws IOException { List contentURLs = new ArrayList(); - contentURLs.add(new URL("http://instagram.com/tayloralesia/")); + contentURLs.add(new URL("http://instagram.com/anacheri")); for (URL url : contentURLs) { InstagramRipper ripper = new InstagramRipper(url); testRipper(ripper);