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

Add example for converting to mp3 #83

Merged
merged 5 commits into from
Apr 19, 2018
Merged

Add example for converting to mp3 #83

merged 5 commits into from
Apr 19, 2018

Conversation

jspenc72
Copy link
Contributor

Add one line example to show how to download video from youtube and convert it to mp3 in a single command with filename set as a variable.

@codecov
Copy link

codecov bot commented Mar 14, 2018

Codecov Report

Merging #83 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #83   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines          29     29           
  Branches        6      6           
=====================================
  Hits           29     29

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dd78e71...91e6133. Read the comment docs.

Copy link
Owner

@fent fent left a comment

Choose a reason for hiding this comment

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

Thanks!

README.md Outdated
```bash
name=`echo myfilename` && ytdl http://www.youtube.com/watch?v=_HSylqgVYQI > $name.mp4 && ffmpeg -i $name.mp4 -b:a 192K -vn $name.mp3 && rm -rf $name.mp4

```
Copy link
Owner

Choose a reason for hiding this comment

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

Would prefer this to be placed after the example below, since the example below is the most basic example of how someone would use ytdl

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved below the other simpler example.

README.md Outdated
Download video and convert to mp3 (Requires ffmpeg)

```bash
name=`echo myfilename` && ytdl http://www.youtube.com/watch?v=_HSylqgVYQI > $name.mp4 && ffmpeg -i $name.mp4 -b:a 192K -vn $name.mp3 && rm -rf $name.mp4
Copy link
Owner

Choose a reason for hiding this comment

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

Video can be piped directly into ffmpeg without having to save it to a file and then deleting it

ytdl http://www.youtube.com/watch?v=_HSylqgVYQI | ffmpeg -i pipe:0 -b:a 192K -vn myfile.mp3

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the direct pipe example as you provided.

@jspenc72
Copy link
Contributor Author

Can you use the title and author name in the filename if you pipe directly to ffmpeg?

@jspenc72
Copy link
Contributor Author

I have updated the branch to reflect the changes you asked for.

README.md Outdated
@@ -8,6 +8,8 @@ A youtube downloader written in Javascript. To be used with the command line. If

# Usage



Copy link
Owner

Choose a reason for hiding this comment

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

Did you mean to have these new lines here?

README.md Outdated
Download video pipe directly intp ffmpeg if you only want the .mp3 file (Requires ffmpeg)

```bash
name=`echo myfilename` && ytdl http://www.youtube.com/watch?v=_HSylqgVYQI | ffmpeg -i pipe:0 -b:a 192K -vn $name.mp3
Copy link
Owner

Choose a reason for hiding this comment

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

I think most of the time, if people want to convert to mp3, they will want to keep only the mp3 file. I think it's ok to only include this example.

Also, using name seems superfluous in this case, because it's only used once.

README.md Outdated

Fent ([@fent](https://github.com/fent))
------------------
* Jesse Spencer ([@Jspenc72](https://github.com/jspenc72))
Copy link
Owner

Choose a reason for hiding this comment

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

I'd rather we use the contributors field in package.json

https://docs.npmjs.com/files/package.json#people-fields-author-contributors

@fent fent changed the title Master Add example for converting to mp3 Apr 19, 2018
@fent fent merged commit bd6c965 into fent:master Apr 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants