Giter VIP home page Giter VIP logo

instant-music-downloader's Introduction

Instantly download any song! 🎸 🎢 🎼 🎺 🎻

Join the chat at https://gitter.im/yask123/Instant-Music-Downloader Build Status PyPI

Buy me a coffee

Without knowing its name!!

This is so cool!

Installation by Pip

For Python 2.7

$  pip install instantmusic

For Python 3.4

$ pip3 install instantmusic

Note:

You would also need libav to download in .mp3 format.

On Mac Os X

Installation by Brew
 $ brew install libav

On Ubuntu

 $ sudo apt-get install libav-tools 

On Windows

See this

Usage

$ instantmusic 
>> Enter songname/ lyrics/ artist.. or whatever

i tried so hard and got so far 

>>Downloaded Linkin Park - In The End
>> Enter songname/ lyrics/ artist.. or whatever

another turning point a fork stuck in the road

>>Downloaded Green Day - Good Riddance
>> Enter songname/ lyrics/ artist.. or whatever

yeh hosla kaise jhuke

>>Downloaded Yeh Hausla Kaise Jhuke - Salim-Sulaiman

Options

❯ instantmusic -h                                                   
usage: instantmusic [-h] [-p] [-q] [-s SONG [SONG ...]]
                    [-l SONGLIST [SONGLIST ...]] [-f FILE [FILE ...]]

Instantly download any song!

optional arguments:
  -h, --help            show this help message and exit
  -p                    Turn off download prompts
  -q                    Run in quiet mode. Automatically turns off prompts.
  -s SONG [SONG ...]    Download a single song.
  -l SONGLIST [SONGLIST ...]
                        Download a list of songs, with lyrics separated by a
                        comma (e.g. "i tried so hard and got so far, blackbird
                        singing in the dead of night, hey shawty it's your
                        birthday).
  -f FILE [FILE ...]    Download a list of songs from a file input. Each line
                        in the file is considered one song.

MP3 Tags

WIP

The script automatically embeds id3 tags to the downloaded .mp3 file.

It will grab following meta data:

  1. Track title (From YT)
  2. Artist (From YT)
  3. Album name (From metrolyrics.com)
  4. Album art (From google images)
  5. Lyrics (From metrolyrics.com)

$ sudo pip install fixalbumart

❯cd MyMusic

❯fixalbumart

>> Fixing taylor swift - love story
>> In the end - Linkin park 
......

>> Fixed all songs

Video

Demo

Requirements

  1. Youtube-dl
  2. BeautifulSoup

Disclaimer

Downloading copyrighted material may be illegal in your country. Use at your own risk.

The MIT License

Copyright (c) 2015 Yask Srivastava http://iyask.me

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

instant-music-downloader's People

Contributors

ajouellette avatar atuljangra avatar aviaryan avatar bhavyagoyal avatar bhrigu123 avatar bitdeli-chef avatar dhamaniasad avatar gitter-badger avatar hut8 avatar jaybosamiya avatar kromanenko avatar kunalsinghal avatar mihaiolteanu avatar mondayrain avatar omaraboumrad avatar ritiek avatar shubh1m avatar sulami avatar vayan avatar vinayak-mehta avatar vincentdcmps avatar williamn avatar yask123 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  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

instant-music-downloader's Issues

I get a mebm file

I'm trying to download an mp3, but I can only download webm files. How can I get an mp3 instead?

Error while downloading

every time i try to download some song it gives me an error with the following details. can you help?

local variable 'audiofile' referenced before assignment
couldnt get album art

Pipe file to music player

Would be cool if instantmusic could accept an argument to launch a program

so like
instantmusic -p vlc

and after instantmusic is done, it would launch vlc <song.mp3>

Add Windows Installation

Write a script to install this script in windows .
The script should copy the main script to a folder and add that location's path in it's windows environment location so that the script can be invoked from any directory.

Case sensitivity ("Download song (y/n)")

Responding with "Y" or "yes" causes application to quit with no feedback. Ideally the prompt should accept all reasonable inputs, or provide feedback upon quitting ("Please respond with "y" or "n")

feature: Metadata

What if this could grab the relevant file metadata + file title and apply it after it's been downloaded from YouTube automagically? Would definitely help keep an iTunes library clean.

/usr/local/bin/youtube-dl: Permission denied

Aarons-MacBook-Air:~ Aaron$ sudo instantmusic
Password:
Enter songname/ lyrics/ artist.. or whatever

Cheerleader
Making a Query Request!
Found: OMI - Cheerleader (Felix Jaehn Remix) [Official Video]
Download song (y/n)? y
Downloading...
sh: /usr/local/bin/youtube-dl: Permission denied
Aarons-MacBook-Air:~ Aaron$

Add Web Interface and/or REST API

Some of my not-so-technical friends have expressed interest in being able to use this tool, and I don't think I would be successful in trying to convince them to use the command line :D

Thinking of creating a very simple web interface and hosting it on a DO droplet somewhere, if that is cool with you @yask123. If I did, would you want the page to be called "Instant Music Downloader" or something else..?

feature: command line options

a -y or --yes flag for accepting the Download song (y/n) prompt?
would make using this program in shell scripts easier πŸ˜„

Add License

It looks like you have MIT listed in a few places on the project, but it would be nice to have a license in the project and maybe a note of it in the README so it's clear to everyone how you want it used. Thanks!

Mac OS X install issues

Hello, On Mac OS X I could not get this installed until I searched and used an easy_install command, which then had a ton of errors, needing sudo. It finally installed. I am finding it is not terribly great at matching the type of music I am looking for, which is rather mainstream to be honest.

Current issue:
Once it does find a song, I select "y" and get the below error, which I am sure is installed in /Library as I can see it there.
sh: youtube-dl: command not found

Also, is there a help or man page, where do I configure where downloads go, what format they are in, specific perhaps minimum bitrates etc? Where are the songs sourced from ,are these all youtube rips?

error when reading from stdin

antino:~ ant$ echo abc | instantmusic
Enter songname/ lyrics/ artist.. or whatever
> Making a Query Request!
Found: ABC SONG | ABC Songs for Children - 13 Alphabet Songs & 26 Videos
Download song (y/n)? Traceback (most recent call last):
  File "/usr/local/bin/instantmusic", line 37, in <module>
    prompt = raw_input("Download song (y/n)? ")
EOFError: EOF when reading a line
antino:~ ant$

the Download song (y/n) prompt immediately errors out when piping text to instantmusic

Tag data for songs

Currently, downloaded songs don't have artist, album and other details. It would be a nice feature if these details could be added automatically.

Crash when printing unicode results

Traceback (most recent call last):
  File "C:\Program Files (x86)\Python 3.5\Scripts\instantmusic.py", line 36, in <module>
    print("Found: " + title)
  File "c:\program files (x86)\python 3.5\lib\encodings\cp437.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2013' in position 35: character maps to <undefined>

A quick soln would be to add import sys and then replace the print line with:

print("Found: " + title.encode('utf8').decode(sys.stdout.encoding))

This should allow nice results on *nix and garbled but at least working results on windows

TypeError: sequence item 0: expected str instance, bytes found

Traceback (most recent call last):
  File "/usr/local/bin/instantmusic", line 277, in <module>
    main()
  File "/usr/local/bin/instantmusic", line 274, in main
    print('Downloaded: %s' % ', '.join(downloads))

In a bunch of places you use the content field of the response from requests.get(), when you should be using the text since you're dealing with HTML, which has an encoding. I'm pretty sure that if you change all of those, except if you are actually dealing with binary content (I haven't looked yet), then you can fix this.

This is python 3 specific.

I'll put in a PR tonight if I get a chance.

"sh: youtube-dl: command not found" error on Mac

After a fresh sudo pip install instantmusic on Mac, choosing a song would result in the following output:

Download "song-name"? (y/n) y
Downloading
sh: youtube-dl: command not found
Fixing id3 tags
Traceback (most recent call last):
  File "/usr/local/bin/instantmusic", line 196, in <module>
    main()
  File "/usr/local/bin/instantmusic", line 139, in main
    downloaded = query_and_download(search)
  File "/usr/local/bin/instantmusic", line 107, in query_and_download
    audiofile = eyed3.load((title+'.mp3'))
  File "/Library/Python/2.7/site-packages/eyed3/core.py", line 81, in load
    raise IOError("file not found: %s" % path)
IOError: file not found: song-name.mp3

The root of the problem was obviously youtube-dl. I looked into it and for some reason pip downloaded the youtube-dl requirement but no executable in resulted from it (in /usr/local/bin/ or anywhere else). I'm not sure if this is just my configuration with pip (or something else entirely) or not but a simple

brew install youtube-dl

got things working for me. If I'm not the only Mac user with this error, you might consider adding the above command under the Mac installation documentation. If you know what my error is with youtube-dl not being available upon installing with pip, any tips on how to get it fixed would be appreciated.

add a list/file maker to create a file for downloading

It would be great if there was an option to isolate the search function and write the chosen results to a file, so they could all be downloaded at the same time. So that a playlist can be made. I've found that searching for the full url of the video will make that the first result. Same search function that pulls up the 10 first options, and then you choose which one will be added to a file.
something like:
instantmusic -c file.txt

Wrong indentation

I got this error:

instantmusic
File "/usr/bin/instantmusic", line 131
try:
^
TabError: inconsistent use of tabs and spaces in indentation

BTW: I'm using python3

Python3 breaks id3 tagging

Greetings,

When using a 3.x version of Python, id3 tags are unable to be inserted into downloaded files. An error:

Fixing id3 tags
a bytes-like object is required, not 'str'

..and the resulting file has no tags.

When using a 2.x version, I see a few extra lines of output:

WARNING: "id" field is not a string - forcing string conversion
-snip-
Fixing id3 tags
Invalid URL '': No schema supplied. Perhaps you meant http://?

but the resulting file is correct.

Not able to download in mp3 format

I have tried this script 7-8 times now and I have never been able to download music in .mp3 format.
It is either *.m4a or *.webm .
Can something be done here ?

Issue installing on mac 10.11.1

I got the following issue installing the package from PyPi:

mac:~ Huomenta$ pip search instantmusic
instantmusic - Instantly download any song! Without knowing the name of
the song!!!!
mac:~ Huomenta$ sudo pip install instantmusic
The directory '/Users/Huomenta/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/Huomenta/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting instantmusic
Downloading instantmusic-2.2.tar.gz
Collecting youtube-dl (from instantmusic)
Downloading youtube_dl-2015.11.02-py2.py3-none-any.whl (1.1MB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.1MB 102kB/s
Collecting BeautifulSoup4 (from instantmusic)
Downloading beautifulsoup4-4.4.1-py2-none-any.whl (81kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 81kB 109kB/s
Collecting eyed3 (from instantmusic)
Downloading eyeD3-0.7.8.tar.gz (226kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 229kB 123kB/s
Collecting requests (from instantmusic)
Downloading requests-2.8.1-py2.py3-none-any.whl (497kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 499kB 93kB/s
Installing collected packages: youtube-dl, BeautifulSoup4, eyed3, requests, instantmusic
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/commands/install.py", line 311, in run
root=options.root_path,
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_set.py", line 646, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_install.py", line 803, in install
self.move_wheel_files(self.source_dir, root=root)
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_install.py", line 998, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/wheel.py", line 371, in move_wheel_files
clobber(source, dest, False, fixer=fixer, filter=filter)
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/wheel.py", line 310, in clobber
ensure_dir(destdir)
File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/utils/init.py", line 71, in ensure_dir
os.makedirs(path)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 1] Operation not permitted: '/System/Library/Frameworks/Python.framework/Versions/2.7/etc'
mac:~ Huomenta$

Why only first search?

Just asked for song via lyrics listen to the bullshit he learned in school
Go something like Anita Sarkeesian bullshit taught in schools 11-12 grade as a result.

I get the same link in youtube as first search. Even though the actual song was in the 4th place in that search.

Why we are depending on first search? And especially even if it maybe not a song on the first search.

Can't we have multiple options list?.

Installation from source

Unable to install using command on ubuntu, so i tried installing using source. But it does not go any further than installing bf4. Can you help?

Fix pip Windows installation

Currently pip installation of instantmusic on Windows is unusable. This is because of the lack of console_scripts parameter in setup.py due to which no executable is created for series-renamer.

As a result, you get this error -

> instantmusic
'instantmusic' is not recognized as an internal or external command,
operable program or batch file.

To fix this, a console_script entry point is needed.
Example : https://github.com/aviaryan/series-renamer/blob/master/setup.py#L28

The above setup works on all platforms perfectly.

Failed at audioconversion says unknown encoder 'libmp3lame'

On downloading song I get the following warnings and error on Ubuntu 12.04 machine

WARNING: Your copy of avconv is outdated, update avconv to version 10-0 or newer if you encounter any errors.
[avconv] Destination: New hd song (Suno na sange mar mar)-8gc4U6L2hZM.mp3
WARNING: Your copy of avconv is outdated, update avconv to version 10-0 or newer if you encounter any errors.
ERROR: audio conversion failed: Unknown encoder 'libmp3lame'

I tried updating libav-tools but it is already the newest version.

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.