Dette er scriptet som det ser ud lige nu. Men det lader til, at der ikke gemmes noget i cookie.txt
<?php
// Login
$username = "xxxx@xxxxxxxx.dk";
$password = "xxxxxxxxx";
$ch = curl_init("
https://login.viaplay.dk/api/login/v1?deviceKey=pc-dk&returnurl=http%3A%2F%2Fcontent.viaplay.dk%2Fpc-dk&username=".urlencode($username)."&password=".urlencode($password)."&persistent=true");
curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__) . "
http://clubace.dk/cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__) . "
http://clubace.dk/cookie.txt");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
echo curl_exec ($ch);
// Read the session saved in the cookie file
echo "<br/><br/>";
$file = fopen("
http://clubace.dk/cookie.txt", "r");
echo fread($file, 100000000);
echo "<br/><br/>";
// Retrieve content
$ch = curl_init("
https://play.viaplay.dk/api/stream/v1?deviceId=A3C12FC894EB0D3F0942DF2962CC71F4&deviceName=web&deviceType=pc&userAgent=Mozilla%2F5.0%20%28Windows%20NT%206.3%3B%20WOW64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F35.0.1916.153%20Safari%2F537.36&deviceKey=pc-dk&productId=168768");
curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__) . "
http://clubace.dk/cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__) . "
http://clubace.dk/cookie.txt");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
echo curl_exec ($ch);
?>