Fixed tumblr ripper for tags that contain spaces

Closes #26
This commit is contained in:
4pr0n 2014-04-24 19:46:53 -07:00
parent 0f6b97c73b
commit 14976f3169

View File

@ -166,14 +166,14 @@ public class TumblrRipper extends AlbumRipper {
Pattern p;
Matcher m;
// Tagged URL
p = Pattern.compile("^https?://([a-zA-Z0-9\\-]{1,})\\.tumblr\\.com/tagged/([a-zA-Z0-9\\-]{1,}).*$");
p = Pattern.compile("^https?://([a-zA-Z0-9\\-]{1,})\\.tumblr\\.com/tagged/([a-zA-Z0-9\\-%]{1,}).*$");
m = p.matcher(url.toExternalForm());
if (m.matches()) {
this.albumType = ALBUM_TYPE.TAG;
this.subdomain = m.group(1);
this.tagName = m.group(2);
this.tagName = this.tagName.replace('-', '+').replace("_", "%20");
return this.subdomain + "_tag_" + this.tagName;
return this.subdomain + "_tag_" + this.tagName.replace("%20", " ");
}
// Post URL
p = Pattern.compile("^https?://([a-zA-Z0-9\\-]{1,})\\.tumblr\\.com/post/([0-9]{1,}).*$");