Answer the question
In order to leave comments, you need to log in
How to download videos from facebook?
There is an application that downloads videos from facebook. Video downloads only from such links
https://www.facebook.com/serpro/videos/000000000000000/
https://fb.watch/9wKMFjmS0g/
class CallGetFbData extends AsyncTask<String, Void, Document>{
Document fbDoc;
@Override
protected Document doInBackground(String... strings) {
try {
fbDoc = Jsoup.connect(strings[0]).get();
} catch (IOException e) {
e.printStackTrace();
}
return fbDoc;
}
@Override
protected void onPostExecute(Document document) {
try {
String videoUrl = document.select("meta[property=\"og:video\"]")
.last().attr("content");
if(!videoUrl.equals(""))
Util.download(videoUrl, Util.RootDirectoryFacebook, activity, "facebook" + System.currentTimeMillis() + ".mp4");
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(activity, R.string.url_is_invalid, Toast.LENGTH_SHORT).show();
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question