Added yuki.la to chan ripper

This commit is contained in:
cyian-1756 2018-10-03 17:55:10 -04:00
parent 7e890bce2f
commit 587f95b5ee

View File

@ -19,7 +19,8 @@ public class ChanRipper extends AbstractHTMLRipper {
private static List<ChanSite> explicit_domains = Arrays.asList( private static List<ChanSite> explicit_domains = Arrays.asList(
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"))
); );
private static List<String> url_piece_blacklist = Arrays.asList( private static List<String> url_piece_blacklist = Arrays.asList(
@ -120,7 +121,7 @@ public class ChanRipper extends AbstractHTMLRipper {
Matcher m; Matcher m;
String u = url.toExternalForm(); String u = url.toExternalForm();
if (u.contains("/thread/") || u.contains("/res/")) { if (u.contains("/thread/") || u.contains("/res/") || u.contains("yuki.la")) {
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()) {
@ -139,6 +140,13 @@ public class ChanRipper extends AbstractHTMLRipper {
if (m.matches()) { if (m.matches()) {
return m.group(1); return m.group(1);
} }
// yuki.la
p = Pattern.compile("https?://yuki.la/[a-zA-Z0-9]+/([0-9]+)");
m = p.matcher(u);
if (m.matches()) {
return m.group(1);
}
} }
throw new MalformedURLException( throw new MalformedURLException(