From 920c065fd8d1e85c95930bd35751bd0e5cbddfab Mon Sep 17 00:00:00 2001 From: Linus Date: Wed, 5 Jul 2017 21:28:27 +0200 Subject: [PATCH] Fix last errors of PEP8 refactoring --- spotdl.py | 8 ++++---- test/test_single.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spotdl.py b/spotdl.py index 86acc17..1298d39 100755 --- a/spotdl.py +++ b/spotdl.py @@ -75,7 +75,7 @@ def generate_youtube_url(raw_song): # fetch all video links on first page on YouTube for x in items_parse.find_all('h3', {'class': 'yt-lockup-title'}): # 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())) links.append(x.find('a')['href']) check += 1 @@ -130,8 +130,8 @@ def feed_playlist(username): # is None. Skip these. Also see Issue #91. if playlist['name'] is not None: print('{0}. {1} ({2} tracks)'.format( - check, misc.fix_encoding(playlist['name'])), - playlist['tracks']['total']) + check, misc.fix_encoding(playlist['name']), + playlist['tracks']['total'])) links.append(playlist) check += 1 if playlists['next']: @@ -283,7 +283,7 @@ def grab_single(raw_song, number=None): output_song = music_file + args.output_ext convert.song(input_song, output_song, avconv=args.avconv, verbose=args.verbose) - os.remove('Music/{0}'.format(file)) + os.remove('Music/{0}'.format(input_song)) meta_tags = generate_metadata(raw_song) if not args.no_metadata: metadata.embed(output_song, meta_tags) diff --git a/test/test_single.py b/test/test_single.py index d1ac20a..d4f288c 100644 --- a/test/test_single.py +++ b/test/test_single.py @@ -41,8 +41,8 @@ def test_download(): def test_convert(): - # exit code None = success - expect_convert = None + # exit code 0 = success + expect_convert = 0 content = spotdl.go_pafy(raw_song) music_file = spotdl.misc.generate_filename(content.title) music_file = spotdl.misc.fix_decoding(music_file)