ERROR: unable to download video data: HTTP Error 403: Forbidden while using youtube_dl

Same problem many times .. solution: youtube-dl --rm-cache-dir

Cause of the problem: Sometimes I download playlists of large videos and I force it to stop downloading, the next time I run the command to resume the download, the 403 problem arises

At the moment, the cache directory is used only to store youtube players for obfuscated signatures. Since all videos in playlist use simple signatures

Playlist caching is an obvious way to detect changed titles or changed playlists in general


It seems like i have figured it out on my own. The Error went away after i cleared the cache.

            with youtube_dl.YoutubeDL(ydl_opts) as ydl:
            try:
                ydl.cache.remove()
                ydl.download([youtube_link])
            except youtube_dl.DownloadError as error:
                pass

Any info on why this works is welcome