Skip to content

Commit 93ef73e

Browse files
committed
[YouTube] Return mqdefault thumbnails in feed
The hqdefault thumbnails, which are used by default, have black bars at the top and at the bottom, and are thus not optimal.
1 parent 884da40 commit 93ef73e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeFeedInfoItemExtractor.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ public String getUrl() {
9191

9292
@Override
9393
public String getThumbnailUrl() {
94-
return entryElement.getElementsByTag("media:thumbnail").first().attr("url");
94+
// The hqdefault thumbnail has some black bars at the top and at the bottom, while the
95+
// mqdefault doesn't, so return the mqdefault one. It should always exist, according to
96+
// https://stackoverflow.com/a/20542029/9481500.
97+
return entryElement.getElementsByTag("media:thumbnail").first().attr("url")
98+
.replace("hqdefault", "mqdefault");
9599
}
96100
}

0 commit comments

Comments
 (0)