mirror of
https://github.com/got-feedBack/feedBack.git
synced 2026-09-16 01:40:09 +00:00
fix(enrichment): POST the AcoustID lookup instead of GET
A Chromaprint fingerprint is multi-KB (a 3.5-min track ≈ 3.5k chars), so sending it as a GET query param overflows the request URL for longer songs and fails spuriously. AcoustID accepts the same params form-encoded — POST them.
This commit is contained in:
@@ -6317,9 +6317,13 @@ def _acoustid_lookup(duration: int, fingerprint: str) -> list[dict]:
|
|||||||
import requests
|
import requests
|
||||||
_enrich_throttle()
|
_enrich_throttle()
|
||||||
try:
|
try:
|
||||||
resp = requests.get(
|
# POST, not GET: a fingerprint is multi-KB (a 3.5-min track is ~3.5k
|
||||||
|
# chars), so a GET crams it into the URL and a long song overflows the
|
||||||
|
# server's URL limit → a spurious failure. AcoustID accepts the same
|
||||||
|
# params form-encoded in the body.
|
||||||
|
resp = requests.post(
|
||||||
f"{acoustid_match.ACOUSTID_API_ROOT}/lookup",
|
f"{acoustid_match.ACOUSTID_API_ROOT}/lookup",
|
||||||
params={
|
data={
|
||||||
"client": key, "format": "json",
|
"client": key, "format": "json",
|
||||||
"meta": acoustid_match.LOOKUP_META,
|
"meta": acoustid_match.LOOKUP_META,
|
||||||
"duration": duration, "fingerprint": fingerprint,
|
"duration": duration, "fingerprint": fingerprint,
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user