Wednesday, June 6, 2012

[YouTube-API] Re: Uncaught exception 'Zend_Uri_Exception'

You're also making it lowercase ?

In this case "retrieving of any video from this account/channel will fail, due to invald uri", we don't know what is send.
But i find the solution "rename my youtube account - kill the whitespaces - and it works" strange.

Assuming whitespace is allowed here, then maybe you can use this standard PHP function:
urlencode ( string $str )

This function is convenient when encoding a string to be used in a query part of a URL, as a convenient way to pass variables to the next page. 
 

On Wednesday, June 6, 2012 12:32:35 AM UTC+2, Randy Howk wrote:
Programatically, I used this:

function stripText($text) {
        $text = strtolower(trim($text));
        // strip all whitespace
        $clean = preg_replace('/(\s\s+|\t|\n)/', '', $text);           

       
        return $clean;
    }

to strip out any whitespaces before sending the string to Zend, it will still throw an error when it does not find the name, but at least the Exception is catchable and won't stop your script dead in its tracks. I'll see if I can submit a fix to Zend so at least they can throw an exception when the username contains whitespaces, or better yet handle it correctly in the first place.

On Tuesday, June 5, 2012 9:03:01 AM UTC-4, Gonzo wrote:
I found out, that if your youtube Accountname contains a whitespace -
the retrieving of any video from this accoutn/channel will fail, due
to invald uri - exception in URI/Http.php

The Solution for me was - rename my youtube account - kill the
whitespaces - and it works :)

Greez

Gonzo

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/youtube-api-gdata/-/xAJeHGGo2xYJ.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment