Support for DrawChan.net
This commit is contained in:
parent
a90319a023
commit
39a9edd1fa
@ -87,6 +87,13 @@ public class ChanRipper extends AbstractHTMLRipper {
|
||||
if (m.matches()) {
|
||||
return m.group(2);
|
||||
}
|
||||
|
||||
// Drawchan is weird, has drawchan.net/dc/dw/res/####.html
|
||||
p = Pattern.compile("^.*\\.[a-z]{1,3}/[a-zA-Z0-9]+/[a-zA-Z0-9]+/res/([0-9]+)(\\.html|\\.php)?.*$");
|
||||
m = p.matcher(u);
|
||||
if (m.matches()) {
|
||||
return m.group(1);
|
||||
}
|
||||
}
|
||||
|
||||
throw new MalformedURLException(
|
||||
|
@ -34,6 +34,7 @@ public class ChanRipperTest extends RippersTest {
|
||||
passURLs.add(new URL("http://unichan2.org/b/res/518004.html"));
|
||||
passURLs.add(new URL("http://xchan.pw/porn/res/437.html"));
|
||||
passURLs.add(new URL("http://archive.moe/c/thread/2295132/"));
|
||||
passURLs.add(new URL("http://drawchan.net/dc/dw/res/114910.html"));
|
||||
for (URL url : passURLs) {
|
||||
ChanRipper ripper = new ChanRipper(url);
|
||||
ripper.setup();
|
||||
@ -50,6 +51,7 @@ public class ChanRipperTest extends RippersTest {
|
||||
contentURLs.add(new URL("http://desuchan.net/v/res/7034.html"));
|
||||
contentURLs.add(new URL("http://boards.420chan.org/ana/res/75984.php"));
|
||||
contentURLs.add(new URL("http://archive.4plebs.org/s4s/thread/3005257/"));
|
||||
contentURLs.add(new URL("http://drawchan.net/dc/dw/res/114910.html"));
|
||||
|
||||
// Most *chans have volatile threads & can't be trusted for integration testing.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user