- protected List<Entry<String, URL>> getChapters(Progress pg) throws IOException {
- List<Entry<String, URL>> chapters = new LinkedList<Entry<String, URL>>();
-
- if (isPool(getSource())) {
- String baseUrl = "https://e621.net/" + getSource().getPath() + "?page=";
- chapters = getChapters(getSource(), pg, baseUrl, "");
- } else if (isSearchOrSet(getSource())) {
- String baseUrl = "https://e621.net/posts/?page=";
- String search = "&tags=" + getTagsFromUrl(getSource());
-
- chapters = getChapters(getSource(), pg,
- baseUrl, search);
- }
-
- // sets and some pools are sorted in reverse order on the website
- if (getSource().getPath().startsWith("/posts")) {
- Collections.reverse(chapters);
- }
-
- return chapters;
- }
-
- private List<Entry<String, URL>> getChapters(URL source, Progress pg, String baseUrl, String parameters)