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

--format='bestvideo+bestaudio' --get-url crashes #2883

Closed
Nikoli opened this issue May 10, 2014 · 5 comments
Closed

--format='bestvideo+bestaudio' --get-url crashes #2883

Nikoli opened this issue May 10, 2014 · 5 comments
Labels
bug

Comments

@Nikoli
Copy link
Contributor

@Nikoli Nikoli commented May 10, 2014

Many videos are available in 1080p only in DASH formats. Often i prefer to play videos in mpv instead of saving to file, it supports external audio tracks. I guess youtube-dl should return several urls, may be in some special or custom format. Now it just crashes:

$ youtube-dl --format='bestvideo+bestaudio' --get-url https://www.youtube.com/watch?v=MjQG1s3Isgg
Traceback (most recent call last):
  File "/usr/bin/youtube-dl", line 6, in <module>
    youtube_dl.main()
  File "/usr/lib64/python2.7/site-packages/youtube_dl/__init__.py", line 847, in main
    _real_main(argv)
  File "/usr/lib64/python2.7/site-packages/youtube_dl/__init__.py", line 837, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 1039, in download
    self.extract_info(url)
  File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 527, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 564, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 819, in process_video_result
    self.process_info(new_info)
  File "/usr/lib64/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 860, in process_info
    self.to_stdout(info_dict['url'] + info_dict.get('play_path', ''))
KeyError: u'url'
$ youtube-dl --version
2014.05.05
@jaimeMF jaimeMF added the bug label May 10, 2014
@filoozom
Copy link

@filoozom filoozom commented May 17, 2014

I don't think that this is supported, youtube-dl doesn't mux DASH files, you have to do it yourself and download both files separately, then use ffmpeg or something similar to mux both files.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented May 17, 2014

@filoozom it's supported (but undocumented), see #1612. youtube-dl will mux the two formats if you request them.

@Nikoli
Copy link
Contributor Author

@Nikoli Nikoli commented May 17, 2014

Also for this use case i do not need to mux video and audio, i just need urls, mpv will do the rest.

@filoozom
Copy link

@filoozom filoozom commented May 17, 2014

@jaimeMF Oh, didn't see, that's quite handy. Will try that asap.

@cryptonaut
Copy link
Contributor

@cryptonaut cryptonaut commented Dec 6, 2014

The above referenced commit (16ae61f) fixes this bug and outputs URLs separated by new lines. You can split the output, to use with mpv for example, in a script with something like this (bash):

urls=( $(youtube-dl --format='bestvideo+bestaudio' --get-url "https://www.youtube.com/watch?v=MjQG1s3Isgg") )

video_url="${urls[0]}"
audio_url="${urls[1]}"

mpv --audio-file "$audio_url" "$video_url"
@phihag phihag closed this in 16ae61f Dec 8, 2014
phihag added a commit that referenced this issue Dec 8, 2014
Handle --get-url with merged formats (fixes #2883)
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
4 participants
You can’t perform that action at this time.