Git Product home page Git Product logo

getsong's Introduction

getsong

travis go report card coverage godocs

This is a simple library that utilizes the rylio/ytdl YouTube downloader and ffmpeg to get almost any m4a of a song that you want to listen to. I wrote this so I could download m4as of my favorite Spotify playlists.

Disclaimer: Downloading copyright songs may be illegal in your country. This tool is for educational purposes only and was created only to show how YouTubes's API can be used to download music. Please support the artists by buying their music.

Install

go get -u github.com/schollz/getsong/...

Usage

The aim of this library to have a low (or zero) false positive rate, so it works best when the entered title + artist are spelled correctly.

Use as a program

$ getsong 'Getting in Tune' 'The Who'
Downloading 'Getting in Tune by The Who (W6-3rnD7FSc).webm'...
 524289 / 524289 [==========================] 100.00% 
...converting to m4a...
Downloaded 'Getting in Tune by The Who (W6-3rnD7FSc).m4a'

Use as a library

// download "True" by "Spandau Ballet"
fname, err := getsong.GetSong("True", "Spandau Ballet")
if err == nil {
    fmt.Printf("Downloaded '%s'\n", fname)
}

Contributing

Pull requests are welcome. Feel free to...

  • Revise documentation
  • Add new features
  • Fix bugs
  • Suggest improvements

License

MIT

getsong's People

Contributors

schollz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

getsong's Issues

Failing Build: cannot use f (type *ytdl.Format) as type ytdl.Format in assignment

When I try to go get this package, or when I try to import it in a golang script I see the following error

# github.com/schollz/getsong
/go/src/github.com/schollz/getsong/getsong.go:239:14: cannot use f (type *ytdl.Format) as type ytdl.Format in assignment
/go/src/github.com/schollz/getsong/getsong.go:248:43: cannot use *format (type ytdl.Format) as type *ytdl.Format in argument to info.GetDownloadURL

My golang skills are too weak to fix this...

Download directly to mp3

I have an old radio that plays only mp3 files, but getsong download only in .mka audio file.
Is there a way to download directly to mp3 and not in mka?

error

  1. Getting 'Menjadi Indonesia' by 'Pandai Besi'..{"level":"debug","time":"2019-12-25T16:11:55+07:00","message":"Fetching https://www.youtube.com/watch?v=0-fnVhzIPtY"}
    [error] 2019/12/25 16:12:04 getsong.go:153: No audio available
    ..error: could not download video: No audio available

info.GetDownloadURL undefined

Hi,

during installation go get -u github.com/schollz/getsong/... I got the following message:

# github.com/schollz/getsong go/src/github.com/schollz/getsong/getsong.go:248:27: info.GetDownloadURL undefined (type *ytdl.VideoInfo has no field or method GetDownloadURL)

This is related to ytdl recent struct add.

HELP

can you explain how to install it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.