mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2024-12-14 22:30:33 +05:30
[StreamExtractor] Add fallback method for uploader avatar url
This commit is contained in:
parent
3ec422a542
commit
12166ca60c
@ -479,8 +479,17 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
||||
.getObject("secondaryResults").getArray("results").getObject(0).getObject("compactAutoplayRenderer")
|
||||
.getArray("contents").getObject(0).getObject("compactVideoRenderer").getObject("channelThumbnail")
|
||||
.getArray("thumbnails").getObject(0).getString("url");
|
||||
if (uploaderAvatarUrl != null && !uploaderAvatarUrl.isEmpty()) {
|
||||
return uploaderAvatarUrl;
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
|
||||
} catch (Exception e) {//todo: add fallback method
|
||||
try {
|
||||
uploaderAvatarUrl = ytInitialData.getObject("contents").getObject("twoColumnWatchNextResults").getObject("results")
|
||||
.getObject("results").getArray("contents").getObject(1).getObject("videoSecondaryInfoRenderer")
|
||||
.getObject("owner").getObject("videoOwnerRenderer").getObject("thumbnail").getArray("thumbnails")
|
||||
.getObject(0).getString("url");
|
||||
} catch (Exception e) {
|
||||
throw new ParsingException("Could not get uploader avatar url", e);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user