Youtube dl Python Set Headers

Youtube dl Python Set Headers

Youtube-dl can download videos in most situations; however, you may want to set headers.

In order to do that, you need to import youtube_dl.utils.

Here is the example!

import youtube_dl
import youtube_dl.utils
url = ""
youtube_dl.utils.std_headers['Referer'] = ""

with youtube_dl.YoutubeDL({}) as ydl:
    result =[url])

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: