Skip to content

Commit

Permalink
Updated to v3.0.4
Browse files Browse the repository at this point in the history
- Update title and artist attributes with exact values from AZLyrics.com.
- Fixed minor bugs.
  • Loading branch information
elmoiv authored Aug 22, 2020
1 parent 0905f8d commit d49edc2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ Here are a few sample tests:

## Changelog

### v3.0.4 22-08-2020
* Update title and artist attributes with exact values from AZLyrics.com.
* Fixed minor bugs.

### v3.0.3 13-08-2020
* Fixed `getSongs` not returning all songs.

Expand All @@ -77,7 +81,7 @@ Here are a few sample tests:
* You can use search albums, songs and artists.

### v2.0.1 11-09-2019
* First Release
* First Release

## Contributing
Please contribute! If you want to fix a bug, suggest improvements, or add new features to the project, just [open an issue](https://github.com/elmoiv/azapi/issues) or send me a pull request.
Expand All @@ -91,4 +95,4 @@ Please contribute! If you want to fix a bug, suggest improvements, or add new fe

**It is adviced not to send too many requests to avoid IP ban by search engines.*

***Proxy is set by the user, defult is empty.*
***Proxy is set by the user, defult is empty.*
2 changes: 1 addition & 1 deletion azapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
__url__ = 'https://github.com/elmoiv/azapi'
__description__ = 'Get Lyrics from AZLyrics.com like a Boss ~(0_0)~'
__license__ = 'GPL-v3.0'
__version__ = '3.0.3'
__version__ = '3.0.4'
12 changes: 7 additions & 5 deletions azapi/azapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ def getLyrics(self, url=None, ext='txt', save=False, path='', sleep=3):

# Getting Basic metadata from azlyrics
metadata = [elm.text for elm in htmlFindAll(page)('b')]
artist = filtr(metadata[0][:-7], True)
title = filtr(metadata[1][1:-1], True)

# v3.0.4: Update title and artist attributes with exact names
self.artist = filtr(metadata[0][:-7], True)
self.title = filtr(metadata[1][1:-1], True)

lyrics = ParseLyric(page)
self.lyrics = lyrics.strip()
Expand All @@ -94,8 +96,8 @@ def getLyrics(self, url=None, ext='txt', save=False, path='', sleep=3):
p = os.path.join(
path,
'{} - {}.{}'.format(
title.title(),
artist.title(),
self.title.title(),
self.artist.title(),
ext
)
)
Expand All @@ -104,7 +106,7 @@ def getLyrics(self, url=None, ext='txt', save=False, path='', sleep=3):
f.write(lyrics.strip())

# Store lyrics for later usage
self.lyrics_history.append(lyrics)
self.lyrics_history.append(self.lyrics)
return self.lyrics

self.lyrics = 'No lyrics found :('
Expand Down
2 changes: 1 addition & 1 deletion azapi/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ def ParseSongs(page):
'url': 'http://www.azlyrics.com' + a['href'][2:] \
if a['href'][:2] == '..' else a['href']
}
return songs
return songs
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setuptools.setup(
name="azapi",
version="3.0.3",
version="3.0.4",
author="elmoiv",
author_email="[email protected]",
description="Get Lyrics from AZLyrics.com like a Boss ~(0_0)~",
Expand Down

0 comments on commit d49edc2

Please sign in to comment.