Fix video titles consisting of multiple parts due to @

This commit is contained in:
wb9688 2020-02-27 09:42:22 +01:00
parent 951ed9f0d8
commit 8aa560bef4
1 changed files with 6 additions and 1 deletions

View File

@ -114,7 +114,12 @@ public class YoutubeStreamExtractor extends StreamExtractor {
assertPageFetched();
String title = null;
try {
title = getVideoPrimaryInfoRenderer().getObject("title").getArray("runs").getObject(0).getString("text");
StringBuilder titleBuilder = new StringBuilder();
JsonArray titleArray = getVideoPrimaryInfoRenderer().getObject("title").getArray("runs");
for (Object titlePart : titleArray) {
titleBuilder.append(((JsonObject) titlePart).getString("text"));
}
title = titleBuilder.toString();
} catch (Exception ignored) {}
if (title == null) {
try {