1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-09-02 10:23:47 +02:00

Added support for the other likd url format

This commit is contained in:
cyian-1756
2018-12-04 20:48:13 -05:00
parent f81ddb8b3d
commit f01cd07496

View File

@@ -240,7 +240,6 @@ public class TumblrRipper extends AlbumRipper {
if (albumType == ALBUM_TYPE.LIKED) { if (albumType == ALBUM_TYPE.LIKED) {
posts = json.getJSONObject("response").getJSONArray("liked_posts"); posts = json.getJSONObject("response").getJSONArray("liked_posts");
} else { } else {
posts = json.getJSONObject("response").getJSONArray("posts"); posts = json.getJSONObject("response").getJSONArray("posts");
} }
@@ -380,6 +379,15 @@ public class TumblrRipper extends AlbumRipper {
return this.subdomain + "_liked"; return this.subdomain + "_liked";
} }
// Likes url different format
p = Pattern.compile("https://www.tumblr.com/liked/by/([a-z0-9_-]+)");
m = p.matcher(url.toExternalForm());
if (m.matches()) {
this.albumType = ALBUM_TYPE.LIKED;
this.subdomain = m.group(1);
return this.subdomain + "_liked";
}
throw new MalformedURLException("Expected format: http://subdomain[.tumblr.com][/tagged/tag|/post/postno]"); throw new MalformedURLException("Expected format: http://subdomain[.tumblr.com][/tagged/tag|/post/postno]");
} }