Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lavaplayer fails to play Vimeo tracks due to empty "progressive" array, causing NPE #62

Closed
freyacodes opened this issue Jan 2, 2024 · 2 comments · Fixed by #63
Closed

Comments

@freyacodes
Copy link
Member

Upon playing a Vimeo track, Lavaplayer downloads a track config from which it extracts request.files.progressive[0].url. However, on some tracks the progressive array is null, resulting in a NullPointerException. It appears that we need to add support for hls or dash.

image

Example url: https://vimeo.com/783006175

Track config url: https://player.vimeo.com/video/783006175/config?autopause=1&byline=0&collections=1&context=Vimeo%5CController%5CClipController.main&default_to_hd=1&h=250a7cefe0&outro=nothing&portrait=0&share=1&speed=1&title=0&watch_trailer=0&s=6ae0e5726574100d746264e851da4ccf6e8bd963_1704285204

Source:

private String loadPlaybackUrl(HttpInterface httpInterface) throws IOException {
JsonBrowser config = loadPlayerConfig(httpInterface);
if (config == null) {
throw new FriendlyException("Track information not present on the page.", SUSPICIOUS, null);
}
String trackConfigUrl = config.get("player").get("config_url").text();
JsonBrowser trackConfig = loadTrackConfig(httpInterface, trackConfigUrl);
return trackConfig.get("request").get("files").get("progressive").index(0).get("url").text();
}

@duncte123
Copy link
Contributor

Looks like there are multiple CDNs as well, this is something to keep in mind when retrying to load the stream if one of them fails

@freyacodes
Copy link
Member Author

Although I do not plan on any elaborate CDN fallback, I have been able to get HLS working. I will be submitting a PR later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants