summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--iplayer.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/iplayer.php b/iplayer.php
index b1a2007..e97cc2a 100644
--- a/iplayer.php
+++ b/iplayer.php
@@ -1,4 +1,6 @@
<?php
+define("CURLIFACE", "192.168.122.9");
+
// Grab the programme ID with GET, or with POST, or present a URL form
if (isset($_GET['id'])) {
$id = $_GET['id'];
@@ -29,7 +31,13 @@ $vpidlen = strpos($html, '"', $vpidpos) - $vpidpos;
$vpid = substr($html, $vpidpos, $vpidlen);
// Grab the JSON which appears to be within some JavaScript
-$notjson = file_get_contents("http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/vpid/$vpid/format/json/mediaset/apple-ipad-hls/jsfunc/JS_callbacks39");
+$curl = curl_init();
+curl_setopt($curl, CURLOPT_INTERFACE, CURLIFACE);
+curl_setopt($curl, CURLOPT_URL, "http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/vpid/$vpid/format/json/mediaset/apple-ipad-hls/jsfunc/JS_callbacks39");
+curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($curl, CURLOPT_HEADER, false);
+$notjson = curl_exec($curl);
+curl_close($curl);
// Extract the actual JSON inside the JavaScript
$jsonpos = strpos($notjson, '{');