File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -845,6 +845,14 @@ public static String[] getYoutubeMusicKey()
845845 @ Nullable
846846 public static String getUrlFromNavigationEndpoint (@ Nonnull final JsonObject navigationEndpoint )
847847 throws ParsingException {
848+ if (navigationEndpoint .has ("webCommandMetadata" )) {
849+ // this case needs to be handled before the browseEndpoint,
850+ // e.g. for hashtags in comments
851+ final JsonObject metadata = navigationEndpoint .getObject ("webCommandMetadata" );
852+ if (metadata .has ("url" )) {
853+ return "https://www.youtube.com" + metadata .getString ("url" );
854+ }
855+ }
848856 if (navigationEndpoint .has ("urlEndpoint" )) {
849857 String internUrl = navigationEndpoint .getObject ("urlEndpoint" ).getString ("url" );
850858 if (internUrl .startsWith ("https://www.youtube.com/redirect?" )) {
You can’t perform that action at this time.
0 commit comments