-
Notifications
You must be signed in to change notification settings - Fork 794
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
expose dowloadFromInfo and drop some dependencies #1
Conversation
I always thought that the download function returning a stream was a much easier to use and understand API. What are your reasons for preferring the callback version? I agree with getting rid of removing EventVat. |
I don't really care either way - stream vs callback. This just seemed like an easier way to implement |
OK I updated the pull request. Now it does not break backwards compatibility but it still removes 2 dependencies and exposes |
var request = require('request'); | ||
var _ = require('underscore'); | ||
var getInfo = require('./info'); | ||
var crequest = require('./crequest'); | ||
var util = require('./util'); | ||
|
||
module.exports = ytdl; | ||
ytdl.getInfo = getInfo; | ||
ytdl.downloadFromInfo = downloadFromInfo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add docs to readme for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@fent I made |
stream.resolve(req); | ||
var format = util.chooseFormat(info.formats, options); | ||
if (format instanceof Error) { | ||
// give user a chance to attach 'error' handler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Full sentence with period please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Looks good. Awesome. Thank you for putting up with the back and forth, and contributing. 👍 |
expose dowloadFromInfo and drop some dependencies
And thank you for having an open mind to these changes :) |
expose dowloadFromInfo and drop some dependencies
* chore(package): update miniget to version 4.2.2 * drop node v10 & update package-lock.json * update workflow versions * try #1 to fix unit tests Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com> Co-authored-by: TimeForANinja <[email protected]>
This pull request:
getInfo
followed bydownloadFromInfo
.PassThrough
stream instead.All tests pass.