parent
8f72815e59
commit
bdf8952f79
@ -49,7 +49,7 @@ public class ChanRipper extends AbstractHTMLRipper {
|
||||
|
||||
String u = url.toExternalForm();
|
||||
if (u.contains("/res/")) {
|
||||
p = Pattern.compile("^.*(chan|anon-ib).*\\.[a-z]{2,3}/[a-zA-Z0-9]+/res/([0-9]+)(\\.html|\\.php)?.*$");
|
||||
p = Pattern.compile("^.*(chan|anon-ib).*\\.[a-z]{2,3}/[a-zA-Z0-9/]+/res/([0-9]+)(\\.html|\\.php)?.*$");
|
||||
m = p.matcher(u);
|
||||
if (m.matches()) {
|
||||
return m.group(2);
|
||||
|
@ -167,7 +167,11 @@ public class RedditRipper extends AlbumRipper {
|
||||
Pattern p = RipUtils.getURLRegex();
|
||||
Matcher m = p.matcher(body);
|
||||
while (m.find()) {
|
||||
handleURL(m.group(1), id);
|
||||
String url = m.group(1);
|
||||
while (url.endsWith(")")) {
|
||||
url = url.substring(0, url.length() - 1);
|
||||
}
|
||||
handleURL(url, id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,7 @@ public class RipUtils {
|
||||
public static List<URL> getFilesFromURL(URL url) {
|
||||
List<URL> result = new ArrayList<URL>();
|
||||
|
||||
logger.debug("Checking " + url);
|
||||
// Imgur album
|
||||
if ((url.getHost().endsWith("imgur.com"))
|
||||
&& url.toExternalForm().contains("imgur.com/a/")) {
|
||||
@ -60,7 +61,7 @@ public class RipUtils {
|
||||
}
|
||||
|
||||
// Direct link to image
|
||||
Pattern p = Pattern.compile("(https?://[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(/\\S*)\\.(jpg|jpeg|gif|png|mp4))");
|
||||
Pattern p = Pattern.compile("(https?://[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(/\\S*)\\.(jpg|jpeg|gif|png|mp4)(\\?.*)?)");
|
||||
Matcher m = p.matcher(url.toExternalForm());
|
||||
if (m.matches()) {
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user