mirror of
https://github.com/TeamNewPipe/NewPipeExtractor
synced 2025-09-02 07:15:37 +00:00
Parse timestamps in description
This commit is contained in:
@@ -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;
|
||||||
|
Reference in New Issue
Block a user