This is the risk of explaining the method
This is the risk of explaining the method
Video IDs are immutable
A video can only be represented by a single unique video ID
etc.
Presumably, no one would do that except researchers trying to count videos (or randomly find hidden ones?).
You can break the assumption of unicity (if an unassigned ID is later assigned) if you do that internally, although not sure that’d be common but it’s not an assumption that has to be strict for non-attributed ones, and you never use the fake ID.
if you got a video from a randomly generated ID, you can immediately query for it again, and see if the video was the same as before.
If it's not the same, you disgard the result and assume the ID generated was actually non-existent.
If it's the same, then you know it's a real ID.
As long as youtube vidoe URLs are immutable, this method will stop the blocks you described.
a lot of work, for very little gain.