Update VidbleRipper.java

This commit is contained in:
blth 2016-04-17 12:52:57 -06:00
parent 6fa72d6bf2
commit 2f7e5989a8

View File

@ -9,6 +9,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements; import org.jsoup.select.Elements;
import com.rarchives.ripme.ripper.AbstractHTMLRipper; import com.rarchives.ripme.ripper.AbstractHTMLRipper;
@ -56,17 +57,18 @@ public class VidbleRipper extends AbstractHTMLRipper {
private static List<String> getURLsFromPageStatic(Document doc) { private static List<String> getURLsFromPageStatic(Document doc) {
List<String> imageURLs = new ArrayList<String>(); List<String> imageURLs = new ArrayList<String>();
Elements els = doc.select("#ContentPlaceHolder1_thumbs"); Elements els = doc.select("#ContentPlaceHolder1_divContent");
String thumbs = els.first().attr("value"); Elements imgs = els.select("img");
for (String thumb : thumbs.split(",")) { for (Element img : imgs) {
if (thumb.trim().equals("") || thumb.contains("reddit.com")) { String src = img.absUrl("src");
continue; src = src.replaceAll("_[a-zA-Z]{3,5}", "");
if (!src.equals("")) {
imageURLs.add(src);
} }
thumb = thumb.replaceAll("_[a-zA-Z]{3,5}", "");
imageURLs.add("http://vidble.com/" + thumb);
} }
return imageURLs; return imageURLs;
} }
@Override @Override
public void downloadURL(URL url, int index) { public void downloadURL(URL url, int index) {