I have an application to watch and download videos online, my code detects the mimetype by url to use as an extension of the downloaded video.
However, some websites have the hidden extension, such as this url: http://www.animeplus.org/inc/video.inc.php?&file=NSwzOWE0YWQ5ODhhNWQ4NWEx&token=rm_uJeMTUxNjA4OTM0OQ==
VideoView can play the video, however Downloader takes mimetype as php and saves the video in php extension, this is the code snippet that I use to get the extension:
String mimeType = '.' + MimeTypeMap.getFileExtensionFromUrl(url.toString());
In this case it takes the extension of the video as it should: https://www.blogger.com/video-play.mp4?contentId=6bc99b4dd120f980
So how to solve this problem?