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.
Why I get “PermissionError: [WinError 5] Access is denied” error when I using youtube-dl in c# process class? #10766
Comments
|
Are you using IIS? It's a Python bug. Could you install Python 2.7.12 or 3.5.2 and use the zipped version of youtube-dl? |
|
@yan12125 Yes,I'm using iis,and I installed python 3.4.0 in C:\Python\Python34\ Matching with error sayed. |
|
@yan12125 How can I install this zipped version? |
|
Download that file, then
|
|
@yan12125 What should I type In cmd? I ask this question because when I use this in cmd, I can configure it on my server code.
|
|
Just replace the path to python.exe and youtube-dl to real paths. Anything wrong? |
|
@yan12125 Thank you very much.It worked with your beneficial helps.
Thank You. |
|
Glad to see that fixed :) |
|
@yan12125 With this compressed python version,I can't download from somelinks,but with exe version it's work. |
|
@parsasaei Could you post the command line output of both versions? |
|
@yan12125 yes. exe version download file and here exists output of it:
but python compressed output is empty and not return anything. |
|
How did you run the compressed version? |
|
With process class of c# |
|
Could you paste relevant C# codes? |
|
In top of this topic it's there |
|
Nothing printed to StandardError either? |
|
it's print: |
|
For https://www.youtube.com/watch?v=MZctQy6uEo8, I got "This video is not available." here too. Does the exe version and the Python version run on the same PC? |
|
No.It's different.I check exe version my local pc,and check python verion on server |
|
On server, exe vesrion return YouTube said: This video is not available too. |
|
What is the reason of it?is it related to location ip? |
|
Yes, and I guess you need a proxy on the server. From the youtube page, it says only the following countries are allowed to watch this video: AS,AU,BE,CA,DK,FI,FR,GB,GU,IE,IS,KR,LU,MP,MX,NL,NO,NZ,PR,SE,US,VI. Full names for those abbreviations can be found in http://data.okfn.org/data/core/country-list |
|
My server location is on "United States, Illinois, Chicago", and with this recommendation,it must be download. |
|
Does your server allow running browsers? (IE, edge, etc.) If so could you open https://www.youtube.com/watch?v=MZctQy6uEo8 and check whether it plays or not? |
|
It can't open on browser of server. |
|
Sorry, my server location is on Netherlands but Netherlands exists in list of countries which can access to watch this video too. |
|
youtube-dl tries its best to mimic browsers. If you got "This video is not available" in youtube-dl, I bet you'll get the same in browsers. You may want to ask Google why blocking your server. AFAIK there are reports that geolocation detection misbehaves. |
|
Thank you so much. |
… for use cases where the youtube-dl executable is run with python, ie. when running under IIS. Similar problem described here: ytdl-org/youtube-dl#10766
… for use cases where the youtube-dl executable is run with python, ie. when running under IIS. Similar problem described here: ytdl-org/youtube-dl#10766 (#40)
PermissionError: [WinError 5] Access is denied
Traceback (most recent call last): File "__main__.py", line 19, in <module> File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc7h_sle1\build\youtube_dl\__init__.py", line 449, in main File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc7h_sle1\build\youtube_dl\__init__.py", line 416, in _real_main File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc7h_sle1\build\youtube_dl\YoutubeDL.py", line 367, in __init__ File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc7h_sle1\build\youtube_dl\YoutubeDL.py", line 2100, in _setup_opener File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc7h_sle1\build\youtube_dl\utils.py", line 642, in make_HTTPS_handler File "C:\Python\Python34\lib\ssl.py", line 439, in create_default_context File "C:\Python\Python34\lib\ssl.py", line 390, in load_default_certs File "C:\Python\Python34\lib\ssl.py", line 377, in _load_windows_store_certs PermissionError: [WinError 5] Access is deniedMy Version is
youtube-dl --version: 2016.0.31.0and also when I used latest version,this problem was occured too.What is these errors?I don't have these paths and files with these directories.
And Here is my code
My Description
I used this on my local and it works fine. Also when I use youtube-dl.exe with cmd on server or on my local I don't have problem.