these platforms don't support youtube via a programmatic interface like this (and other libraries). They basically embed videos so the "API" is an http request for the traget url.
YT constantly changes how it masks access to the underlying resources with JS updates that break these libraries. The most frequent updates are to fix this.