Badchip Posted November 2, 2015 Share Posted November 2, 2015 (edited) I want to open a TV channel with a click. This channel have 3 random/variable URL's. (usually only one works) http://mdsiosgeo1-lh...dex_0_av-b.m3u8 http://mdsios1-lh.ak...dex_0_av-p.m3u8 http://mdsios2-lh.ak...dex_0_av-p.m3u8 The PHP: (try it here) $player = 'http://videoplayer.vodobox.com/vodobox_player.php?vid=';$enlace1 = 'http://mdsiosgeo1-lh.akamaihd.net/i/mitele/esmediaset_11@168495/index_0_av-b.m3u8';$enlace2 = 'http://mdsios1-lh.akamaihd.net/i/mitele/esmediaset_11@168471/index_0_av-b.m3u8';$enlace3 = 'http://mdsios2-lh.akamaihd.net/i/mitele/esmediaset_21@168473/index_0_av-b.m3u8';function checkURL($url) {$headers = get_headers($url);if (preg_match('/^HTTP/d.ds+(200|301|302)/', $headers[0])){return true;}else return false;}?>if (checkURL($enlace1)) { echo ('');}else if (checkURL($enlace2)) {echo ('');}else if (checkURL($enlace3)) {echo ('');}?> I receive this error: (try the debug here) http://mdsiosgeo1-lh.akamaihd.net/i/mitele/esmediaset_11@168495/index_0_av-b.m3u8 ====> HTTP/1.0 403 Forbiddenhttp://mdsios1-lh.akamaihd.net/i/mitele/esmediaset_11@168471/index_0_av-b.m3u8 ====> HTTP/1.0 200 OKhttp://mdsios2-lh.akamaihd.net/i/mitele/esmediaset_21@168473/index_0_av-b.m3u8 ====> HTTP/1.0 200 OK However I can open/download the URL http://mdsiosgeo1-lh.akamaihd.net/i/mitele/esmediaset_11@168495/index_0_av-b.m3u8 without problems. ("http://mdsiosgeo1..." URL (geo) only works in Spain). Is there any alternative to skip this error 403 Forbidden? I could add the 403 header, but then the other URL's stop working. Thank you in advance. Edited November 2, 2015 by Badchip Link to comment Share on other sites More sharing options...
justsomeguy Posted November 2, 2015 Share Posted November 2, 2015 Presumably the 403 happens because the web server isn't in Spain. If you're checking the URL with PHP then it's checking from the web server IP address. Link to comment Share on other sites More sharing options...
Badchip Posted November 3, 2015 Author Share Posted November 3, 2015 (edited) Presumably the 403 happens because the web server isn't in Spain. If you're checking the URL with PHP then it's checking from the web server IP address. The web server is located in Amsterdam, Netherlands. Do you know any alternative in order to skip this error? the only guy who answered my previous messages is you. Edited November 3, 2015 by Badchip Link to comment Share on other sites More sharing options...
justsomeguy Posted November 3, 2015 Share Posted November 3, 2015 If that service is using geofencing then you need to either locate the server where they want you to, or convince them to disable geofencing. Link to comment Share on other sites More sharing options...
Badchip Posted November 4, 2015 Author Share Posted November 4, 2015 (edited) If that service is using geofencing then you need to either locate the server where they want you to, or convince them to disable geofencing. No other way to detect the URL? (without headers 200|301|302|403 etc.) Edited November 4, 2015 by Badchip Link to comment Share on other sites More sharing options...
justsomeguy Posted November 4, 2015 Share Posted November 4, 2015 If the server is always going to respond with a 403 if the request doesn't come from the correct country, then you have to send requests from the country they want you to. Maybe you can use a proxy in that country, but that's not all that different from just hosting your server in that country. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now