8 Commits

Author SHA1 Message Date
Ritiek Malhotra
43f9dd7f8d Merge pull request #655 from ritiek/release-v1.2.4
Bump to v1.2.4
2020-01-10 02:26:41 -08:00
Ritiek Malhotra
b24802f815 Bump to v1.2.4 2020-01-10 15:52:53 +05:30
Ritiek Malhotra
851d88fdd8 Merge pull request #654 from ritiek/fix-genius-lyric-crash
Fix crash when lyrics not yet released on Genius
2020-01-10 02:17:40 -08:00
Ritiek Malhotra
4ee2b51550 Add a changelog entry for #654 2020-01-10 15:34:41 +05:30
Ritiek Malhotra
c73f55b8ce Fix crash when lyrics not yet released on Genius
There are some tracks on Genius whose lyrics are yet to be released.
When the tool previously attempted to scrape such webpages, it
resulted in a crash.
The tool will now raise an exception; LyricNotFoundError when such a
track is encountered, which is then handled internally by the tool.

Example of one such track on Genius:
https://genius.com/The-federal-empire-good-man-lyrics

Fixes #647.
2020-01-10 15:33:02 +05:30
Ritiek Malhotra
e47744f99c Merge pull request #653 from ritiek/fix-keyerror
Fix KeyError when a track isn't found on Spotify
2020-01-10 01:26:05 -08:00
Ritiek Malhotra
5d185844d7 Add a changelog entry for #653 2020-01-10 14:54:36 +05:30
Ritiek Malhotra
7f587fe667 Fix KeyError when a track isn't found on Spotify
Ids only exist for Spotify URIs.

Regression caused by #568. Fixes #649.
2020-01-10 11:42:44 +05:30
4 changed files with 16 additions and 4 deletions

View File

@@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased] ## [Unreleased]
## [1.2.4] - 2020-01-10
### Fixed
- Fixed a crash occuring when lyrics for a track are not yet released
on Genius ([@ritiek](https://github.com/ritiek)) (#654)
- Fixed a regression where a track would fail to download if it isn't
found on Spotify ([@ritiek](https://github.com/ritiek)) (#653)
## [1.2.3] - 2019-12-20 ## [1.2.3] - 2019-12-20
### Added ### Added
- Added `--no-remove-original-file` ([@NightMachinary](https://github.com/NightMachinary)) (#580) - Added `--no-remove-original-file` ([@NightMachinary](https://github.com/NightMachinary)) (#580)

View File

@@ -1 +1 @@
__version__ = "1.2.3" __version__ = "1.2.4"

View File

@@ -93,7 +93,10 @@ def format_string(
format_tags[9] = tags["track_number"] format_tags[9] = tags["track_number"]
format_tags[10] = tags["total_tracks"] format_tags[10] = tags["total_tracks"]
format_tags[11] = tags["external_ids"]["isrc"] format_tags[11] = tags["external_ids"]["isrc"]
format_tags[12] = tags["id"] try:
format_tags[12] = tags["id"]
except KeyError:
pass
format_tags_sanitized = { format_tags_sanitized = {
k: sanitize_title(str(v), ok="'-_()[]{}") if slugification else str(v) k: sanitize_title(str(v), ok="'-_()[]{}") if slugification else str(v)

View File

@@ -37,8 +37,10 @@ class Genius(LyricBase):
def _get_lyrics_text(self, html): def _get_lyrics_text(self, html):
soup = BeautifulSoup(html, "html.parser") soup = BeautifulSoup(html, "html.parser")
lyrics_paragraph = soup.find("p") lyrics_paragraph = soup.find("p")
lyrics = lyrics_paragraph.get_text() if lyrics_paragraph:
return lyrics return lyrics_paragraph.get_text()
else:
raise LyricsNotFound("The lyrics for this track are yet to be released.")
def get_lyrics(self, linesep="\n", timeout=None): def get_lyrics(self, linesep="\n", timeout=None):
url = self._guess_lyric_url() url = self._guess_lyric_url()