I wanted to ask if there is a java code to directly extract a embedded video from a streaming site.
With some research I managed to find this solution: How to get direct link of remote video from embedded url within a url in Android using JSoup?
but in this solution there are errors in code, for example:
String url = "https://www.wunderground.com/webcams/cadot1/902/video.html";
int timeout = 100 * 1000;
// Extract video URL
Document doc = Jsoup.connect(url).timeout(timeout).get();
Element script = doc.getElementById("inner-content")
.getElementsByTag("script").last();
String content = script.data();
int indexOfUrl = content.indexOf("url");
int indexOfComma = content.indexOf(',', indexOfUrl);
String videoUrl = "https:" + content.substring(indexOfUrl + 6, indexOfComma
- 1);
System.out.println(videoUrl);
I cant get last element:
.getElementsByTag("script").last();
There is a tutorial or something that explain how to get embedded video url?
For expample this is the urlvideo: https://openload.co/embed/MB6RMqNrvp0/Episodio_017.mkv.mp4
and this is the embeddedvideourl: https://1fiag5y.oloadcdn.net/dl/l/9pL6teltc-w0jPxJ/MB6RMqNrvp0/Episodio_017.mkv.mp4?mime=true //I need this
Tnks.