mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-12-08 20:39:08 +00:00
Show no metadata warning before download
This commit is contained in:
18
spotdl.py
18
spotdl.py
@@ -137,13 +137,7 @@ def grab_single(raw_song, number=None):
|
|||||||
meta_tags = spotify_tools.generate_metadata(raw_song)
|
meta_tags = spotify_tools.generate_metadata(raw_song)
|
||||||
content = youtube_tools.go_pafy(raw_song, meta_tags)
|
content = youtube_tools.go_pafy(raw_song, meta_tags)
|
||||||
|
|
||||||
if const.args.download_only_metadata:
|
if const.args.download_only_metadata and meta_tags is None:
|
||||||
if meta_tags is None:
|
|
||||||
log.info('Found No metadata. Skipping the download')
|
|
||||||
return
|
|
||||||
|
|
||||||
if const.args.download_only_metadata:
|
|
||||||
if meta_tags is None:
|
|
||||||
log.info('Found No metadata. Skipping the download')
|
log.info('Found No metadata. Skipping the download')
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -158,11 +152,14 @@ def grab_single(raw_song, number=None):
|
|||||||
# generate file name of the song to download
|
# generate file name of the song to download
|
||||||
songname = content.title
|
songname = content.title
|
||||||
|
|
||||||
if meta_tags:
|
if meta_tags is not None:
|
||||||
refined_songname = internals.generate_songname(meta_tags)
|
refined_songname = internals.generate_songname(meta_tags)
|
||||||
log.debug('Refining songname from "{0}" to "{1}"'.format(songname, refined_songname))
|
log.debug('Refining songname from "{0}" to "{1}"'.format(songname, refined_songname))
|
||||||
if not refined_songname == ' - ':
|
if not refined_songname == ' - ':
|
||||||
songname = refined_songname
|
songname = refined_songname
|
||||||
|
else:
|
||||||
|
log.warning('Could not find metadata')
|
||||||
|
|
||||||
|
|
||||||
if const.args.dry_run:
|
if const.args.dry_run:
|
||||||
return
|
return
|
||||||
@@ -187,11 +184,8 @@ def grab_single(raw_song, number=None):
|
|||||||
if not const.args.input_ext == const.args.output_ext:
|
if not const.args.input_ext == const.args.output_ext:
|
||||||
os.remove(os.path.join(const.args.folder, input_song))
|
os.remove(os.path.join(const.args.folder, input_song))
|
||||||
|
|
||||||
if not const.args.no_metadata:
|
if not const.args.no_metadata and meta_tags is not None:
|
||||||
if meta_tags:
|
|
||||||
metadata.embed(os.path.join(const.args.folder, output_song), meta_tags)
|
metadata.embed(os.path.join(const.args.folder, output_song), meta_tags)
|
||||||
else:
|
|
||||||
log.warning('Could not find metadata')
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
log.error('No audio streams available')
|
log.error('No audio streams available')
|
||||||
|
|||||||
Reference in New Issue
Block a user