YouTube recently made some changes to the front end of their web site. As a result, a very minor tweak to my class code is required to keep it working properly.
The following code in the SetFlvUrl() method in YouTubeToMp3Converter.class.php:
PHP Code:
private function SetFlvUrl($file_contents)
{
$vidUrl = '';
if (eregi('fmt_url_map',$file_contents))
{
$vidUrl = end(explode('&fmt_url_map=',$file_contents));
$vidUrl = current(explode('&',$vidUrl));
$vidUrl = current(explode('%2C',$vidUrl));
$vidUrl = urldecode(end(explode('%7C',$vidUrl)));
}
$this->_flvUrl = $vidUrl;
}
...needs to change like so:
PHP Code:
private function SetFlvUrl($file_contents)
{
$vidUrl = '';
if (eregi('fmt_url_map',$file_contents))
{
$vidUrl = end(explode('fmt_url_map=',$file_contents));
$vidUrl = current(explode('&',$vidUrl));
$vidUrl = current(explode('%2C',$vidUrl));
$vidUrl = urldecode(end(explode('%7C',$vidUrl)));
}
$this->_flvUrl = $vidUrl;
}
After doing that, everything should work as it has before! (Please notify me if you experience otherwise.)