Add support for getting uploader URL
This commit is contained in:
parent
b9d0941411
commit
6e42cb87e8
|
@ -33,6 +33,11 @@ public class SoundcloudStreamInfoItemExtractor implements StreamInfoItemExtracto
|
||||||
return searchResult.getObject("user").getString("username");
|
return searchResult.getObject("user").getString("username");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUploaderUrl() {
|
||||||
|
return searchResult.getObject("user").getString("permalink_url");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUploadDate() throws ParsingException {
|
public String getUploadDate() throws ParsingException {
|
||||||
return SoundcloudParsingHelper.toDateString(searchResult.getString("created_at"));
|
return SoundcloudParsingHelper.toDateString(searchResult.getString("created_at"));
|
||||||
|
|
|
@ -94,6 +94,17 @@ public class YoutubeStreamInfoItemExtractor implements StreamInfoItemExtractor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUploaderUrl() throws ParsingException {
|
||||||
|
try {
|
||||||
|
return item.select("div[class=\"yt-lockup-byline\"]").first()
|
||||||
|
.select("a").first()
|
||||||
|
.attr("href");
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new ParsingException("Could not get uploader", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUploadDate() throws ParsingException {
|
public String getUploadDate() throws ParsingException {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -31,6 +31,7 @@ public interface StreamInfoItemExtractor extends InfoItemExtractor {
|
||||||
long getViewCount() throws ParsingException;
|
long getViewCount() throws ParsingException;
|
||||||
|
|
||||||
String getUploaderName() throws ParsingException;
|
String getUploaderName() throws ParsingException;
|
||||||
|
String getUploaderUrl() throws ParsingException;
|
||||||
String getUploadDate() throws ParsingException;
|
String getUploadDate() throws ParsingException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue