jagodibuja: fixed formatting
This commit is contained in:
parent
f089e804fd
commit
dbb926824a
@ -19,64 +19,62 @@ import com.rarchives.ripme.utils.Http;
|
||||
public class JagodibujaRipper extends AbstractHTMLRipper {
|
||||
|
||||
public JagodibujaRipper(URL url) throws IOException {
|
||||
super(url);
|
||||
super(url);
|
||||
}
|
||||
@Override
|
||||
public String getHost() {
|
||||
return "jagodibuja";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDomain() {
|
||||
return "jagodibuja.com";
|
||||
}
|
||||
@Override
|
||||
public String getHost() {
|
||||
return "jagodibuja";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGID(URL url) throws MalformedURLException {
|
||||
Pattern p = Pattern.compile("^https?://www.jagodibuja.com/([a-zA-Z0-9_-]*)/?");
|
||||
Matcher m = p.matcher(url.toExternalForm());
|
||||
if (m.matches()) {
|
||||
return m.group(1);
|
||||
}
|
||||
throw new MalformedURLException("Expected jagodibuja.com gallery formats hwww.jagodibuja.com/Comic name/ got " + url + " instead");
|
||||
}
|
||||
@Override
|
||||
public String getDomain() {
|
||||
return "jagodibuja.com";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Document getFirstPage() throws IOException {
|
||||
// "url" is an instance field of the superclass
|
||||
return Http.url(url).get();
|
||||
@Override
|
||||
public String getGID(URL url) throws MalformedURLException {
|
||||
Pattern p = Pattern.compile("^https?://www.jagodibuja.com/([a-zA-Z0-9_-]*)/?");
|
||||
Matcher m = p.matcher(url.toExternalForm());
|
||||
if (m.matches()) {
|
||||
return m.group(1);
|
||||
}
|
||||
throw new MalformedURLException("Expected jagodibuja.com gallery formats hwww.jagodibuja.com/Comic name/ got " + url + " instead");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getURLsFromPage(Document doc) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
for (Element comicPageUrl : doc.select("div.gallery-icon > a")) {
|
||||
@Override
|
||||
public Document getFirstPage() throws IOException {
|
||||
// "url" is an instance field of the superclass
|
||||
return Http.url(url).get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getURLsFromPage(Document doc) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
for (Element comicPageUrl : doc.select("div.gallery-icon > a")) {
|
||||
try {
|
||||
sleep(500);
|
||||
Document comicPage = Http.url(comicPageUrl.attr("href")).get();
|
||||
Element elem = comicPage.select("span.full-size-link > a").first();
|
||||
logger.info("Got link " + elem.attr("href"));
|
||||
try {
|
||||
sleep(500);
|
||||
Document comicPage = Http.url(comicPageUrl.attr("href")).get();
|
||||
Element elem = comicPage.select("span.full-size-link > a").first();
|
||||
logger.info("Got link " + elem.attr("href"));
|
||||
try {
|
||||
addURLToDownload(new URL(elem.attr("href")), "");
|
||||
}
|
||||
catch(MalformedURLException e) {
|
||||
logger.warn("Malformed URL");
|
||||
e.printStackTrace();
|
||||
}
|
||||
result.add(elem.attr("href"));
|
||||
}
|
||||
catch(IOException e) {
|
||||
logger.info("Error loading " + comicPageUrl);
|
||||
addURLToDownload(new URL(elem.attr("href")), "");
|
||||
} catch (MalformedURLException e) {
|
||||
logger.warn("Malformed URL");
|
||||
e.printStackTrace();
|
||||
}
|
||||
result.add(elem.attr("href"));
|
||||
} catch (IOException e) {
|
||||
logger.info("Error loading " + comicPageUrl);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadURL(URL url, int index) {
|
||||
// sleep(500);
|
||||
// addURLToDownload(url, getPrefix(index));
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadURL(URL url, int index) {
|
||||
// sleep(500);
|
||||
// addURLToDownload(url, getPrefix(index));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user