mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
Fix last errors of PEP8 refactoring
This commit is contained in:
@@ -75,7 +75,7 @@ def generate_youtube_url(raw_song):
|
|||||||
# fetch all video links on first page on YouTube
|
# fetch all video links on first page on YouTube
|
||||||
for x in items_parse.find_all('h3', {'class': 'yt-lockup-title'}):
|
for x in items_parse.find_all('h3', {'class': 'yt-lockup-title'}):
|
||||||
# confirm the video result is not an advertisement
|
# confirm the video result is not an advertisement
|
||||||
if x.find('channel') > -1 or x.find('googleads') > -1:
|
if x.find('channel') is None and x.find('googleads') is None:
|
||||||
print('{0}. {1}'.format(check, x.get_text()))
|
print('{0}. {1}'.format(check, x.get_text()))
|
||||||
links.append(x.find('a')['href'])
|
links.append(x.find('a')['href'])
|
||||||
check += 1
|
check += 1
|
||||||
@@ -130,8 +130,8 @@ def feed_playlist(username):
|
|||||||
# is None. Skip these. Also see Issue #91.
|
# is None. Skip these. Also see Issue #91.
|
||||||
if playlist['name'] is not None:
|
if playlist['name'] is not None:
|
||||||
print('{0}. {1} ({2} tracks)'.format(
|
print('{0}. {1} ({2} tracks)'.format(
|
||||||
check, misc.fix_encoding(playlist['name'])),
|
check, misc.fix_encoding(playlist['name']),
|
||||||
playlist['tracks']['total'])
|
playlist['tracks']['total']))
|
||||||
links.append(playlist)
|
links.append(playlist)
|
||||||
check += 1
|
check += 1
|
||||||
if playlists['next']:
|
if playlists['next']:
|
||||||
@@ -283,7 +283,7 @@ def grab_single(raw_song, number=None):
|
|||||||
output_song = music_file + args.output_ext
|
output_song = music_file + args.output_ext
|
||||||
convert.song(input_song, output_song, avconv=args.avconv,
|
convert.song(input_song, output_song, avconv=args.avconv,
|
||||||
verbose=args.verbose)
|
verbose=args.verbose)
|
||||||
os.remove('Music/{0}'.format(file))
|
os.remove('Music/{0}'.format(input_song))
|
||||||
meta_tags = generate_metadata(raw_song)
|
meta_tags = generate_metadata(raw_song)
|
||||||
if not args.no_metadata:
|
if not args.no_metadata:
|
||||||
metadata.embed(output_song, meta_tags)
|
metadata.embed(output_song, meta_tags)
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ def test_download():
|
|||||||
|
|
||||||
|
|
||||||
def test_convert():
|
def test_convert():
|
||||||
# exit code None = success
|
# exit code 0 = success
|
||||||
expect_convert = None
|
expect_convert = 0
|
||||||
content = spotdl.go_pafy(raw_song)
|
content = spotdl.go_pafy(raw_song)
|
||||||
music_file = spotdl.misc.generate_filename(content.title)
|
music_file = spotdl.misc.generate_filename(content.title)
|
||||||
music_file = spotdl.misc.fix_decoding(music_file)
|
music_file = spotdl.misc.fix_decoding(music_file)
|
||||||
|
|||||||
Reference in New Issue
Block a user