Let's take this objective:
>it can be switched from one host to another anytime without breaking that.
... that flexibility of any unknown host in the future then breaks the following code:
>if we could make a youtube-dl that dynamically fetched the latest working version
... and youtube-dl would download the latest version from where? What kind of "intelligence" does one put in the code to download from a future unknown http source?
One could try to be clever and embed a "intelligent algorithm" inside youtube-dl to scan the Google SERs[0] for the latest host source but that's not foolproof. Google may also later block results with the all-too-common censorship message "In response to multiple complaints we received under the US Digital Millennium Copyright Act, we have removed 6 results from this page."
Would youtubel-dl scan a well-known Twitter account or SMTP mailing list server to find the latest version? (My previous comment exploring that[0])
Storing binary blobs in popular blockchains like Bitcoin or Ethereum would be near impossible because of technical and architectural limits. (E.g. youtube-dl binary is about 1.7MB and thus miners will reject your non-standard transaction.)
I'm unaware of a foolproof way to share future versions aka future sources that can be programmed into deterministic code. Discovery will have to involve humans coordinating in some way. E.g. PirateBay moves from host to host but humans (not code) spread the new location.
[0] https://www.google.com/search?q=youtube-dl+latest+download