Shazam

ÜCRETSİZ PREMIUM
Verified
Taraf Api Dojo | Güncelleyen 14 दिन पहले | Music
Popülerlik

9.8 / 10

Gecikme

1,582ms

Hizmet Düzeyi

99%

Health Check

N/A

Tüm Tartışmalara Dön

Music not detected

Rapid account: Johan Kachiun
johan.kachiun
3 वर्ष पहले

Hello! I am using the song detection endpoint, but when i use it, i don’t get back everything. The only thing that comes back is:

{“matches”:[],“timestamp”:1605698021092,“timezone”:“America/Chicago”,“tagid”:“37fb4fbd-b8b9-4e2f-a560-ac711955433d”}

I don’t think my code is the problem because it works with the tutorial example. Here it is anyway:

import http.client
import json
import base64

conn = http.client.HTTPSConnection(“shazam.p.rapidapi.com”)

with open(‘magictouchshort.raw’, ‘rb’) as binary_file:
binary_file_data = binary_file.read()
base64_encoded_data = base64.b64encode(binary_file_data)
base64_message = base64_encoded_data.decode(‘utf-8’)

payload = base64_message

headers = {
‘content-type’: “text/plain”,
‘x-rapidapi-key’: “a696008601msh8e312386f44ce3dp1f784ejsn62c8f2fbd213”,
‘x-rapidapi-host’: “shazam.p.rapidapi.com
}

conn.request(“POST”, “/songs/detect”, payload, headers)

res = conn.getresponse()
data = res.read()
text = data.decode()
s = data.decode(“utf-8”)
data = json.loads(s)
print(data[‘track’][‘title’])
print(data[‘track’][‘subtitle’])

magictouchshort.raw is the first 3 seconds of Magic Touch by Aerosmith. I tried using more of the song but still got the same results.

Would really appreciate help figuring out what is going on here 😃

Rapid account: Marymichaelugo
marymichaelugo Commented 2 वर्ष पहले

this api https://rapidapi.com/SAdrian/api/data-imdb1/ returns undefined.any solution?

Rapid account: Guyc 1800
guyc1800 Commented 3 वर्ष पहले

same problem , johan.kachiun use audd api instead

Rapid account: Benllshua
benllshua Commented 3 वर्ष पहले

same problem

Rapid account: Apidojo
apidojo Commented 3 वर्ष पहले

Hello,

Simply increase to 5 seconds, and keep trying the next portions. You may use the official Shazam application and experience how long it takes to detect the song, and you will need the same duration too. Remember splitting the duration into (the same 3 or 5 seconds) portions .

Regards.

Rapid account: Johan Kachiun
johan.kachiun Commented 3 वर्ष पहले

I forgot to mention: {“matches”:[],“timestamp”:1605698021092,“timezone”:“America/Chicago”,“tagid”:“37fb4fbd-b8b9-4e2f-a560-ac711955433d”} is what i get when i use print§, and comment out the last 3 lines of code.

Aşağıya yorum ekleyerek tartışmaya katılın:

Yeni yorumlar göndermek için giriş yapın / kaydolun