Skip to content

Commit e3f053b

Browse files
committed
[YouTube] Extract shorts thumbnails from thumbnailViewModel
Fixes an issue, where shorts thumbnails where not extracted, as they're now contained within a `thumbnailViewModel`, instead of a simple `thumbnail` object. Closes: TeamNewPipe/NewPipe#12907
1 parent f01c4b8 commit e3f053b

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,14 @@ public String getUrl() throws ParsingException {
7878
@Nonnull
7979
@Override
8080
public List<Image> getThumbnails() throws ParsingException {
81-
return getImagesFromThumbnailsArray(shortsLockupViewModel.getObject("thumbnail")
81+
if (shortsLockupViewModel.has("thumbnail")) {
82+
return getImagesFromThumbnailsArray(shortsLockupViewModel.getObject("thumbnail");
83+
}
84+
85+
return getImagesFromThumbnailsArray(shortsLockupViewModel
86+
.getObject("thumbnailViewModel")
87+
.getObject("thumbnailViewModel")
88+
.getObject("image")
8289
.getArray("sources"));
8390
}
8491

0 commit comments

Comments
 (0)