Skip to content

Commit

Permalink
Merge pull request #1366 from Isaaku/issues/38_add_new_chans_to_chanr…
Browse files Browse the repository at this point in the history
…ipper

New Chans to ChanRipper
  • Loading branch information
cyian-1756 committed Jul 19, 2019
2 parents be3f799 + 43ba4fa commit 958bef9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ public class ChanRipper extends AbstractHTMLRipper {
new ChanSite("boards.420chan.org"),
new ChanSite("7chan.org"),
new ChanSite("desuarchive.org", "desu-usergeneratedcontent.xyz"),
new ChanSite("8ch.net", "media.8ch.net")
new ChanSite("8ch.net", "media.8ch.net"),
new ChanSite("thebarchive.com"),
new ChanSite("archiveofsins.com"),
new ChanSite("archive.nyafuu.org"),
new ChanSite("rbt.asia")
);
private static List<ChanSite> user_give_explicit_domains = getChansFromConfig(Utils.getConfigString("chans.chan_sites", null));
private static List<ChanSite> explicit_domains = new ArrayList<>();
Expand Down Expand Up @@ -146,7 +150,7 @@ public String getGID(URL url) throws MalformedURLException {

String u = url.toExternalForm();
if (u.contains("/thread/") || u.contains("/res/") || u.contains("yuki.la") || u.contains("55chan.org")) {
p = Pattern.compile("^.*\\.[a-z]{1,3}/[a-zA-Z0-9]+/(thread|res)/([0-9]+)(\\.html|\\.php)?.*$");
p = Pattern.compile("^.*\\.[a-z]{1,4}/[a-zA-Z0-9]+/(thread|res)/([0-9]+)(\\.html|\\.php)?.*$");
m = p.matcher(u);
if (m.matches()) {
return m.group(2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public void testChanURLPasses() throws IOException {
passURLs.add(new URL("https://boards.4chan.org/hr/thread/3015701"));
passURLs.add(new URL("https://boards.420chan.org/420/res/232066.php"));
passURLs.add(new URL("http://7chan.org/gif/res/25873.html"));
passURLs.add(new URL("https://rbt.asia/g/thread/70643087/")); //must work with TLDs with len of 4
for (URL url : passURLs) {
ChanRipper ripper = new ChanRipper(url);
ripper.setup();
Expand Down

0 comments on commit 958bef9

Please sign in to comment.