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

Warning running with shell_exec #3648

Closed
dspstudio opened this issue Sep 1, 2014 · 1 comment
Closed

Warning running with shell_exec #3648

dspstudio opened this issue Sep 1, 2014 · 1 comment

Comments

@dspstudio
Copy link

@dspstudio dspstudio commented Sep 1, 2014

I'm getting a warning when i call shell_exec from PHP , if i run it from terminal everything works.
I think it might be with the apache rights If so what permissions should i give.
command used in PHP: shell_exec("/usr/local/bin/python2.7 /usr/local/bin/youtube-dl $input -g -i 2>&1")

WARNING: Writing cache to u'//.cache/youtube-dl/youtube-sigfuncs/js_vfltYLx8B_43.40.json' failed: Traceback (most recent call last):
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 481, in _extract_signature_function
os.makedirs(os.path.dirname(cache_fn))
File "/usr/local/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/usr/local/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/usr/local/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '//.cache'

@phihag
Copy link
Contributor

@phihag phihag commented Sep 1, 2014

In order to not have to download player files (which never change), youtube-dl caches some files in a directory relative to $HOME. We may also extend the cache in the future.

I recommend one of the following options:

  • Pass in --no-cache-dir. This will disable caching though and will have a negative impact on performance.
  • Pass in --cache-dir /tmp/youtube-dl or any other cache directory instead of /tmp/youtube-dl. The directory should be writable, readable, and indexable for the apache user, but that should be the default for/tmpand/var/tmp` already.
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.