16 Commits

Author SHA1 Message Date
Ritiek Malhotra
9ecf957c81 Merge pull request #673 from ritiek/release-v1.2.5
Changes for v1.2.5
2020-03-02 16:06:54 +05:30
Ritiek Malhotra
ea4ff29e52 Changes for v1.2.5 2020-03-02 16:04:00 +05:30
Ritiek Malhotra
33e07bea9d Merge pull request #672 from ritiek/youtube-api-crash
Skip Youtube-API-only fields when scraping
2020-03-02 15:58:55 +05:30
Ritiek Malhotra
94e06f99de Update CHANGELOG 2020-03-02 15:57:09 +05:30
Ritiek Malhotra
9a594d37c7 Skip Youtube-API-only fields when scraping
This happens because YouTube recently disabled older API keys for some
reason, and so the API key being used internally in Pafy no longer
works.

See #671 for more information.
2020-03-02 15:49:21 +05:30
Ritiek Malhotra
b45f75b5ca Merge pull request #667 from AvinashReddy3108/patch-1
Higher bitrate audio conversion.
2020-03-02 10:58:46 +05:30
Avinash Reddy
75114bc26e Update convert.py 2020-03-01 11:01:54 +05:30
Avinash Reddy
456b404e73 Higher bitrate audio conversion.
Changed FFMPEG args to convert to 48k quality audio instead of the current 44k audio.
As @hal1200 says: https://github.com/ritiek/spotify-downloader/issues/620#issuecomment-548964142
Might solve the issue here: https://github.com/ritiek/spotify-downloader/issues/620
2020-02-23 11:52:45 +05:30
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
6 changed files with 37 additions and 10 deletions

View File

@@ -6,6 +6,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
## [1.2.5] - 2020-03-02
### Fixed
- Skip crash when accessing YouTube-API-only fields in scrape mode ([@ritiek](https://github.com/ritiek)) (#672)
### Changed
- Changed FFMPEG args to convert to 48k quality audio instead of the current 44k audio. ([@AvinashReddy3108](https://github.com/AvinashReddy3108)) (#667)
## [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
### Added
- Added `--no-remove-original-file` ([@NightMachinary](https://github.com/NightMachinary)) (#580)

View File

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

View File

@@ -117,7 +117,7 @@ class Converter:
if self.input_ext == ".m4a":
if self.output_ext == ".mp3":
ffmpeg_params = "-codec:v copy -codec:a libmp3lame -ar 44100 "
ffmpeg_params = "-codec:v copy -codec:a libmp3lame -ar 48000 "
elif self.output_ext == ".webm":
ffmpeg_params = "-codec:a libopus -vbr on "
elif self.output_ext == ".m4a":
@@ -125,12 +125,12 @@ class Converter:
elif self.input_ext == ".webm":
if self.output_ext == ".mp3":
ffmpeg_params = "-codec:a libmp3lame -ar 44100 "
ffmpeg_params = "-codec:a libmp3lame -ar 48000 "
elif self.output_ext == ".m4a":
ffmpeg_params = "-cutoff 20000 -codec:a aac -ar 44100 "
ffmpeg_params = "-cutoff 20000 -codec:a aac -ar 48000 "
if self.output_ext == ".flac":
ffmpeg_params = "-codec:a flac -ar 44100 "
ffmpeg_params = "-codec:a flac -ar 48000 "
# add common params for any of the above combination
ffmpeg_params += "-b:a 192k -vn "

View File

@@ -93,7 +93,10 @@ def format_string(
format_tags[9] = tags["track_number"]
format_tags[10] = tags["total_tracks"]
format_tags[11] = tags["external_ids"]["isrc"]
format_tags[12] = tags["id"]
try:
format_tags[12] = tags["id"]
except KeyError:
pass
format_tags_sanitized = {
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):
soup = BeautifulSoup(html, "html.parser")
lyrics_paragraph = soup.find("p")
lyrics = lyrics_paragraph.get_text()
return lyrics
if lyrics_paragraph:
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):
url = self._guess_lyric_url()

View File

@@ -109,8 +109,8 @@ def generate_metadata(content):
"artists": [{"name": None}],
"name": None,
},
"year": content.published.split("-")[0],
"release_date": content.published.split(" ")[0],
"year": None,
"release_date": None,
"type": "track",
"disc_number": 1,
"track_number": 1,
@@ -122,6 +122,14 @@ def generate_metadata(content):
"genre": None,
}
# Workaround for
# https://github.com/ritiek/spotify-downloader/issues/671
try:
meta_tags["year"] = content.published.split("-")[0]
meta_tags["release_date"] = content.published.split(" ")[0]
except pafy.util.GdataError:
pass
return meta_tags