Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set cookies and headers to EMBEDDING YOUTUBE-DL ? #24496

Closed
hatienl0i261299 opened this issue Mar 27, 2020 · 1 comment
Closed

How to set cookies and headers to EMBEDDING YOUTUBE-DL ? #24496

hatienl0i261299 opened this issue Mar 27, 2020 · 1 comment

Comments

@hatienl0i261299
Copy link

@hatienl0i261299 hatienl0i261299 commented Mar 27, 2020

I want to downlaod a video of facebook, but need cookies.txt to download
I tried

youtube-dl --cookies cookies.txt https://www.facebook.com/groups/dota2viet/permalink/1444279329095596/ --add-header "User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0"

It works
but in EMBEDDING YOUTUBE-DL

ydl_opts = {
            'cookies_file': 'cookies.txt',
            'headers':"User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0"
            'outtmpl':'abcdef.mp4'
    }
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
       ydl.download(["https://www.facebook.com/groups/dota2viet/permalink/1444279329095596/"])

It can not work, pls help me, thanh you !

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 27, 2020

cookiefile: File name where cookies should be read from and dumped to.

@dstftw dstftw closed this Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.