Compare commits

...

14 Commits

Author SHA1 Message Date
Yash Agarwal
78be520255 updated urllib version 2019-11-24 15:00:21 +05:30
Yash Agarwal
2808b002a4 Update Pipfile 2019-03-12 20:07:14 +05:30
Yash Agarwal
ececcb26e3 fixing security vulnerabilities 2019-03-12 20:05:33 +05:30
Yash Agarwal
dd80b9b988 Update README.md 2017-07-23 20:40:34 +05:30
Yash Agarwal
fe9f4c1c29 Update README.md 2017-07-23 20:40:04 +05:30
Yash Agarwal
1c95bc6a1d Update README.md 2017-07-23 20:39:16 +05:30
Yash Agarwal
70eff50bc9 Update README.md 2017-07-23 20:36:58 +05:30
Yash Agarwal
51ba71d35b Update README.md 2017-06-22 11:34:03 +05:30
Yash Agarwal
a3efd88c9e Set theme jekyll-theme-dinky 2017-06-22 11:32:53 +05:30
Yash Agarwal
bae46c7009 Set theme jekyll-theme-minimal 2017-06-22 11:31:00 +05:30
Yash Agarwal
c4f503761b Delete data.json 2017-06-17 20:54:56 +05:30
Yash Agarwal
05723d21b0 finalize final pieces of project 2017-06-17 20:53:08 +05:30
Yash Agarwal
7b94319d3f add license and readme.md 2017-06-17 18:50:38 +05:30
Yash Agarwal
cad49aa5b4 add config file 2017-06-17 18:39:56 +05:30
9 changed files with 172 additions and 135 deletions

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 Yash Agarwal
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.

24
Pipfile Normal file
View File

@@ -0,0 +1,24 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
appdirs = "==1.4.3"
beautifulsoup4 = "==4.6.0"
bs4 = "==0.0.1"
certifi = "==2017.4.17"
chardet = "==3.0.4"
idna = "==2.5"
pyparsing = "==2.2.0"
requests = ">=2.20.0"
six = "==1.10.0"
spotipy = "==2.4.4"
urllib3 = ">=1.24.2"
eyeD3 = "==0.8"
titlecase = "*"
[requires]
python_version = "3.7"

117
README.md
View File

@@ -1,8 +1,113 @@
# TODO LIST
<p align="left">
<a href="https://github.com/yash2696/BeautifyMP3/LICENSE">
<img alt="License" src="https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square"/>
</a>
</p>
Basic useful feature list:
## Table of Contents
* implement song metadata fetch from musicbrainz/spotify/discogs/wikipedia/acoustid
* use mutagen instead of eyed3
* implement lyrics fetcher from genius/metrolyrics
* add download functionality from youtube
- [Features](#features)
- [Dependencies](#dependencies)
- [Installing](#installing)
- [Source](#source)
- [Usage](#usage)
- [Options](#options)
- [Contribute](#contribute)
- [License](#license)
## Features
1. Fixes metadata of songs based on data received from Spotify
2. Fetches lyrics from [Genius](https://www.genius.com)
3. Fetches metadata from [Spotify](https://www.spotify.com)
4. Can format filenames of songs
5. Can fetch data for a single song or complete directory
## Dependencies
### [Genius API](https://genius.com/api-clients)
1. Create an account and register an application
2. Grab Access Token
3. Set access token in config file
### [Spotify API](https://developer.spotify.com/my-applications/#!/applications/create)
1. Create an account and register an application
2. Grab Client ID and client Secret Code
3. Set both in config file
```sh
$ python addMetadata.py --config
Enter Genius key : <enter genius key>
Enter Spotify Secret token : <enter client secret here>
Enter Spotify Client ID : <enter client id here>
```
## Installing
### Source
```sh
$ git clone https://github.com/yash2696/BeautifyMP3
$ cd BeautifyMP3
$ python setup.py install
```
### Options
```sh
(music-tagger) ~/D/music-tagger python addMetadata.py -h
usage: addMetadata.py [-h] [-d REPAIR_DIRECTORY] [-s SONG_NAME] [-c] [-n]
[-f RENAME_FORMAT]
____ _ _ __ __ __ ____ _____
| __ ) ___ __ _ _ _| |_(_)/ _|_ _| \/ | _ \___ /
| _ \ / _ \/ _` | | | | __| | |_| | | | |\/| | |_) ||_ \
| |_) | __/ (_| | |_| | |_| | _| |_| | | | | __/___) |
|____/ \___|\__,_|\__,_|\__|_|_| \__, |_| |_|_| |____/
|___/
______________________________________________________________
| |
| Edit Metadata of MP3 files based on file name |
|____________________________________________________________|
optional arguments:
-h, --help show this help message and exit
-d REPAIR_DIRECTORY, --dir REPAIR_DIRECTORY
give path of music files directory
-s SONG_NAME, --song SONG_NAME
Only fix metadata of the file specified
-c, --config Add API Keys to config
-n, --norename Does not rename files to song title
-f RENAME_FORMAT, --format RENAME_FORMAT
Specify the Name format used in renaming, Valid
Keywords are: {title}{artist}{album} )
```
## TODO
- [ ] Add download functionality from youtube
- [ ] add support for last.fm and soundcloud if spotify fails
- [ ] add support for metrolyrics and other lyrics service if genius api fails
- [ ] add support for searching with existing id3 tags if searching with name fails
- [ ] somehow find a way to properly synchronize the lyrics with sound if possible
- [ ] add support for other file types(aac, flac etc)
## Contribute
Found an issue? Post it in the [issue tracker](https://github.com/yash2696/BeautifyMP3/issues). <br>
Want to add another awesome feature? [Fork](https://github.com/yash2696/BeautifyMP3/fork) this repository and add your feature, then send a pull request.
## Disclaimer
The inspiration for this project is [MusicRepair](https://github.com/kalbhor/MusicRepair).
Downloading copyright songs is illegal in most of the countries. I made this tool for educational purposes and was created for my python learning process. Please support the artists by buying their music.
## License
The MIT License (MIT)
Copyright (c) 2017 Yash Agarwal

1
_config.yml Normal file
View File

@@ -0,0 +1 @@
theme: jekyll-theme-dinky

View File

@@ -2,6 +2,13 @@
DESC = """
____ _ _ __ __ __ ____ _____
| __ ) ___ __ _ _ _| |_(_)/ _|_ _| \/ | _ \___ /
| _ \ / _ \/ _` | | | | __| | |_| | | | |\/| | |_) ||_ \
| |_) | __/ (_| | |_| | |_| | _| |_| | | | | __/___) |
|____/ \___|\__,_|\__,_|\__|_|_| \__, |_| |_|_| |____/
|___/
______________________________________________________________
| |
| Edit Metadata of MP3 files based on file name |

5
config.ini Normal file
View File

@@ -0,0 +1,5 @@
[keys]
genius_key = "ZUJIqo22ukxypJjMlpVDpHAlMlYGxHnGJ8ipq3K9H-RcNMvhaEoNe_o97gVCRl3J"
spotify_client_id = "622a0e16a4914e3eadc2a37b4a134f1e"
spotify_client_secret = "6fe008a8b7754954a58a9849fa3172df"

109
data.json
View File

@@ -1,109 +0,0 @@
{
'release-group':{
'type':'Soundtrack',
'primary-type':'Album',
'id':'90a8152a-29aa-440a-a783-faf8bf435be3',
'secondary-type-list':[
'Soundtrack'
]
},
'medium-list':[
{
'track-list':[
],
'track-count':11,
'disc-list':[
],
'format':'Digital Media',
'disc-count':0
}
],
'country':'IN',
'barcode':'',
'packaging':'None',
'id':'2036808f-d484-4d00-b8f3-819e344bb131',
'artist-credit':[
{
'artist':{
'name':'Mithoon',
'id':'7f74ac10-e2f0-480a-be9b-82264d2078a9',
'disambiguation':'Indian composer and playback singer',
'sort-name':'Mithoon'
}
},
'/',
{
'artist':{
'name':'Tanishk Bagchi',
'id':'2eeb1326-b91e-470f-b210-d07b54f5334a',
'sort-name':'Bagchi, Tanishk'
}
},
'/',
{
'artist':{
'name':'Rishi Rich',
'id':'9b52b90b-9858-4463-b20d-7e00480c4714',
'sort-name':'Rishi Rich'
}
},
'/',
{
'artist':{
'name':'Farhan Saeed',
'id':'78af11d1-d351-4229-ad79-1112068cb1ab',
'sort-name':'Saeed, Farhan'
}
},
'/',
{
'artist':{
'name':'Ami Mishra',
'id':'cf9f2995-3a44-4bf3-b4e5-7847c68be644',
'sort-name':'Mishra, Ami'
}
},
'/',
{
'artist':{
'name':'Rahul Mishra',
'id':'9202f366-c50d-48b6-a069-47f24b26a3d1',
'sort-name':'Rahul Mishra'
}
}
],
'release-event-list':[
{
'area':{
'name':'India',
'iso-3166-1-code-list':[
'IN'
],
'id':'d31a9a15-537f-3669-ad53-25753ddd2772',
'sort-name':'India'
},
'date':'2017-04-28'
}
],
'ext:score':'100',
'text-representation':{
'language':'eng',
'script':'Latn'
},
'date':'2017-04-28',
'medium-count':1,
'artist-credit-phrase':'Mithoon/Tanishk Bagchi/Rishi Rich/Farhan Saeed/Ami Mishra/Rahul Mishra',
'title':'Half Girlfriend',
'label-info-list':[
{
'label':{
'name':'Zee Music',
'id':'b0d52317-46e4-4208-98f3-926f1a67397b'
}
}
],
'medium-track-count':11,
'status':'Official'
}

View File

@@ -1,17 +0,0 @@
appdirs==1.4.3
beautifulsoup4==4.6.0
bs4==0.0.1
certifi==2017.4.17
chardet==3.0.4
eyeD3==0.8
idna==2.5
musicbrainzngs==0.6
musictools==2.1.4
mutagen==1.38
packaging==16.8
pyparsing==2.2.0
requests==2.17.3
six==1.10.0
spotipy==2.4.4
urllib3==1.21.1
youtube-dl==2017.6.5

View File

@@ -1,12 +1,12 @@
from distutils.core import setup
setup(
name='music-tagger',
name='BeautifyMP3',
version='1.0.0',
packages=[''],
url='https://github.com/yash2696/MP3Repair',
url='https://github.com/yash2696/BeautifyMP3',
license='MIT',
author='Yash Agarwal',
author_email='yashagarwaljpr@gmail.com',
description=''
description='A tool to automatically fix MP3 file metadata and filenames.'
)