Skip to content

Instantly share code, notes, and snippets.

@dalareo
Created February 24, 2026 15:37
Show Gist options
  • Select an option

  • Save dalareo/6d9c1ae9dfea71c83fb40f17dcab8027 to your computer and use it in GitHub Desktop.

Select an option

Save dalareo/6d9c1ae9dfea71c83fb40f17dcab8027 to your computer and use it in GitHub Desktop.
Delete favorite artists from Qobuz
import requests
import time
# --- TUS CREDENCIALES ---
APP_ID = ""
TOKEN = ""
# -----------------------
# Pega aquí la cadena gigante de IDs que copiaste del navegador
raw_ids = ""
all_ids = raw_ids.split(',')
batch_size = 50 # Borramos de 50 en 50 para no saturar la URL
print(f"Total de artistas a procesar: {len(all_ids)}")
for i in range(0, len(all_ids), batch_size):
batch = all_ids[i:i + batch_size]
ids_string = ",".join(batch)
url = "https://www.qobuz.com/api.json/0.2/favorite/delete"
params = {"artist_ids": ids_string}
headers = {
"x-app-id": APP_ID,
"x-user-auth-token": TOKEN
}
try:
response = requests.get(url, params=params, headers=headers)
if response.status_code == 200:
print(f"✅ Lote {i//batch_size + 1} enviado con éxito ({len(batch)} artistas).")
else:
print(f"❌ Error en lote {i//batch_size + 1}: {response.status_code}")
except Exception as e:
print(f"Error de conexión: {e}")
# Pausa de medio segundo entre lotes para ser "amigables" con la API
time.sleep(0.5)
print("--- Proceso finalizado ---")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment