Code Monkey home page Code Monkey logo

playlistfromsong's Introduction

playlistfromsong

image

image

Documentation Status

Updates

Generate an offline playlist from a single song.

Features

  • Similar song matching using last.fm or Spotify
  • Automatic downloading of songs
  • Builtin music server for webhooks

Quickstart

First install ffmpeg:

sudo apt-get install ffmpeg    (DEBIAN)
brew install ffmpeg            (MAC)

Install with pip:

pip install playlistfromsong

Download a playlist of 5 songs similar to Miles Davis' Blue In Green:

playlistfromsong --song 'Miles Davis Blue In Green' --num 5 -f /path/to/save

Demo1

Use a bearer token --bearer to use Spotify to find suggestions:

playlistfromsong --song 'Miles Davis Blue In Green' --num 5 -f /path/to/save -b 'BEARER'

Demo1

For more complete usage, see the docs.

playlistfromsong's People

Contributors

kalbhor avatar naereen avatar pyup-bot avatar rachmadaniharyono avatar 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

playlistfromsong's Issues

Use BeautifulSoup over lxml

BeautifulSoup can achieve the same things as lxml and do a lot more. This will reduce 1 manual dependency too. May I try and send a pull request?

Doesn't work in Python2

After installing all dependencies on Mac, I'm running into an issue.

playlistfromsong --song 'Miles Davis Blue In Green' --num 5

When I run this command I'm getting this error:

usage: playlistfromsong [-h] [-s SONG] [-n NUM] [-b BEARER] {config} ...
playlistfromsong: error: too few arguments

Is there something I'm missing?

AttributeError: 'module' object has no attribute 'parse'

$ playlistfromsong -s 'deep purle child of time'
Generating playlist for 3 songs from 'deep purle child of time'

PLAYLIST: 

Deep Purple - Child In Time (Son Of Aleric - Instrumental)
Traceback (most recent call last):
  File "/usr/local/bin/playlistfromsong", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/playlistfromsong/cli.py", line 33, in main
    run(song, num, bearer=bearer, folder=folder)
  File "/usr/local/lib/python2.7/dist-packages/playlistfromsong/playlistfromsong.py", line 296, in run
    youtubeLinks = useLastFM(song, num)
  File "/usr/local/lib/python2.7/dist-packages/playlistfromsong/playlistfromsong.py", line 209, in useLastFM
    data = getYoutubeAndRelatedLastFMTracks(firstURL)
  File "/usr/local/lib/python2.7/dist-packages/playlistfromsong/playlistfromsong.py", line 169, in getYoutubeAndRelatedLastFMTracks
    '%s - %s official' % (artistName, songName))
  File "/usr/local/lib/python2.7/dist-packages/playlistfromsong/playlistfromsong.py", line 58, in getYoutubeURLFromSearch
    urlToGet = "https://www.youtube.com/results?search_query=" + urllib.parse.quote_plus(searchString)  # NOQA
AttributeError: 'module' object has no attribute 'parse'

Server not functioning properly

I installed this on a raspberry pi 3.
When running it as a server.
playlistfromsong --serve --folder ~/Music
I get don't get any errors, but the web page is not functioning properly.
screenshot_2017-07-05_23-40-33
I think this is a CSS or Javascript error. I don't know enough to say.
It will create a list, download it and transcodes it.
screenshot_2017-07-06_09-27-22
The only thing on the web page to change it the number of songs.
I don't get a playlist and I am not able to play any songs.

Select quality and file format in youtube-dl

Hello, again :)

If I understand correctly playlistfromsong recodes music into mp3. Is there a way to prevent it (and use another format)? Or at least is there a way to select a bitrate? Or this is useless because source of the music already has mp3/192kbps-like quality?

I can see that some of sources uses OPUS. That is much better than mp3, IMHO.

Best regards, Dmitry.

Handle entering an artist without a song

Hello. I'm getting error "IndexError: list index out of range"

$ playlistfromsong -s 'Kalya Scintilla'

PLAYLIST: 

Desert Dwellers - Lotus Heart - (Kalya Scintilla Remix)
Kalya Scintilla - Kalya Scintilla
Kaya Project - Kaya Project
Androcell - Androcell
Kaminanda - Kaminanda
Ott - Ott
Shulman - Shulman
Bluetech - Bluetech
Shakatura - Shakatura
Hibernation - Hibernation
Desert Dwellers - Desert Dwellers
Master Minded - Master Minded
Kalya Scintilla -  similar
Kaya Project -  similar
Angel Tears - Angel Tears
Random Rab - Random Rab
Entheogenic - Entheogenic
Tripswitch - Tripswitch
Androcell -  similar
Kaminanda -  similar
Akasha - Akasha
Cell - Cell
Younger Brother - Younger Brother
Digital Mystery Tour - Digital Mystery Tour
Traceback (most recent call last):
  File "/usr/local/bin/playlistfromsong", line 9, in <module>
    load_entry_point('playlistfromsong==0.12', 'console_scripts', 'playlistfromsong')()
  File "/usr/local/lib/python2.7/dist-packages/playlistfromsong/__main__.py", line 213, in main
    youtubeLinks = useLastFM(song, num)
  File "/usr/local/lib/python2.7/dist-packages/playlistfromsong/__main__.py", line 140, in useLastFM
    for data in p.map(getYoutubeAndRelatedLastFMTracks, lastfmTracks):
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 251, in map
    return self.map_async(func, iterable, chunksize).get()
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 558, in get
    raise self._value
IndexError: list index out of range

$ python --version
Python 2.7.9

Best regards, Dmitry.

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.