Fix video titles consisting of multiple parts due to @
This commit is contained in:
parent
951ed9f0d8
commit
8aa560bef4
1 changed files with 6 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue