mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-26 23:34:53 +02:00
Merge pull request #1198 from miguelperis/master
Now supports furaffinity scraps
This commit is contained in:
@@ -219,16 +219,21 @@ public class FuraffinityRipper extends AbstractHTMLRipper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGID(URL url) throws MalformedURLException {
|
public String getGID(URL url) throws MalformedURLException {
|
||||||
Pattern p = Pattern
|
// Gallery
|
||||||
.compile("^https?://www\\.furaffinity\\.net/gallery/([-_.0-9a-zA-Z]+).*$");
|
Pattern p = Pattern.compile("^https?://www\\.furaffinity\\.net/gallery/([-_.0-9a-zA-Z]+).*$");
|
||||||
Matcher m = p.matcher(url.toExternalForm());
|
Matcher m = p.matcher(url.toExternalForm());
|
||||||
if (m.matches()) {
|
if (m.matches()) {
|
||||||
return m.group(1);
|
return m.group(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new MalformedURLException("Expected furaffinity.net URL format: "
|
//Scraps
|
||||||
+ "www.furaffinity.net/gallery/username - got " + url
|
p = Pattern.compile("^https?://www\\.furaffinity\\.net/scraps/([-_.0-9a-zA-Z]+).*$");
|
||||||
+ " instead");
|
m = p.matcher(url.toExternalForm());
|
||||||
|
if (m.matches()) {
|
||||||
|
return m.group(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new MalformedURLException("Unable to find images in" + url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -6,11 +6,17 @@ import java.net.URL;
|
|||||||
import com.rarchives.ripme.ripper.rippers.FuraffinityRipper;
|
import com.rarchives.ripme.ripper.rippers.FuraffinityRipper;
|
||||||
|
|
||||||
public class FuraffinityRipperTest extends RippersTest {
|
public class FuraffinityRipperTest extends RippersTest {
|
||||||
|
|
||||||
public void testFuraffinityAlbum() throws IOException {
|
public void testFuraffinityAlbum() throws IOException {
|
||||||
FuraffinityRipper ripper = new FuraffinityRipper(new URL("https://www.furaffinity.net/gallery/spencerdragon/"));
|
FuraffinityRipper ripper = new FuraffinityRipper(new URL("https://www.furaffinity.net/gallery/spencerdragon/"));
|
||||||
testRipper(ripper);
|
testRipper(ripper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testFuraffinityScrap() throws IOException {
|
||||||
|
FuraffinityRipper ripper = new FuraffinityRipper(new URL("http://www.furaffinity.net/scraps/sssonic2/"));
|
||||||
|
testRipper(ripper);
|
||||||
|
}
|
||||||
|
|
||||||
public void testGetGID() throws IOException {
|
public void testGetGID() throws IOException {
|
||||||
URL url = new URL("https://www.furaffinity.net/gallery/mustardgas/");
|
URL url = new URL("https://www.furaffinity.net/gallery/mustardgas/");
|
||||||
FuraffinityRipper ripper = new FuraffinityRipper(url);
|
FuraffinityRipper ripper = new FuraffinityRipper(url);
|
||||||
|
Reference in New Issue
Block a user