mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-26 07:14:38 +02:00
Merge pull request #1147 from cyian-1756/imagefap-gid-fix
Imagefap gid fix
This commit is contained in:
@@ -145,16 +145,14 @@ public class ImagefapRipper extends AbstractHTMLRipper {
|
|||||||
try {
|
try {
|
||||||
// Attempt to use album title as GID
|
// Attempt to use album title as GID
|
||||||
String title = getFirstPage().title();
|
String title = getFirstPage().title();
|
||||||
Pattern p = Pattern.compile("^Porn pics of (.*) \\(Page 1\\)$");
|
title = title.replace("Porn Pics & Porn GIFs", "");
|
||||||
Matcher m = p.matcher(title);
|
title = title.replace(" ", "_");
|
||||||
if (m.matches()) {
|
String toReturn = getHost() + "_" + title + "_" + getGID(url);
|
||||||
return getHost() + "_" + m.group(1) + "_" + getGID(url);
|
return toReturn.replaceAll("__", "_");
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// Fall back to default album naming convention
|
|
||||||
}
|
|
||||||
return super.getAlbumTitle(url);
|
return super.getAlbumTitle(url);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private String getFullSizedImage(String pageURL) {
|
private String getFullSizedImage(String pageURL) {
|
||||||
try {
|
try {
|
||||||
|
@@ -24,4 +24,9 @@ public class ImagefapRipperTest extends RippersTest {
|
|||||||
testRipper(ripper);
|
testRipper(ripper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void testImagefapGetAlbumTitle() throws IOException {
|
||||||
|
URL url = new URL("https://www.imagefap.com/gallery.php?gid=7789753");
|
||||||
|
ImagefapRipper ripper = new ImagefapRipper(url);
|
||||||
|
assertEquals("imagefap_Red.Heels.Lover.In.Love_7789753", ripper.getAlbumTitle(url));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user