From ffb26c2fe0c4dde71380e858b7fbe183cde9cdae Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Fri, 10 Nov 2017 09:29:26 -0500 Subject: [PATCH] Chan ripper now falls back on page title if thread title can not be found --- .../com/rarchives/ripme/ripper/rippers/ChanRipper.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/ChanRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/ChanRipper.java index ba5cdad8..10af79b8 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/ChanRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/ChanRipper.java @@ -20,10 +20,8 @@ import com.rarchives.ripme.utils.RipUtils; public class ChanRipper extends AbstractHTMLRipper { private static List explicit_domains = Arrays.asList( new ChanSite(Arrays.asList("boards.4chan.org"), Arrays.asList("4cdn.org", "is.4chan.org", "is2.4chan.org")), - new ChanSite(Arrays.asList("archive.moe"), Arrays.asList("data.archive.moe")), new ChanSite(Arrays.asList("4archive.org"), Arrays.asList("imgur.com")), - new ChanSite(Arrays.asList("archive.4plebs.org"), Arrays.asList("img.4plebs.org")), - new ChanSite(Arrays.asList("fgts.jp"), Arrays.asList("dat.fgtsi.org")) + new ChanSite(Arrays.asList("archive.4plebs.org"), Arrays.asList("img.4plebs.org")) ); private static List url_piece_blacklist = Arrays.asList( @@ -67,6 +65,10 @@ public class ChanRipper extends AbstractHTMLRipper { // Attempt to use album title as GID Document doc = getFirstPage(); String subject = doc.select(".post.op > .postinfo > .subject").first().text(); + if (subject != null) { + return getHost() + "_" + getGID(url) + "_" + subject; + } + subject = doc.select("title").text(); return getHost() + "_" + getGID(url) + "_" + subject; } catch (Exception e) { // Fall back to default album naming convention