llelectronics / webcat

WebCat is a Webkit based webbrowser for sailfish os
19 stars 13 forks source link

DownloadManager: Handle Redirects #15

Closed Dax89 closed 9 years ago

Dax89 commented 9 years ago

Some downloads trigger redirects, as result you have a 0 bytes file. I have experienced this issue grabbing videos from DailyMotion.

I have handled the status code 302 in this commit: https://github.com/Dax89/harbour-webpirate/commit/be4470106d6ed6301aa9f085d95c26bddb855f75

llelectronics commented 9 years ago

Thanks. I am working on it :)

llelectronics commented 9 years ago

I think I closed it now. Do you have any direct link I can try out ?

Dax89 commented 9 years ago

Try this one: http://www.dailymotion.com/cdn/H264-848x480/video/x2igwu6.mp4?auth=1425558929-2562-l294lp4n-cad6a399cb248964ecc3fc5f7caa6404 :)

llelectronics commented 9 years ago

It gives me a forbidden reply. (I also tested my desktop browser which gives me the same)

Dax89 commented 9 years ago

Mmmmmh, probably because it checks the ip address :(

The steps required in order to recover the direct link are (you can do it in your desktop browser too):

var f = document.querySelector("iframe[class='video-player']");
f.contentWindow.info;

'info' is a JSON object, it contains some interesting fields named "stream......_url" containing direct links of the video, all of them triggers a redirect.

I have tried to search other web sites with a redirected download, but I cannot find them :(