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.
MIT License
70 stars 13 forks source link

Can't authenticate (Status 301) #27

Closed tim6her closed 7 years ago

tim6her commented 7 years ago

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.
jesseward commented 7 years ago

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 https://github.com/jesseward/discogstagger/commit/98787b27faf024e49d51a81a470206e48ab6840a 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.
tim6her commented 7 years ago
                                                                                  Hey Jesse,thanks for the prompt reply! I haven't found time to try it with your patch yet. In the meantime I did make the script aware of sub-tracks. Right now I am testing this feature and am going ‎to send you a pull request once I am confident with my code.Take care,Tim                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        From: Jesse WardSent: Sunday 8 January 2017 02:22To: jesseward/discogstaggerReply To: jesseward/discogstaggerCc: Tim B. Herbstrith; MentionSubject: Re: [jesseward/discogstagger] Can't authenticate (Status 301) (#27)hey @tim6her thanks for reporting this.

Unfortunately this tool has become someone 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-DarlingFarah-Aaangel(Traumprinz_Misinterpretation).mp3 INFO:main:Writing file DJ_Metatron-This_Is_Not-(GIEGLING_MIX07)-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-TheJourney(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_MIX07)-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.

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/jesseward/discogstagger","title":"jesseward/discogstagger","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/jesseward/discogstagger"}},"updates":{"snippets":[{"icon":"PERSON","message":"@jesseward in #27: hey @tim6her thanks for reporting this. \r\n\r\nUnfortunately this tool has become someone 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 https://github.com/jesseward/discogstagger/commit/98787b27faf024e49d51a81a470206e48ab6840a and completed a quick test run. It is tagging once again. This should get you unblocked.\r\n\r\n\r\n$ discogs_tagger.py -s \"This is Not\" -r 7117597\r\nINFO:__main__:Using destination directory: This is Not\r\nINFO:discogstagger.discogsalbum:Fetching DJ Metatron - This Is Not (7117597)\r\nINFO:__main__:Tagging album 'DJ Metatron - This Is Not'\r\nINFO:__main__:Creating destination directory 'DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW'\r\nINFO:__main__:Downloading and storing images\r\n=== ACTION REQUIRED ===\r\nIn order to fetch images from discogs, you're required to grant the discogstagger application access to perform actions on behalf of your discogs account.\r\nPlease visit https://www.discogs.com/oauth/authorize?oauth_token=GToezPXoPMerXcubAVvciwaonoPfnJpRxzmIMbls and accept the authentication request\r\nPlease enter verification code provided at the above url:XXXX\r\nERROR:discogstagger.taggerutils:Unable to download image '', skipping. Error: Unsupported URL ().\r\nINFO:__main__:Writing file DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW/01-Unknown_Artist-Intro.mp3\r\nINFO:__main__:Writing file DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW/02-Traumprinz-Untitled.mp3\r\nINFO:__main__:Writing file DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW/03-Traumprinz-Where_Is_Home.mp3\r\nINFO:__main__:Writing file DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW/04-Darling_Farah-Aaangel_(Traumprinz_Misinterpretation).mp3\r\nINFO:__main__:Writing file DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW/05-Efdemin-Parallaxis_(Traumprinz_Over_To_The_End_Remix).mp3\r\nINFO:__main__:Writing file DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW/06-Traumprinz-The_Journey_(Skit).mp3\r\nINFO:__main__:Writing file DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW/07-DJ_Metatron-State_Of_Me.mp3\r\nINFO:__main__:Writing file DJ_Metatron-This_Is_Not-(GIEGLING_MIX_07)-2015-jW/08-Traumprinz-There_Will_Be_XTC.mp3\r\nINFO:__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\r\nINFO:__main__:Generating .nfo file\r\nINFO:__main__:Generating .m3u file\r\nINFO:__main__:Tagging complete.\r\n"}],"action":{"name":"View Issue","url":"https://github.com/jesseward/discogstagger/issues/27#issuecomment-271122344"}}}