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>");
|
.getString("canonicalBaseUrl")).append("\">").append(text).append("</a>");
|
||||||
htmlConversionRequired = true;
|
htmlConversionRequired = true;
|
||||||
} else if (textHolder.getObject("navigationEndpoint").getObject("watchEndpoint") != null) {
|
} 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) {
|
if (textHolder.getObject("navigationEndpoint").getObject("watchEndpoint").getString("playlistId") != null) {
|
||||||
descriptionBuilder.append("<a href=\"https://www.youtube.com/watch?v=").append(
|
descriptionBuilder.append("&list=").append(textHolder.getObject("navigationEndpoint")
|
||||||
textHolder.getObject("navigationEndpoint").getObject("watchEndpoint")
|
.getObject("watchEndpoint").getString("playlistId"));
|
||||||
.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>");
|
|
||||||
}
|
}
|
||||||
|
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;
|
htmlConversionRequired = true;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue