jesseward / discogstagger

Console based audio-file metadata tagger that uses the Discogs.com API v2 (JSON based). Relies on the Mutagen and discogs-client libraries. Currently supports FLAC and MP3 file types.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't authenticate (Status 301)

tim6her opened this issue · comments

Dear jesseward,

thanks for this great script!

However, I can't get the image download to work and will allways receive the status response 301. The discogs API doc won't tell me what that means. Please see traceback for details.

Best regards,

Tim

Traceback (most recent call last):
  File "/usr/local/bin/discogs_tagger.py", line 204, in <module>
    get_images(release.album.images, dest_dir_name, images_format, first_image_name)
  File "/usr/local/lib/python2.7/site-packages/discogstagger/taggerutils.py", line 316, in get_images
    discogs_auth = DiscogsAuth()
  File "/usr/local/lib/python2.7/site-packages/discogstagger/discogsauth.py", line 30, in __init__
    self._get_request_token()
  File "/usr/local/lib/python2.7/site-packages/discogstagger/discogsauth.py", line 43, in _get_request_token
    raise Exception('Invalid response {0}.'.format(resp['status']))
Exception: Invalid response 301.

hey @tim6her thanks for reporting this.

Unfortunately this tool has become somewhat stale. Discogs moved to TLS enabled API endpoints long ago, the wrapper I had in place referenced the plain text urls. The fix for this was quite small and I have committed 98787b2 and completed a quick test run. It is tagging once again. This should get you unblocked.

$ discogs_tagger.py -s "This is Not" -r 7117597
INFO:__main__:Using destination directory: This is Not
INFO:discogstagger.discogsalbum:Fetching DJ Metatron - This Is Not (7117597)
INFO:__main__:Tagging album 'DJ Metatron - This Is Not'
INFO:__main__:Creating destination directory 'DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW'
INFO:__main__:Downloading and storing images
=== ACTION REQUIRED ===
In order to fetch images from discogs, you're required to grant the discogstagger application access to perform actions on behalf of your discogs account.
Please visit https://www.discogs.com/oauth/authorize?oauth_token=GToezPXoPMerXcubAVvciwaonoPfnJpRxzmIMbls and accept the authentication request
Please enter verification code provided at the above url:XXXX
ERROR:discogstagger.taggerutils:Unable to download image '', skipping. Error: Unsupported URL  ().
INFO:__main__:Writing file DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW/01-Unknown_Artist-Intro.mp3
INFO:__main__:Writing file DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW/02-Traumprinz-Untitled.mp3
INFO:__main__:Writing file DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW/03-Traumprinz-Where_Is_Home.mp3
INFO:__main__:Writing file DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW/04-Darling_Farah-Aaangel_(Traumprinz_Misinterpretation).mp3
INFO:__main__:Writing file DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW/05-Efdemin-Parallaxis_(Traumprinz_Over_To_The_End_Remix).mp3
INFO:__main__:Writing file DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW/06-Traumprinz-The_Journey_(Skit).mp3
INFO:__main__:Writing file DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW/07-DJ_Metatron-State_Of_Me.mp3
INFO:__main__:Writing file DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW/08-Traumprinz-There_Will_Be_XTC.mp3
INFO:__main__:Writing file DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW/09-Traumprinz-2Bad_(DJ_Metatrons_What_If_Madness_Is_The_Only_Relief_Rework).mp3
INFO:__main__:Generating .nfo file
INFO:__main__:Generating .m3u file
INFO:__main__:Tagging complete.