MTG / pycompmusic

Tools to help researchers work with Dunya and CompMusic
MIT License
31 stars 18 forks source link

Traceback error #33

Open samayou opened 4 years ago

samayou commented 4 years ago

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("") 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 commented 4 years ago

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