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

Trouble d/ling from YouTube. Getting an error (I believe) related to Python. #2123

Closed
Starfoxian opened this issue Jan 9, 2014 · 5 comments
Closed

Comments

@Starfoxian
Copy link

@Starfoxian Starfoxian commented Jan 9, 2014

Hi. I've lurked on this forum since I first started with youtube-dl and I think I'm posting in the right place. I updated my youtube-dl today and when I tried to download I get this:

youtube-dl -f 18 http://www.youtube.com/watch?v=oJnz63iJlDo
[youtube] Setting language
[youtube] oJnz63iJlDo: Downloading webpage
[youtube] oJnz63iJlDo: Downloading video info webpage
[youtube] Confirming age
[youtube] oJnz63iJlDo: Extracting video information
[youtube] RTMP download detected
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/bin/youtube-dl/main.py", line 18, in
File "/usr/bin/youtube-dl/youtube_dl/init.py", line 761, in main
File "/usr/bin/youtube-dl/youtube_dl/init.py", line 751, in _real_main
File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 952, in download
File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 493, in extract_info
File "/usr/bin/youtube-dl/youtube_dl/extractor/common.py", line 155, in extract
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1336, in _real_extract
KeyError: None

I picked a video at random to see if I could download at all and it did download but the output in terminal was odd to say the least.

youtube-dl -f 18 http://www.youtube.com/watch?v=ab9176Srb5Y
[youtube] Setting language
[youtube] ab9176Srb5Y: Downloading webpage
[youtube] ab9176Srb5Y: Downloading video info webpage
[youtube] ab9176Srb5Y: Extracting video information
[youtube] ab9176Srb5Y: Encrypted signatures detected.
[youtube] ab9176Srb5Y: Downloading js player vflwMrwdI
WARNING: Writing cache to u'/home/ysuran/.cache/youtube-dl/youtube-sigfuncs/js_vflwMrwdI_82.json' failed: Traceback (most recent call last):
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 345, in _extract_signature_function
write_json_file(cache_spec, cache_fn)
File "/usr/bin/youtube-dl/youtube_dl/utils.py", line 216, in write_json_file
with open(fn, 'wb') as f:
IOError: [Errno 13] Permission denied: u'/home/ysuran/.cache/youtube-dl/youtube-sigfuncs/js_vflwMrwdI_82.json'

[youtube] ab9176Srb5Y: Downloading js player vflwMrwdI
WARNING: Writing cache to u'/home/ysuran/.cache/youtube-dl/youtube-sigfuncs/js_vflwMrwdI_85.json' failed: Traceback (most recent call last):
File "/usr/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 345, in _extract_signature_function
write_json_file(cache_spec, cache_fn)
File "/usr/bin/youtube-dl/youtube_dl/utils.py", line 216, in write_json_file
with open(fn, 'wb') as f:
IOError: [Errno 13] Permission denied: u'/home/ysuran/.cache/youtube-dl/youtube-sigfuncs/js_vflwMrwdI_85.json'

[download] Destination: Eminem - Berzerk (Official) (Explicit)-ab9176Srb5Y.mp4
[download] 100% of 22.54MiB in 00:06

I am unsure if this is the place to ask for help or to merely report issues so they can be addressed. If this is not the place to seek help, would it be too much to ask for a link to a forum where I could receive assistance?

phihag added a commit that referenced this issue Jan 9, 2014
@phihag
Copy link
Contributor

@phihag phihag commented Jan 9, 2014

You are in the right place, this bugtracker deals with any issues with youtube-dl. Mind that it is not a forum, but more structured (if you follow the hints for bug reporting, you should be fine ). Both errors are completely unrelated.

The second error is actually non-fatal, the download works just fine. However, it's strange that you can't write to your own home directory. What are the permissions of, say, /home/ysuran/.cache/youtube-dl/youtube-sigfuncs/js_vflwMrwdI_85.json, and the intermediate directories?

The first video uses Youtube's feature film infrastructure, for which we don't have good support yet. I've fixed the immediate error, but it looks like we need to extract more information before that download can succeed.

@Starfoxian
Copy link
Author

@Starfoxian Starfoxian commented Jan 9, 2014

The owner is root.

The output for: ls -l /home/ysuran/.cache/youtube-dl/youtube-sigfuncs/ is:
total 8
-rw-r--r-- 1 root root 290 Jan 5 23:55 js_vflG49soT_82.json
-rw-r--r-- 1 root root 314 Jan 5 23:55 js_vflG49soT_88.json

When I ran Ubuntu I used sudo before youtube-dl. I am running Mint now and using sudo gives me a locked file that is only accessible via root. I was unable to change permissions on the file using Nautilus so I tried it without sudo first and it worked up until today. Yesterday as a matter of fact.

I will read the link you posted regarding adding a pseudo format. I will also Google more on permissions. I will read the hints for bug reporting too as it has been a rather long while since I read them last and I may have done this wrong. The first video was from a series which is quite old and was uploaded some time ago so that may factor in. Thanks again. I am trying to include the appropriate information and such.

@phihag
Copy link
Contributor

@phihag phihag commented Jan 9, 2014

The only time you should ever run youtube-dl as root is when updating a system-wide binary. You can simply run sudo rm -rf /home/ysuran/.cache/youtube-dl once and everything should get working again. But as I wrote above, the permission messages are a harmless nuisance.

youtube-dl needs to be extended to extract the correct RTMP parameters for feature-films URLs. The pseudo format is just preventing the immediate programming error; downloading will still not work even after applying the change.

@Starfoxian
Copy link
Author

@Starfoxian Starfoxian commented Jan 9, 2014

I won't run it again using root. After changing to Mint I made more of an effort to learn what was behind different commands. My Ubuntu distro was quite old and I rarely used youtube-dl. Still, I am learning.

Thank you for letting me know a bit more about the pseudo format. I was using Google to attempt to decipher what it said more. Oh well, its good to know. Thanks again. I did use the command you shared to fix the error though.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 13, 2016

Duplicate of #343.

@dstftw dstftw closed this Jun 13, 2016
@ytdl-org ytdl-org locked and limited conversation to collaborators Apr 1, 2020
@ytdl-org ytdl-org deleted a comment from johnstonjay Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.