Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imagefap not saving titles #1093

Closed
oilydrinkwater opened this issue Dec 6, 2018 · 4 comments · Fixed by #1147
Closed

imagefap not saving titles #1093

oilydrinkwater opened this issue Dec 6, 2018 · 4 comments · Fixed by #1147

Comments

@oilydrinkwater
Copy link

  • Ripme version: v1.7.72
  • Java version: openjdk version 1.8.0_181
  • Operating system: Debian 9 Linux
  • Exact URL you were trying to rip when the problem occurred: https://www.imagefap.com/gallery.php?gid=7789753
  • Please include any additional information about how to reproduce the problem: Not saving the album title. Save album titles box is checked.

Expected Behavior imagefap_Red.Heels.Lover.In.Love_7789753

Detail the expected behavior here.

Actual Behavior imagefap_7789753

Detail the actual (incorrect) behavior here. You can post log snippets or attach log files to your issue report.

@basemann
Copy link

basemann commented Dec 25, 2018

This is because ImageFap changed their titles to their pages, which breaks the pattern matching used in ImagefapRipper.java

I was able to do the following:

diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/ImagefapRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/ImagefapRipper.java
index 07a6e529..700904bb 100644
--- a/src/main/java/com/rarchives/ripme/ripper/rippers/ImagefapRipper.java
+++ b/src/main/java/com/rarchives/ripme/ripper/rippers/ImagefapRipper.java
@@ -145,7 +145,7 @@ public class ImagefapRipper extends AbstractHTMLRipper {
         try {
             // Attempt to use album title as GID
             String title = getFirstPage().title();
-            Pattern p = Pattern.compile("^Porn pics of (.*) \\(Page 1\\)$");
+            Pattern p = Pattern.compile("(.*) Porn Pics \\& Porn GIFs$");
             Matcher m = p.matcher(title);
             if (m.matches()) {
                 return getHost() + "_" + m.group(1) + "_" + getGID(url);

When I attempted to download a new album, it would show the proper title within the folder name, but for some reason it would then always say I had already downloaded the album I was attempting to download (I hadn't). I'm not good enough with Java to debug it further, so hopefully someone else with more knowledge can chime in and provide a proper fix.

@basemann
Copy link

After digging into this more and comparing this ripper with other sites' rippers, I was able to fix it by changing things up with the below patch:

diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/ImagefapRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/ImagefapRipper.java
index 07a6e529..ae02b5ca 100644
--- a/src/main/java/com/rarchives/ripme/ripper/rippers/ImagefapRipper.java
+++ b/src/main/java/com/rarchives/ripme/ripper/rippers/ImagefapRipper.java
@@ -145,11 +145,9 @@ public class ImagefapRipper extends AbstractHTMLRipper {
         try {
             // Attempt to use album title as GID
             String title = getFirstPage().title();
-            Pattern p = Pattern.compile("^Porn pics of (.*) \\(Page 1\\)$");
-            Matcher m = p.matcher(title);
-            if (m.matches()) {
-                return getHost() + "_" + m.group(1) + "_" + getGID(url);
-            }
+            title = title.replace("Porn Pics & Porn GIFs", "");
+            title = title.replace(" ", "_");
+            return getHost() + "_" + title + "_" + getGID(url);
         } catch (IOException e) {
             // Fall back to default album naming convention
         }

@cyian-1756 cyian-1756 mentioned this issue Dec 31, 2018
12 tasks
@fernandezh1983
Copy link

Facing this issue as well. Has it been fixed?

@cyian-1756
Copy link
Collaborator

@fernandezh1983 The PR has been merged and the fix will be in the next update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants