I want to get the actual Video File Url from an embedded video on any website. It essentially is not YouTube. It can be any website. I am coding for android on Java.
For Example : The thing I want to do is same as this IDM button does :
[Actually not the same because the button there captures a network stream when it gets started by the player. But I want to get the file straight from the player.] Is there a way to attain this? Can Any external Library [e.g. Jsoup] do this?
I am already using Jsoup to get some other contents of the page but I have no idea how to do this.
If your using jsoup you can get the url quite easily. Just use jsoup to select all the possible video tags (<iframe>
, <videos>
, <embed>
, etc). Then get the src
attribute and store that where you want it:
Example
//Standard Jsoup search
Elements iframes = body.select("iframe");
/*Gets the src of all the iframes or other tag, and if you have
multiple videos you might have to do this in a for loop.*/
String videoURL = iframes.attr("src");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With