mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
Fix errors introduced with previous code cleanup
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user