Parse timestamps in description
This commit is contained in:
parent
8d503407ef
commit
a2d8489e16
|
@ -235,18 +235,18 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
|||
.getString("canonicalBaseUrl")).append("\">").append(text).append("</a>");
|
||||
htmlConversionRequired = true;
|
||||
} else if (textHolder.getObject("navigationEndpoint").getObject("watchEndpoint") != null) {
|
||||
descriptionBuilder.append("<a href=\"https://www.youtube.com/watch?v=").append(
|
||||
textHolder.getObject("navigationEndpoint").getObject("watchEndpoint")
|
||||
.getString("videoId"));
|
||||
if (textHolder.getObject("navigationEndpoint").getObject("watchEndpoint").getString("playlistId") != null) {
|
||||
descriptionBuilder.append("<a href=\"https://www.youtube.com/watch?v=").append(
|
||||
textHolder.getObject("navigationEndpoint").getObject("watchEndpoint")
|
||||
.getString("videoId")).append("&list=")
|
||||
.append(textHolder.getObject("navigationEndpoint")
|
||||
.getObject("watchEndpoint").getString("playlistId"))
|
||||
.append("\">").append(text).append("</a>");
|
||||
} else {
|
||||
descriptionBuilder.append("<a href=\"https://www.youtube.com/watch?v=").append(
|
||||
textHolder.getObject("navigationEndpoint").getObject("watchEndpoint")
|
||||
.getString("videoId")).append("\">").append(text).append("</a>");
|
||||
descriptionBuilder.append("&list=").append(textHolder.getObject("navigationEndpoint")
|
||||
.getObject("watchEndpoint").getString("playlistId"));
|
||||
}
|
||||
if (textHolder.getObject("navigationEndpoint").getObject("watchEndpoint").has("startTimeSeconds")) {
|
||||
descriptionBuilder.append("&t=").append(textHolder.getObject("navigationEndpoint")
|
||||
.getObject("watchEndpoint").getInt("startTimeSeconds"));
|
||||
}
|
||||
descriptionBuilder.append("\">").append(text).append("</a>");
|
||||
htmlConversionRequired = true;
|
||||
}
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue