From 7ee18bea79bb3d96ecb75bdd4f75c5d50a816019 Mon Sep 17 00:00:00 2001 From: metaprime Date: Tue, 21 Nov 2017 04:07:47 -0800 Subject: [PATCH] Remove ButttoucherRipper (butttoucher.com is permanently down) --- .../ripper/rippers/ButttoucherRipper.java | 70 ------------------- .../com/rarchives/ripme/utils/RipUtils.java | 1 - 2 files changed, 71 deletions(-) delete mode 100644 src/main/java/com/rarchives/ripme/ripper/rippers/ButttoucherRipper.java diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/ButttoucherRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/ButttoucherRipper.java deleted file mode 100644 index 77a25902..00000000 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/ButttoucherRipper.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.rarchives.ripme.ripper.rippers; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.jsoup.nodes.Document; -import org.jsoup.nodes.Element; - -import com.rarchives.ripme.ripper.AbstractHTMLRipper; -import com.rarchives.ripme.utils.Http; - -public class ButttoucherRipper extends AbstractHTMLRipper { - - public ButttoucherRipper(URL url) throws IOException { - super(url); - } - - @Override - public String getHost() { - return "butttoucher"; - } - @Override - public String getDomain() { - return "butttoucher.com"; - } - - @Override - public String getGID(URL url) throws MalformedURLException { - Pattern p; Matcher m; - - p = Pattern.compile("^.*butttoucher.com/users/([a-zA-Z0-9_\\-]+).*$"); - m = p.matcher(url.toExternalForm()); - if (m.matches()) { - return m.group(1); - } - throw new MalformedURLException( - "Expected butttoucher.com gallery format: " - + "butttoucher.com/users/" - + " Got: " + url); - } - - @Override - public Document getFirstPage() throws IOException { - return Http.url(this.url).get(); - } - - @Override - public List getURLsFromPage(Document page) { - List thumbs = new ArrayList<>(); - for (Element thumb : page.select(".thumb img")) { - if (!thumb.hasAttr("src")) { - continue; - } - String smallImage = thumb.attr("src"); - thumbs.add(smallImage.replace("m.", ".")); - } - return thumbs; - } - - @Override - public void downloadURL(URL url, int index) { - addURLToDownload(url, getPrefix(index)); - } - -} \ No newline at end of file diff --git a/src/main/java/com/rarchives/ripme/utils/RipUtils.java b/src/main/java/com/rarchives/ripme/utils/RipUtils.java index 6f3835aa..2788b0bc 100644 --- a/src/main/java/com/rarchives/ripme/utils/RipUtils.java +++ b/src/main/java/com/rarchives/ripme/utils/RipUtils.java @@ -155,7 +155,6 @@ public class RipUtils { if (url == null) url = urlFromDeviantartDirectoryName(dir); if (url == null) url = urlFromRedditDirectoryName(dir); if (url == null) url = urlFromSiteDirectoryName(dir, "bfcakes", "http://www.bcfakes.com/celebritylist/", ""); - if (url == null) url = urlFromSiteDirectoryName(dir, "butttoucher", "http://butttoucher.com/users/", ""); if (url == null) url = urlFromSiteDirectoryName(dir, "cheeby", "http://cheeby.com/u/", ""); if (url == null) url = urlFromSiteDirectoryName(dir, "datwin", "http://datw.in/", ""); if (url == null) url = urlFromSiteDirectoryName(dir, "drawcrowd", "http://drawcrowd.com/", "");