openopus-org / openopus_api

A free and open source API to classical music metadata
GNU General Public License v3.0
89 stars 24 forks source link

Unable to access audio files. #8

Open Chiarinze opened 1 year ago

Chiarinze commented 1 year ago

I tried fetching an audio file from the API using the composer's name and the name of the audio, but it returned an error. Does the API's database have the composer's work in an audio format, if it does, how can I fetch it?

This was the function I ran;

@app.route('/audio//') def get_audio(composer, work): url = f"https://openopus.org/{composer}/{work}.mp3" response = requests.get(url) if response.status_code == 200: return response.content, 200, {'Content-Type': 'audio/mpeg'} else: return jsonify({'error': 'Unable to fetch audio file.'}), 500

Chiarinze commented 1 year ago

I set the {composer} as Bach and the {work} as Brandenburg-concerto-no-3.

adrianosbr commented 1 year ago

Hi!

You can find the complete API documentation at:

https://openopus.org/docs

There's no audio functionality whatsoever. Open Opus deals only with metadata.

On Fri, Mar 3, 2023 at 12:07 PM Chiarinze @.***> wrote:

I tried fetching an audio file from the API using the composer's name and the name of the audio, but it returned an error. Does the API's database have the composer's work in an audio format, if it does, how can I fetch it?

This was the function I ran;

@app.route('/audio//') def get_audio(composer, work): url = f"https://openopus.org/{composer}/{work}.mp3" response = requests.get(url) if response.status_code == 200: return response.content, 200, {'Content-Type': 'audio/mpeg'} else: return jsonify({'error': 'Unable to fetch audio file.'}), 500

— Reply to this email directly, view it on GitHub https://github.com/openopus-org/openopus_api/issues/8, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVDHSAWKT3PTSAEUCM3MYLW2ICLLANCNFSM6AAAAAAVOXDHGI . You are receiving this because you are subscribed to this thread.Message ID: @.***>