At this point, it might save you time just to wait for a few days:
http://forum.wdlxtv.com/viewtopic.php?f=38&t=2786







Ancaster wrote:Can someone please help me?

RMerlin wrote:Here's a fully functional (as far as I can tell) fix. This uses the new format parser by ramanvijay, with a few fixes:
- Adapted to up-to-date youtubeHD code
- Fixed fallback to lower resolution if the one requested is not available
- Implemented SD fallback if no supported resolutions are available
- Code: Select all
function getvideo() {
$url = "http://www.youtube.com/watch?v=" . $_GET['id'];
$html = file_get_contents($url);
if(preg_match('/&fmt_url_map=([^&$]*)/', $html, $fmt_url_map)) {
foreach(explode(',',urldecode($fmt_url_map[1])) as $var_fmt_url_map) {
list($yt_qlty,$yt_url) = explode('|',$var_fmt_url_map);
$hash_qlty_url[$yt_qlty] = $yt_url ;
}
$quality = "270P";
if (file_exists('/conf/config')) {
$config = file_get_contents('/conf/config');
if(preg_match('/YOUTUBE_QUALITY=\'(.+)\'/', $config, $config_quality)) {
$quality = $config_quality[1];
}
}
$quality_map = array('1080P' => 37, '720P' => 22, '480P' => 35, '360P' => 34, '270P' => 18);
$quality_map_values = array_values($quality_map);
$index = array_search($quality_map[$quality], $quality_map_values);
while (!isset($hash_qlty_url[$quality_map_values[$index]]) && ($index < (count($quality_map_values) - 1))) {
$index++;
}
$quality = $quality_map_values[$index];
// exec("logger -t YoutubeHD 'Q:".$quality." U:".$hash_qlty_url[$quality]."'");
if ($hash_qlty_url[$quality]) {
echo "<?xml?><entry><media:group><media:content url='" . str_replace('&', "&", $hash_qlty_url[$quality]) . "' yt:format='3'/></media:group></entry>";
} else {
echo "<?xml?><entry><media:group><media:content url='" . str_replace('&', "&", ($_SESSION['id_' . str_replace("-","_",$_GET['id'])])) . "' yt:format='3'/></media:group></entry>";
}
}
}

/conf/S99user-script
Users browsing this forum: No registered users and 1 guest