Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traceback error #33

Open
samayou opened this issue Sep 25, 2020 · 1 comment
Open

Traceback error #33

samayou opened this issue Sep 25, 2020 · 1 comment

Comments

@samayou
Copy link

samayou commented Sep 25, 2020

In this repository https://github.com/MTG/pycompmusic you can find the code to access the API with python. For example to access the recording in the makam collection:

from compmusic import dunya
dunya.set_token("<your_token>")
recordings = dunya.makam.get_recordings()

after the execution after the execution of the code we had the following error :

Traceback (most recent call last):
File "", line 1, in
File "/home/sama/Downloads/pycompmusic-master/compmusic/dunya/makam.py", line 28, in get_recordings
return compmusic.dunya.conn._get_paged_json("api/makam/recording", **args)
File "/home/sama/Downloads/pycompmusic-master/compmusic/dunya/conn.py", line 57, in _get_paged_json
res = _dunya_url_query(nxt, extra_headers=extra_headers)
File "/home/sama/Downloads/pycompmusic-master/compmusic/dunya/conn.py", line 77, in _dunya_url_query
raise HTTPError(e)
compmusic.dunya.conn.HTTPError: 401 Client Error: Unauthorized for url: https://dunya.compmusic.upf.edu/api/makam/recording

@sertansenturk
Copy link
Contributor

Hi @samayou,

I guess you have already done the steps below, but just to confirm:

  1. Have you registered to the website and obtained your personal token?
  2. Did you make sure that you pass your token to dunya.set_token correctly?

Note: Please do not share your token here or anywhere online

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants