mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2024-12-13 22:00:32 +05:30
Merge branch 'channel-url' of https://github.com/wb9688/NewPipeExtractor into up
This commit is contained in:
commit
3c9c5c1004
@ -33,6 +33,11 @@ public class SoundcloudStreamInfoItemExtractor implements StreamInfoItemExtracto
|
||||
return searchResult.getObject("user").getString("username");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUploaderUrl() {
|
||||
return searchResult.getObject("user").getString("permalink_url");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUploadDate() throws ParsingException {
|
||||
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
|
||||
public String getUploadDate() throws ParsingException {
|
||||
try {
|
||||
|
@ -33,7 +33,17 @@ public class StreamInfoItem extends InfoItem {
|
||||
public long view_count = -1;
|
||||
public long duration = -1;
|
||||
|
||||
private String uploaderUrl = null;
|
||||
|
||||
public StreamInfoItem() {
|
||||
super(InfoType.STREAM);
|
||||
}
|
||||
|
||||
public void setUploaderUrl(String uploaderUrl) {
|
||||
this.uploaderUrl = uploaderUrl;
|
||||
}
|
||||
|
||||
public String getUploaderUrl() {
|
||||
return uploaderUrl;
|
||||
}
|
||||
}
|
@ -72,6 +72,11 @@ public class StreamInfoItemCollector extends InfoItemCollector {
|
||||
} catch (Exception e) {
|
||||
addError(e);
|
||||
}
|
||||
try {
|
||||
resultItem.setUploaderUrl(extractor.getUploaderUrl());
|
||||
} catch (Exception e) {
|
||||
addError(e);
|
||||
}
|
||||
return resultItem;
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@ public interface StreamInfoItemExtractor extends InfoItemExtractor {
|
||||
long getViewCount() throws ParsingException;
|
||||
|
||||
String getUploaderName() throws ParsingException;
|
||||
String getUploaderUrl() throws ParsingException;
|
||||
String getUploadDate() throws ParsingException;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user