Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Specify download format 'best' if none supplied #75

Merged
merged 1 commit into from May 7, 2015

Conversation

jasonpenny
Copy link
Contributor

When I try to download a video from youtube, node-youtube-dl is crashing

url.js:110
    throw new TypeError("Parameter 'url' must be a string, not " + typeof url)
          ^
TypeError: Parameter 'url' must be a string, not undefined

youtube-dl --dump-json $url for versions after 2015.04.17 do not have a "url" key if a format is not specified, which causes an error on this line https://github.com/fent/node-youtube-dl/blob/master/lib/youtube-dl.js#L51

This change attempts to add -f best if none is supplied

@@ -217,6 +217,10 @@ ytdl.getInfo = function(url, args, options, callback) {
args = [];
}
var defaultArgs = ['--dump-json'];
if (!args || args.indexOf('-f') < 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can also be --format

fent added a commit that referenced this pull request May 7, 2015
Specify download format 'best' if none supplied
@fent fent merged commit 7a078d3 into przemyslawpluta:master May 7, 2015
@jasonpenny
Copy link
Contributor Author

I haven't had time to get back to this yet, but it is also possible to specify the format in a single argument, like ['--format=18'], right?

@fent
Copy link
Collaborator

fent commented May 7, 2015

yeah you're right, lemme fix that in a bit

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants