Youtube-dl library and ERROR 403: Forbidden when using generated direct link by youtube-dl from different locations
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
.
youtube-dl --rm-cache-dir
it works perfectly :)