-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
not downloading ts and mp3 files #45
Comments
Hi, thank you for letting me know. I'll work on it as soon as I can. |
i am developing related projects and i copied from ur code videocontentsearch,class files are not supporting other type of videos Eg;- mpeg,ts,mp3
please help to automatically detect the mp3 and other types |
Try this for mp3 after getting content type from response headers:
Or try audio/mpeg3 or whatever you see in this link -> https://stackoverflow.com/questions/12017694/content-type-for-mp3-download-response For other formats, basically you'll have to google "content type for (whatever format you need)". As for dailymotion, I tried it and it works? I was able to download 'ts' video files. |
yes mp3 files also can play this site. and mp3 also cannot download its segment more parts like daily motion .ts files it can't be download one files its segmented. do u have any idea about this. waiting for good responce |
What I would usually do is log the urls from onLoadResource like this:
Look for the suspected urls for the mp3. Find the part of the url which constantly changes in each url. Usually it indicates which chunk of the file is being streamed. Delete that part and try to download it. Perhaps you can download the whole file this way. You can use replaceAll() for deleting like this:
If not, you'll have to download each chunk and append to target file. Make sure you set true for append in FileOutputStream constructor.
Also, you can just save one url from onLoadResource by selecting one url and then replace the changing part with something like "CHUNK" or "SEGMENT". When you download, restore it to original, replacing the number with the number of the first chunk, download the chunk , and then increment the number. Repeat until you get a FileNotFoundException when attempting to open connection with url. You'll have to delete the Log command of course. You should capture the url using a keyword like "audio" or "mp3" or whatever that allows you to skip other unimportant urls. |
I fixed it. New Release Here.
and
Twitter uses m3u8 file which lists the segments it will play. I fixed it so that it will only detect the m3u8 file and skip detecting segments. The link without indicated total size is the correct link to download whole video file. To download the whole file, you have to download each segment listed in the m3u8 file. As for facebook, it seems like they changed to streaming segmented videos which was not the case before if I remember correctly. With the help of a video downloader in my desktop, I was able to deduce that I should replace the subdomain and remove the bytestart and byteend query fields in the link to download the whole file. Unfortunately, other videos in the page are still detected. So It requires a bit of luck to find the correct video. |
ohh thanku but same problem occur to other website , i would like to download gaana.com mp3 songs but same segment , can i know the detail for the this code for skip the chunks
because i need to download the ganaa.com looking for the helping and any way thanks for the code |
So what I did was, I used the Flash Video Downloader extension in Chrome Browser. Went to a facebook page with a streaming video. Copied the link address of the video from Flash Video Downloader and pasted it in a text editor. I ran my app in android studio, and went to facebook page with video. I had my onLoadResource in webview client log all the urls. I saw that the urls for segments are similar to the link address I had from Flash Video Downloader except for the subdomain. So to get the link to the full video, I changed the subdomain to the one similar to link from Flash Video Downloader and removed the bytestart and byteend query fields that was placed at the end of each links.
Please paste the logs you get from onLoadResource. Also it would help if you log the content type of each. To do this setup a webview and have your webview client override onLoadResource. Log the url. Open connection. Get content type and log it.
Run the app. Go to ganaa.com and play an mp3. Go to logcat. Filter with your tag. Copy all logs and paste it here. Hopefully we get the links to these segments and see what can be done to get the url for full mp3. Or wether we need to download each segment one by one. Also, can you also list all the other video streaming sites you're using. No porn sites pls. Thank u. |
this logcat i try for the ganna but not working , any idea that content type type:video/mp2t but that not mp3 any idea |
You can try to add more keywords in res/values/videourl_filters.xml.
Make sure you have this code:
Also add more content type:
Also, like I said before you could try to log all urls from onLoadResource() to get more idea how to fetch Also , do not forget to play the mp3 itself in the page for anything of these to even work. If nothing works, then I can not help you since my knowledge is also limited as well. |
not downloading dailmotion videos and facebook videos
The text was updated successfully, but these errors were encountered: