Update AbstractHTMLRipper.java

This commit is contained in:
jisuyame 2015-10-15 22:40:44 +03:00
parent 94068436e8
commit 12b4c8b14b

View File

@ -15,11 +15,9 @@ import com.rarchives.ripme.utils.Utils;
/** /**
* Simplified ripper, designed for ripping from sites by parsing HTML. * Simplified ripper, designed for ripping from sites by parsing HTML.
*/ */
public abstract class AbstractHTMLRipper extends AlbumRipper { public abstract class AbstractHTMLRipper extends AlbumRipper {
public class Tamindirmp3 extends AbstractHTMLRipper {
public Tamindirmp3(URL url) throws IOException { public AbstractHTMLRipper(URL url) throws IOException {
super(url); super(url);
} }
@ -42,47 +40,6 @@ public class Tamindirmp3 extends AbstractHTMLRipper {
public boolean keepSortOrder() { public boolean keepSortOrder() {
return true; return true;
} }
@Override
public String getHost() {
return "Tamindirmp3";
}
@Override
public String getDomain() {
return "server28.tamdinle.com";
}
@Override
public String getGID(URL url) throws MalformedURLException {
Pattern p = Pattern.compile("^https?://server28.tamdinle\\.com/files/([files-zA-Z0-9]+).*$");
Matcher m = p.matcher(url.toExternalForm());
if (m.matches()) {
// Return the text contained between () in the regex
return m.group(1);
}
throw new MalformedURLException("Expected server28.tamindir.com URL format: " +
"server28.tamdinle.com/files/ - got " + url + " instead");
}
@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 el : doc.select("img")) {
result.add(el.attr("src"));
}
return result
}
@Override
public void downloadURL(URL url, int index) {
addURLToDownload(url, getPrefix(index));
}
@Override @Override
public boolean canRip(URL url) { public boolean canRip(URL url) {