diff --git a/core/convert.py b/core/convert.py index d8ce3e9..e6d1bfe 100644 --- a/core/convert.py +++ b/core/convert.py @@ -77,7 +77,7 @@ def convert_with_ffmpeg(input_song, output_song, verbose): elif output_ext == 'm4a': ffmpeg_params = '-cutoff 20000 -c:a libfdk_aac -b:a 192k -vn ' - command = '{0}-i Music/{1} {2}Music/{4}'.format( + command = '{0}-i Music/{1} {2}Music/{3}'.format( ffmpeg_pre, input_song, ffmpeg_params, output_song).split(' ') return subprocess.call(command) diff --git a/spotdl.py b/spotdl.py index 41bfd41..86acc17 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 not x.find('channel') == -1 or not x.find('googleads') == -1: + if x.find('channel') > -1 or x.find('googleads') > -1: print('{0}. {1}'.format(check, x.get_text())) links.append(x.find('a')['href']) check += 1 @@ -91,7 +91,7 @@ def generate_youtube_url(raw_song): # confirm the video result is not an advertisement # otherwise keep iterating until it is not - while result.find('channel') < 0 or result.find('googleads') < 0: + while result.find('channel') > -1 or result.find('googleads') > -1: result = items_parse.find_all( attrs={'class': 'yt-uix-tile-link'})[check]['href'] check += 1