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 add header to EMBEDDING YOUTUBE-DL ? #25120

Closed
hatienl0i261299 opened this issue May 4, 2020 · 0 comments
Closed

How to add header to EMBEDDING YOUTUBE-DL ? #25120

hatienl0i261299 opened this issue May 4, 2020 · 0 comments

Comments

@hatienl0i261299
Copy link

@hatienl0i261299 hatienl0i261299 commented May 4, 2020

Checklist

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

WRITE QUESTION HERE
I want to download a hls url but need add header is user-agent and referer
i tried
youtube-dl "https://brvn-hlse-public-key.s3.ap-southeast-1.amazonaws.com/route-to-market/RTM_1-2/index.m3u8" --add-header User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.170 Safari/537.36 --add-header Referer:https://www.brandcamp.asia/myvideo/121M58291U2562H --hls-prefer-native
It works
but in EMBEDDING YOUTUBE-DL

with youtube_dl.YoutubeDL({
    'outtmpl': "video.mp4",
    'num_of_thread': 5,
    "hls_prefer_native":True,
    "headers": {
        "User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.170 Safari/537.36",
        "Referer":"https://www.brandcamp.asia/myvideo/121M58291U2562H"
    }
}) as ydl:
    ydl.download(["https://brvn-hlse-public-key.s3.ap-southeast-1.amazonaws.com/route-to-market/RTM_1-2/index.m3u8"])

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

@dstftw dstftw closed this May 4, 2020
@dstftw dstftw added the duplicate label May 4, 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.