Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Possible to use the '--referer' option in Python scripts? #13009
Comments
|
Put it as HTTP header in |
|
Thanks a lot, it works now. For anyone unsure of how to do what @dstftw just said:
|
|
But it's global settings.How to set it up when the different site? @vaibhav101 @dstftw |
That's right. You could either let that stay (it doesn't really affect downloading from other websites), or remove it once you are done with your script. |
|
as this was the first response from google. I'll update this issue with a solution that doesn't require the file change in site-packages. We're essentially doing the same thing. import youtube_dl
youtube_dl.utils.std_headers['Referer'] = "http://your.referer.here/"
....
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
.....@flysee this would also allow you to change it on the fly, in between downloads. |
|
Yeah,thx a lot! @simpss |
Make sure you are using the latest version: run
youtube-dl --versionand ensure your version is 2017.05.07. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
I am trying to download a domain restricted (embed-only) Vimeo video by embedding youtube-dl in a python script.
From the CLI, I can write
youtube-dl --referer siteFromWhichIGotTheLink.com https://player.vimeo.com/video/189295917to download this video.
But I have been unable to find such an option for embedding youtube-dl in a Python script
This is what my script looks like at the moment: