From 68ffc7f76094d7c5e91c9c22e52f5d337d769072 Mon Sep 17 00:00:00 2001 From: 4pr0n Date: Fri, 4 Apr 2014 00:38:40 -0700 Subject: [PATCH] Fixed gonewild ripper regex Triggered by URLs that resemble `gonewild:username` or `http://gonewild.com/username` --- .../com/rarchives/ripme/ripper/rippers/GonewildRipper.java | 2 +- src/main/java/com/rarchives/ripme/ui/MainWindow.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/GonewildRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/GonewildRipper.java index e3709442..aac913d2 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/GonewildRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/GonewildRipper.java @@ -34,7 +34,7 @@ public class GonewildRipper extends AbstractRipper { } private Matcher getUsernameMatcher(URL url) { - Pattern p = Pattern.compile("^https?://[a-z]{0,3}\\.?gonewild\\.com/(u|user)/([a-zA-Z0-9\\-]{3,})/?.*$"); + Pattern p = Pattern.compile("^.*gonewild(\\.com?/|:)(user/)?([a-zA-Z0-9\\-_]{3,})[/?]?.*$"); return p.matcher(url.toExternalForm()); } diff --git a/src/main/java/com/rarchives/ripme/ui/MainWindow.java b/src/main/java/com/rarchives/ripme/ui/MainWindow.java index 75918378..934033b2 100644 --- a/src/main/java/com/rarchives/ripme/ui/MainWindow.java +++ b/src/main/java/com/rarchives/ripme/ui/MainWindow.java @@ -332,6 +332,12 @@ public class MainWindow implements Runnable, RipStatusHandler { } private Thread ripAlbum(String urlString) { + if (urlString.toLowerCase().startsWith("gonewild:")) { + urlString = "http://gonewild.com/user/" + urlString.substring(urlString.indexOf(':') + 1); + } + if (!urlString.startsWith("http")) { + urlString = "http://" + urlString; + } URL url = null; try { url = new URL(urlString);