Giter Site home page Giter Site logo

Comments (19)

jezzdk avatar jezzdk commented on May 29, 2024

Upgraded the youtube-dl-php library to use master branch and the error has changed:

The command "c:\inetpub\wwwroot\youtube-dl.exe "https://www.youtube.com/watch?v=iGk5fR-t5AU" --no-playlist --print-json --ignore-config "--format=137+140/best" --simulate" failed.

Exit Code: 255(Unknown error)

Working directory: C:\inetpub\wwwroot\storage\assets\downloads

Output:
================


Error Output:
================
Traceback (most recent call last):
File "__main__.py", line 19, in <module>
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmp_2hklmx2\build\youtube_dl\__init__.py", line 465, in main
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmp_2hklmx2\build\youtube_dl\__init__.py", line 432, in _real_main
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmp_2hklmx2\build\youtube_dl\YoutubeDL.py", line 402, in __init__
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmp_2hklmx2\build\youtube_dl\YoutubeDL.py", line 2267, in _setup_opener
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmp_2hklmx2\build\youtube_dl\utils.py", line 684, 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 denied

Everyone has write access to the working directory, so I don't know why it says access denied.

from youtube-dl-php.

jezzdk avatar jezzdk commented on May 29, 2024

Getting closer. Tried the solution mentioned here ytdl-org/youtube-dl#10766 and it works. Only problem is that youtube-dl-php doesn't allow further prefixing of the command.

According to the mentioned solution, the command would need to be changed from:
"c:\inetpub\wwwroot\youtube-dl.exe "https://www.youtube.com/watch?v=iGk5fR-t5AU" --no-playlist --print-json --ignore-config "--format=137+140/best" --simulate"

To something like:
"c:\python\python.exe c:\inetpub\wwwroot\youtube-dl "https://www.youtube.com/watch?v=iGk5fR-t5AU" --no-playlist --print-json --ignore-config "--format=137+140/best" --simulate".

I can hack the YoutubeDL class by adding array_unshift($arguments, 'C:\Python\python.exe'); to the createProcess() method and then it works, but you know...

from youtube-dl-php.

jezzdk avatar jezzdk commented on May 29, 2024

Created pull request.

from youtube-dl-php.

norkunas avatar norkunas commented on May 29, 2024

What about $yt->setBinPath('C:\Python\python.exe c:\inetpub\wwwroot\youtube-dl.exe'); ? Could you try it?

from youtube-dl-php.

jezzdk avatar jezzdk commented on May 29, 2024

I tried it, but it gets quoted in a way so the command fails:
"C:\Python\python.exe c:\inetpub\wwwroot\youtube-dl.exe"

Should be quoted like this:
"C:\Python\python.exe" "c:\inetpub\wwwroot\youtube-dl.exe"

from youtube-dl-php.

norkunas avatar norkunas commented on May 29, 2024

OK, merged ;)

from youtube-dl-php.

usamamashkoor avatar usamamashkoor commented on May 29, 2024

@jezzdk and @norkunas i am facing the same error can you please let me know how can i fix this issue.
Thanks in advance.

Error Output:

Fatal Python error: Failed to initialize Windows random API (CryptoGen)

from youtube-dl-php.

norkunas avatar norkunas commented on May 29, 2024

@usamamashkoor so have you tried $yt->setPythonPath()?

from youtube-dl-php.

Achilles718611 avatar Achilles718611 commented on May 29, 2024

I've got the same error.
I set python path, but got the same error.

from youtube-dl-php.

norkunas avatar norkunas commented on May 29, 2024

I've got the same error.
I set python path, but got the same error.

Could you dump the generated command line?

from youtube-dl-php.

Achilles718611 avatar Achilles718611 commented on May 29, 2024

image

Please check.
If I run command in terminal, it works.

from youtube-dl-php.

norkunas avatar norkunas commented on May 29, 2024

Did you try to call $dl->setPythonPath() to configure the path to python ?

from youtube-dl-php.

Achilles718611 avatar Achilles718611 commented on May 29, 2024

image

I set python path.
I use Pyton 3.6.
As you can see it doens't worke even I set Python path.

from youtube-dl-php.

Achilles718611 avatar Achilles718611 commented on May 29, 2024

image

from youtube-dl-php.

norkunas avatar norkunas commented on May 29, 2024

Okay, so now it's a different error. From the context I can only guess that somehow your environment configuration breaks this and from here I can't help you anymore, so you'll have to search the solution based on the error you have now. Maybe this would help for you appveyor/ci#1995 (comment)

from youtube-dl-php.

Achilles718611 avatar Achilles718611 commented on May 29, 2024

I think it's not environment problem, if I enter command on terminal directly, it works.

from youtube-dl-php.

norkunas avatar norkunas commented on May 29, 2024

I think still it is. The started process probably doesn't get all needed env vars and so it fails.
Could you try to directly edit symfony Process code and add for example PYTHONPATH and 'SYSTEMROOT' env vars with proper values? See mgedmin/check-manifest#52

from youtube-dl-php.

Achilles718611 avatar Achilles718611 commented on May 29, 2024

Can you tell me in detail, please?

from youtube-dl-php.

Achilles718611 avatar Achilles718611 commented on May 29, 2024

I think it's not related with youtube dl library, maybe it's related with symfony process.
Thanks for your help.

from youtube-dl-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.