Problem with retrieve function
Hello, I'm using the APIs in a project inside Unity3D. I'm trying to download a sound and a bit time ago my scripts worked well. Now I find this error when I call my script "personal_download.py"
PythonException: Exception : [' File "<string>", line 1, in <module>/n', ' File "Assets/Scripts/personal_download.py", line 26, in <module>/n sound.retrieve_preview("/Documenti", sound.name)/n', ' File "C://Python27//lib//site-packages//freesound.py", line 384, in retrieve_preview/n path/n', ' File "C://Python27//lib//site-packages//freesound.py", line 289, in retrieve/n return r.retrieve(url, path, reporthook)/n', ' File "C://Python27//Lib//urllib.py", line 247, in retrieve/n fp = self.open(url, data)/n', ' File "C://Python27//Lib//urllib.py", line 215, in open/n return getattr(self, name)(url)/n', ' File "C://Python27//Lib//urllib.py", line 459, in open_https/n return self.http_error(url, fp, errcode, errmsg, headers)/n', ' File "C://Python27//Lib//urllib.py", line 383, in http_error/n return self.http_error_default(url, fp, errcode, errmsg, headers)/n', ' File "C://Python27//lib//site-packages//freesound.py", line 235, in http_error_default/n raise Exception(resp)/n'] at Python.Runtime.Runtime.CheckExceptionOccurred () (at <c8fac48adde14fb6a6caf70fb9635324>:0)
If it can be useful, I write here my script, just to be clear
from __future__ import print_function
import sys
import freesound
import os
import UnityEngine as ue
FREESOUND_API_KEY = privateKey
if FREESOUND_API_KEY is None:
ue.Debug.Log("You need to set your API key as an evironment variable",)
ue.Debug.Log("named FREESOUND_API_KEY")
sys.exit(-1)
client = freesound.FreesoundClient()
client.set_token(FREESOUND_API_KEY,"token")
ue.Debug.Log(client.token)
sound = client.get_sound(10)
ue.Debug.Log("Downloading " + sound.name)
sound.retrieve_preview("myPath", sound.name)
Thank you very much for your help!