I'm writing code to validate YouTube URLs. Is it guaranteed that the video ID, such as oHg5SJYRHA0, is always exactly 11 characters long, or can it sometimes be shorter or longer? Is there any official documentation about this?
Tell me more
×
Web Applications Stack Exchange is a question and answer site for
power users of web applications. It's 100% free, no registration required.
|
|
|||||
|
migrated from stackoverflow.com Mar 26 '11 at 10:36
|
They'll probably stick to 11 chars for a long time. Each character has 64 possible values:
Then 11 characters in total:
Of course not all combination will be used, depending on their algorithm, but they are probably not going to change it anytime soon. Words from a YouTube developer state that they do not guarantee, though: http://osdir.com/ml/youtube-api-gdata/2009-10/msg00237.html |
||||
|
|
|
Yes, they always have 11 characters. |
|||||
|