How to follow a rediect? - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: How to follow a rediect? (/showthread.php?tid=105999) |
How to follow a rediect? - free11131975 - 2011-07-21 I have been messing with the fastpasstv plug-in and in looking at getting it working again and I have it down to where I pull the url for the redirect out but I am stuck there. Is there a way to get the script to follow the url, wait 15 seconds for the redirect to happen and then read the html source of the page I end up at? If that made no sense then that si because I am new to this. Thanks, - rogerthis - 2011-07-21 Hi Free, I've been doing a bit of work on it too. Here is the function I used for the redirect Code: def redirector(url): Run this first on each of the url resolver functions. Code: link0 = redirector(url) I got novamov working, but nothing else. Let me know if you want to work together on this? - darkscout - 2011-07-21 I know nothing about python. But this was the first hit on google: http://diveintopython.org/http_web_services/redirects.html - free11131975 - 2011-07-22 Thanks. I will try to use your function and see what can get working. If i make any progress on any other sites i will let you know and send it to you. I also got videoweeks.es links working as well as novamov, but only those two. videoweeds file is about the same to extract. I don't want to offer to help too much because i have written a total of about 10 lines of python code in my life and think at this point i will slow down any development effort more then i would help. - Voinage - 2011-07-23 You really do not need to. The http://www.fastpasstv.ms/redirect/?url= always remains the same, just grab the string after it and add it before requesting the url. The response url is the original page of the file. Code: import urllib,urllib2,re,sys,os - free11131975 - 2011-07-26 Voinage Wrote:You really do not need to. The http://www.fastpasstv.ms/redirect/?url= always remains the same, just grab the string after it and add it before requesting the url. I had gotten that far. The problem I am having is that links redirects to a page with a 15 second timer before another redirect to the page with the video file in it. As I said i have only written about 10 lines of python so this may be a no-brainer but it is helping me figure a little bit of this out. |