# Buggy code
def override_config(config_file, parser, raw_args=None):
    """Override default dict with config dict passed as comamnd line argument."""
    config_file = os.path.realpath(config_file)
    config = merge(default_conf["spotify-downloader"], get_config(config_file))

    parser.set_defaults(avconv=config["avconv"])
    parser.set_defaults(download_only_metadata=config["download-only-metadata"])
    parser.set_defaults(dry_run=config["dry-run"])
    parser.set_defaults(file_format=config["file-format"])
    parser.set_defaults(folder=os.path.relpath(config["folder"], os.getcwd()))
    parser.set_defaults(input_ext=config["input-ext"])
    parser.set_defaults(log_level=config["log-level"])
    parser.set_defaults(manual=config["manual"])
    parser.set_defaults(music_videos_only=config["music-videos-only"])
    parser.set_defaults(no_metadata=config["no-metadata"])
    parser.set_defaults(no_spaces=config["no-spaces"])
    parser.set_defaults(output_ext=config["output-ext"])
    parser.set_defaults(overwrite=config["overwrite"])

    return parser.parse_args(raw_args)


# Traceback (urllib.error.HTTPError)
$ python ./spotdl.py -l ./playlist.txt -f /d/Music\ 02/ --log-level DEBUG

DEBUG: Python version: 3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)]
DEBUG: Platform: Windows-10-10.0.14393-SP0
DEBUG: {'album': None,
'avconv': False,
'config': None,
'download_only_metadata': False,
'dry_run': False,
'file_format': '{artist} - {track_name}',
'folder': 'D:/Music 02/',
'input_ext': '.m4a',
'list': './playlist.txt',
'log_level': 10,
'manual': False,
'music_videos_only': False,
'no_metadata': False,
'no_spaces': False,
'output_ext': '.mp3',
'overwrite': 'prompt',
'playlist': None,
'song': None,
'username': None}
INFO: Preparing to download 3 songs

DEBUG: Fetching metadata for given track URL
DEBUG: Fetching lyrics
<<(Truncated Meta Output)>>
DEBUG: query: {'part': 'snippet', 'maxResults': 50, 'type': 'video', 'q': 'Arctic Monkeys - R U Mine?'}
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\pafy\util.py", line 34, in call_gdata
data = g.opener.open(url).read().decode('utf-8')
File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 532, in open
response = meth(req, response)
File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 570, in error
return self._call_chain(*args)
File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 504, in _call_chain
result = func(*args)
File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./spotdl.py", line 185, in <module>
download_list(text_file=const.args.list)
File "./spotdl.py", line 79, in download_list
download_single(raw_song, number=number)
File "./spotdl.py", line 116, in download_single
content = youtube_tools.go_pafy(raw_song, meta_tags)
File "C:\Users\Jason Cemra\Downloads\spotify-downloader-master\core\youtube_tools.py", line 22, in go_pafy
track_url = generate_youtube_url(raw_song, meta_tags)
File "C:\Users\Jason Cemra\Downloads\spotify-downloader-master\core\youtube_tools.py", line 84, in generate_youtube_url
data = pafy.call_gdata('search', query)
File "C:\ProgramData\Anaconda3\lib\site-packages\pafy\util.py", line 42, in call_gdata
raise GdataError(errmsg)
pafy.util.GdataError: Youtube Error 403: The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.

# Fixed code
def override_config(config_file, parser, raw_args=None):
    """Override default dict with config dict passed as comamnd line argument."""
    config_file = os.path.realpath(config_file)
    config = merge(default_conf["spotify-downloader"], get_config(config_file))

    parser.set_defaults(manual=config["manual"])
    parser.set_defaults(no_metadata=config["no-metadata"])
    parser.set_defaults(avconv=config["avconv"])
    parser.set_defaults(folder=os.path.relpath(config["folder"], os.getcwd()))
    parser.set_defaults(overwrite=config["overwrite"])
    parser.set_defaults(input_ext=config["input-ext"])
    parser.set_defaults(output_ext=config["output-ext"])
    parser.set_defaults(download_only_metadata=config["download-only-metadata"])
    parser.set_defaults(dry_run=config["dry-run"])
    parser.set_defaults(music_videos_only=config["music-videos-only"])
    parser.set_defaults(no_spaces=config["no-spaces"])
    parser.set_defaults(file_format=config["file-format"])
    parser.set_defaults(no_spaces=config["youtube-api-key"])
    parser.set_defaults(log_level=config["log-level"])

    return parser.parse_args(raw_args)