I'm using Dwonload Manager to store file from internet to Phone. for files that ends with .jpg or .mp4 the download works, but for a link generated from a site that create download link it doesn't work( i get download unssecssful) . is it normal that it doesn( accept link that doesn't have a suffix?
PS: I've made a lot of researches on internet about how to get .mp4 link from youtube or how to store a video in a site and then get a direct .mp4 link ..but no sucess ..
Can you suggest a way to be able to have MP4 link for free of a video that i have in my PC (i don't mind upload it to youtube if there is a way to have a direct link or a link that will work with download manager)
this is my code
personViewHolder.personbutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Person person = persons.get(i);
Context context=v.getContext();
String url = person.url;
DownloadManager manager = (DownloadManager)context.getSystemService(Context.DOWNLOAD_SERVICE);
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
request.setDescription(person.title);
request.setTitle(person.title);
request.allowScanningByMediaScanner();
request.setNotificationVisibility(
DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, "file"+person.title+".mp4");
manager.enqueue(request);
}
});
You can use Google Drive, and upload your video on it. Get public link (anyone with link can access file). Then follow this tutorial to get your direct link.
Edited new link: https://www.wonderplugin.com/online-tools/google-drive-direct-link-generator/
Hope it will help your issue. Thanks!