Merge pull request #990 from cyian-1756/55chan

Added support for 55chan.org
This commit is contained in:
cyian-1756 2018-10-08 08:16:04 -05:00 committed by GitHub
commit c5e2e225a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,7 @@ public class ChanRipper extends AbstractHTMLRipper {
new ChanSite(Arrays.asList("boards.4chan.org"), Arrays.asList("4cdn.org", "is.4chan.org", "is2.4chan.org", "is3.4chan.org")), new ChanSite(Arrays.asList("boards.4chan.org"), Arrays.asList("4cdn.org", "is.4chan.org", "is2.4chan.org", "is3.4chan.org")),
new ChanSite(Arrays.asList("4archive.org"), Arrays.asList("imgur.com")), 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("archive.4plebs.org"), Arrays.asList("img.4plebs.org")),
new ChanSite(Arrays.asList("yuki.la")) new ChanSite(Arrays.asList("yuki.la"), Arrays.asList("55chan.org"))
); );
private static List<String> url_piece_blacklist = Arrays.asList( private static List<String> url_piece_blacklist = Arrays.asList(
@ -103,6 +103,9 @@ public class ChanRipper extends AbstractHTMLRipper {
if (url.toExternalForm().contains("8ch.net") && url.toExternalForm().contains("/res/")) { if (url.toExternalForm().contains("8ch.net") && url.toExternalForm().contains("/res/")) {
return true; return true;
} }
if (url.toExternalForm().contains("55chan.org") && url.toExternalForm().contains("/res/")) {
return true;
}
return false; return false;
} }
@ -121,7 +124,8 @@ public class ChanRipper extends AbstractHTMLRipper {
Matcher m; Matcher m;
String u = url.toExternalForm(); String u = url.toExternalForm();
if (u.contains("/thread/") || u.contains("/res/") || u.contains("yuki.la")) { if (u.contains("/thread/") || u.contains("/res/") || u.contains("yuki.la") || u.contains("55chan.org")) {
LOGGER.debug("U: " + u);
p = Pattern.compile("^.*\\.[a-z]{1,3}/[a-zA-Z0-9]+/(thread|res)/([0-9]+)(\\.html|\\.php)?.*$"); p = Pattern.compile("^.*\\.[a-z]{1,3}/[a-zA-Z0-9]+/(thread|res)/([0-9]+)(\\.html|\\.php)?.*$");
m = p.matcher(u); m = p.matcher(u);
if (m.matches()) { if (m.matches()) {
@ -147,6 +151,13 @@ public class ChanRipper extends AbstractHTMLRipper {
if (m.matches()) { if (m.matches()) {
return m.group(1); return m.group(1);
} }
//55chan.org
p = Pattern.compile("https?://55chan.org/[a-z0-9]+/(res|thread)/[0-9]+.html");
m = p.matcher(u);
if (m.matches()) {
return m.group(1);
}
} }
throw new MalformedURLException( throw new MalformedURLException(