I have a problem with youtube-dl library (https://rg3.github.io/youtube-dl/). I use youtube-dl not for directly downloading videos by this library, instead I first generate li
youtube-dl --rm-cache-dir
it works perfectly :)
If dstftw's answer doesn't work for you, try with root:
su youtube-dl --rm-cache-dir
Final download URLs are only guaranteed to work on the same machine/IP where extracted. More on this.
UPD:
To get rid of 403 remove the cache by running youtube-dl --rm-cache-dir
on behalf of www-data
.