X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Frhynodge%2Fwatchers%2FPirateBayEpisodeWatcher.java;h=4fec73013cb0b5f675d59279c626902e2699d653;hb=c849f7f04df084252db87a2389f50f55d4b9a775;hp=23f95095a17d1ee525618a5e7731c5987a750211;hpb=e2bf089cdc5b6bafd31c45db6ce7f1bea62152e6;p=rhynodge.git diff --git a/src/main/java/net/pterodactylus/rhynodge/watchers/PirateBayEpisodeWatcher.java b/src/main/java/net/pterodactylus/rhynodge/watchers/PirateBayEpisodeWatcher.java index 23f9509..4fec730 100644 --- a/src/main/java/net/pterodactylus/rhynodge/watchers/PirateBayEpisodeWatcher.java +++ b/src/main/java/net/pterodactylus/rhynodge/watchers/PirateBayEpisodeWatcher.java @@ -29,7 +29,9 @@ import net.pterodactylus.rhynodge.Trigger; import net.pterodactylus.rhynodge.Watcher; import net.pterodactylus.rhynodge.filters.EpisodeFilter; import net.pterodactylus.rhynodge.filters.HtmlFilter; +import net.pterodactylus.rhynodge.filters.SizeBlacklistFilter; import net.pterodactylus.rhynodge.filters.torrents.PirateBayFilter; +import net.pterodactylus.rhynodge.queries.FallbackQuery; import net.pterodactylus.rhynodge.queries.HttpQuery; import net.pterodactylus.rhynodge.triggers.NewEpisodeTrigger; @@ -66,7 +68,10 @@ public class PirateBayEpisodeWatcher extends DefaultWatcher { private static Query createHttpQuery(String searchTerms, String proxyHost, int proxyPort) { try { - return new HttpQuery("http://uj3wazyk5u4hnvtk.onion/search/" + URLEncoder.encode(searchTerms, "UTF-8") + "/0/3/0", proxyHost, proxyPort); + HttpQuery hiddenServiceQuery = new HttpQuery("http://uj3wazyk5u4hnvtk.onion/search/" + URLEncoder.encode(searchTerms, "UTF-8") + "/0/3/0", proxyHost, proxyPort); + HttpQuery torQuery = new HttpQuery("http://thepiratebay.org/search/" + URLEncoder.encode(searchTerms, "UTF-8") + "/0/3/0", proxyHost, proxyPort); + HttpQuery plainInternetQuery = new HttpQuery("http://thepiratebay.org/search/" + URLEncoder.encode(searchTerms, "UTF-8") + "/0/3/0"); + return new FallbackQuery(hiddenServiceQuery, torQuery, plainInternetQuery); } catch (UnsupportedEncodingException uee1) { /* will not happen. */ return null; @@ -79,7 +84,7 @@ public class PirateBayEpisodeWatcher extends DefaultWatcher { * @return The filters of the watcher */ private static List createFilters() { - return ImmutableList.of(new HtmlFilter(), new PirateBayFilter(), createDefaultBlacklistFilter(), new EpisodeFilter()); + return ImmutableList.of(new HtmlFilter(), new PirateBayFilter(), createDefaultBlacklistFilter(), new SizeBlacklistFilter(), new EpisodeFilter()); } /**