mirror of
				https://github.com/KevinMidboe/spotify-downloader.git
				synced 2025-10-29 18:00:15 +00:00 
			
		
		
		
	Add --dry-run option (#190)
This commit is contained in:
		@@ -72,6 +72,10 @@ def get_arguments():
 | 
			
		||||
    parser.add_argument(
 | 
			
		||||
        '-o', '--output-ext', default='.mp3',
 | 
			
		||||
        help='prefered output extension .mp3 or .m4a (AAC)')
 | 
			
		||||
    parser.add_argument(
 | 
			
		||||
        '-d', '--dry-run', default=False,
 | 
			
		||||
        help='Show only track title and YouTube URL',
 | 
			
		||||
        action='store_true')
 | 
			
		||||
    parser.add_argument(
 | 
			
		||||
        '-ll', '--log-level', default='INFO',
 | 
			
		||||
        choices=_LOG_LEVELS_STR,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										11
									
								
								spotdl.py
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								spotdl.py
									
									
									
									
									
								
							@@ -167,7 +167,6 @@ def generate_youtube_url(raw_song, meta_tags, tries_remaining=5):
 | 
			
		||||
    else:
 | 
			
		||||
        full_link = None
 | 
			
		||||
 | 
			
		||||
    log.debug('Best matching video link: {}'.format(full_link))
 | 
			
		||||
    return full_link
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -418,9 +417,10 @@ def grab_single(raw_song, number=None):
 | 
			
		||||
        log.debug('Found no matching video')
 | 
			
		||||
        return
 | 
			
		||||
 | 
			
		||||
    # log '[number]. [artist] - [song]' if downloading from list
 | 
			
		||||
    # otherwise log '[artist] - [song]'
 | 
			
		||||
    log.info(get_youtube_title(content, number))
 | 
			
		||||
    # "[number]. [artist] - [song]" if downloading from list
 | 
			
		||||
    # otherwise "[artist] - [song]"
 | 
			
		||||
    youtube_title = get_youtube_title(content, number)
 | 
			
		||||
    log.info('{} ({})'.format(youtube_title, content.watchv_url))
 | 
			
		||||
    # generate file name of the song to download
 | 
			
		||||
    songname = content.title
 | 
			
		||||
 | 
			
		||||
@@ -430,6 +430,9 @@ def grab_single(raw_song, number=None):
 | 
			
		||||
        if not refined_songname == ' - ':
 | 
			
		||||
            songname = refined_songname
 | 
			
		||||
 | 
			
		||||
    if args.dry_run:
 | 
			
		||||
        return
 | 
			
		||||
 | 
			
		||||
    file_name = internals.sanitize_title(songname)
 | 
			
		||||
 | 
			
		||||
    if not check_exists(file_name, raw_song, meta_tags):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user