Merge pull request #927 from Stypox/fix-feed-thumbnail

[YouTube] Return mqdefault thumbnails in fast feed
This commit is contained in:
Stypox 2022-09-19 08:52:01 +02:00 committed by GitHub
commit a99af9bb6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -91,6 +91,10 @@ public class YoutubeFeedInfoItemExtractor implements StreamInfoItemExtractor {
@Override
public String getThumbnailUrl() {
return entryElement.getElementsByTag("media:thumbnail").first().attr("url");
// The hqdefault thumbnail has some black bars at the top and at the bottom, while the
// mqdefault doesn't, so return the mqdefault one. It should always exist, according to
// https://stackoverflow.com/a/20542029/9481500.
return entryElement.getElementsByTag("media:thumbnail").first().attr("url")
.replace("hqdefault", "mqdefault");
}
}