Supporte old style of imgur account albums
http://username.imgur.com/album_title Closes #31
This commit is contained in:
parent
535efb4d88
commit
a50198c924
@ -357,13 +357,6 @@ public class ImgurRipper extends AlbumRipper {
|
||||
albumType = ALBUM_TYPE.USER;
|
||||
return gid;
|
||||
}
|
||||
p = Pattern.compile("^https?://([a-zA-Z0-9\\-]{3,})\\.imgur\\.com/?$");
|
||||
m = p.matcher(url.toExternalForm());
|
||||
if (m.matches()) {
|
||||
// Imgur account album
|
||||
albumType = ALBUM_TYPE.USER_ALBUM;
|
||||
return m.group();
|
||||
}
|
||||
p = Pattern.compile("^https?://([a-zA-Z0-9\\-]{3,})\\.imgur\\.com/all.*$");
|
||||
m = p.matcher(url.toExternalForm());
|
||||
if (m.matches()) {
|
||||
@ -371,6 +364,13 @@ public class ImgurRipper extends AlbumRipper {
|
||||
albumType = ALBUM_TYPE.USER_IMAGES;
|
||||
return m.group(1) + "_images";
|
||||
}
|
||||
p = Pattern.compile("^https?://([a-zA-Z0-9\\-]{3,})\\.imgur\\.com/([a-zA-Z0-9\\-_]+).*$");
|
||||
m = p.matcher(url.toExternalForm());
|
||||
if (m.matches()) {
|
||||
// Imgur account album
|
||||
albumType = ALBUM_TYPE.USER_ALBUM;
|
||||
return m.group(1) + "-" + m.group(2);
|
||||
}
|
||||
p = Pattern.compile("^https?://(www\\.)?imgur\\.com/r/([a-zA-Z0-9\\-_]{3,})(/top|/new)?(/all|/year|/month|/week)?/?$");
|
||||
m = p.matcher(url.toExternalForm());
|
||||
if (m.matches()) {
|
||||
@ -395,7 +395,7 @@ public class ImgurRipper extends AlbumRipper {
|
||||
}
|
||||
return gid.replaceAll(",", "-");
|
||||
}
|
||||
throw new MalformedURLException("Unexpected URL format: " + url.toExternalForm());
|
||||
throw new MalformedURLException("Unsupported imgur URL format: " + url.toExternalForm());
|
||||
}
|
||||
|
||||
public ALBUM_TYPE getAlbumType() {
|
||||
|
Loading…
Reference in New Issue
Block a user