Skip to content

Commit

Permalink
Make mp3 conversion as default
Browse files Browse the repository at this point in the history
  • Loading branch information
shantanugoel authored and SathyaBhat committed Mar 15, 2017
1 parent 24c783e commit 74c8b75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions spotify_dl/spotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def save_songs_to_file(songs, directory):
f.close()


def download_songs(info, download_directory, format_string, convert_to_mp3):
def download_songs(info, download_directory, format_string, skip_mp3):
"""
Downloads songs from the YouTube URL passed to either
current directory or download_directory, is it is passed
Expand All @@ -89,7 +89,7 @@ def download_songs(info, download_directory, format_string, convert_to_mp3):
],
'postprocessor_args': ['-metadata', 'title=' + str(track_)],
}
if convert_to_mp3:
if not skip_mp3:
mp3_postprocess_opts = {
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
Expand Down
8 changes: 4 additions & 4 deletions spotify_dl/spotify_dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def spotify_dl():
parser.add_argument('-f', '--format_str', type=str, action='store',
nargs='*', help='Specify youtube-dl format string.',
default=['bestaudio/best'])
parser.add_argument('-m', '--mp3', action='store_true',
help='Convert downloaded songs to mp3')
parser.add_argument('-m', '--skip_mp3', action='store_true',
help='Don\'t convert downloaded songs to mp3')

args = parser.parse_args()

Expand All @@ -52,7 +52,7 @@ def spotify_dl():

log.info('Starting spotify_dl')
log.debug('setting debug mode on spotify_dl')

if not check_for_tokens():
exit(1)

Expand Down Expand Up @@ -96,7 +96,7 @@ def spotify_dl():

save_songs_to_file(url, download_directory)
if args.download is True:
download_songs(url, download_directory, args.format_str[0], args.mp3)
download_songs(url, download_directory, args.format_str[0], args.skip_mp3)


if __name__ == '__main__':
Expand Down

0 comments on commit 74c8b75

Please sign in to comment.