Skip to content

Torznab Language Proxy

Proxy interceptant les réponses Torznab de Prowlarr pour injecter des tags de langue dans les noms de releases, permettant à Sonarr/Radarr de détecter l'audio français.

Informations

Paramètre Valeur
Container LXC 100 - docker-media
IP:Port 192.168.1.100:8081
Image Custom (Python 3.12-slim)
Backend Prowlarr (prowlarr:9696)

Problème Résolu

Contexte : Les indexers comme nzbGeek fournissent l'attribut <newznab:attr name="language" value="...French..."/> dans les réponses Torznab XML — potentiellement plusieurs attributs pour les releases multi-langues (ex: Danish, French, Norwegian, Swedish). Sonarr/Radarr ignorent ces métadonnées durant la phase de recherche ; seul le parsing du nom de release détecte la langue.

Solution : Le proxy lit tous les attributs language d'une release. Si au moins un contient du français, il injecte le tag MULTi.VFF (Version Française de France) dans le titre.

Transformation :

  • Entrée : Asterix.and.Obelix.Mission.Cleopatre.2002.NORDiC.1080p.WEB-DL.H.264.DDP2.0-NoTrace [langs: Danish, French, Norwegian, Swedish]
  • Sortie : Asterix.and.Obelix.Mission.Cleopatre.2002.NORDiC.MULTi.VFF.1080p.WEB-DL.H.264.DDP2.0-NoTrace

Résultat : Sonarr/Radarr détectent VFF (+1800 points dans profils VF), la release est correctement priorisée.

Bug corrigé (2026-06-23) : L'ancienne version ne lisait que le premier attribut language (language_attrs[0]). Les releases NORDiC/internationales avec French en 2e/3e position étaient ignorées. Le proxy lit maintenant tous les attributs et vérifie si l'un quelconque contient du français.

Configuration Docker

services:
    torznab-proxy:
        build: ./torznab-proxy
        environment:
            - PROWLARR_URL=http://prowlarr:9696
            - PROWLARR_API_KEY=8735d52d20164be88fa80cd2b145edcf
        ports:
            - "8081:8080"
        depends_on:
            - prowlarr
        restart: unless-stopped

Configuration Sonarr/Radarr

URL Indexer

Modifier l'URL de l'indexer dans Sonarr/Radarr pour pointer vers le proxy :

Avant : http://prowlarr:9696/6/
Après : http://torznab-proxy:8080/6/

Sonarr :

  1. Settings → Indexers
  2. Cliquer sur l'indexer (ex: NZBgeek)
  3. Modifier le champ URL
  4. Test → Save

Radarr : Même procédure

Profils Recyclarr

Les profils VF (Version Française) bloquent les releases sans français détecté :

Fichiers :

  • /opt/docker/recyclarr/configs/sonarr-multi-profiles.yml
  • /opt/docker/recyclarr/configs/radarr-multi-profiles.yml

Custom Format : Language: Not French = -10000 (bloqué dans profils VF)

Voir Recyclarr pour détails.

Fonctionnement

Injection de Tags

Pattern détecté :

  • Attribut <newznab:attr name="language"> contient French/français/FR/VFF/etc.

Logique :

  1. Si tag MULTi existant sans suffixe français → ajoute .VFF : MULTiMULTi.VFF
  2. Sinon injecte MULTi.VFF avant indicateurs qualité (1080p, WEB, BluRay, HDTV, DSNP)

Tags détectés comme déjà français : VFF, VOF, VFQ, VFI, VF2, MULTi.VFF, MULTi.FRENCH, FRENCH

Endpoints

Route Fonction
/health Health check ({"status": "ok"})
/<id>/api Proxy Torznab search (modifie réponses)
/<id>/download Proxy téléchargement NZB (passthrough)
/api/v1/<path:...> Proxy API Prowlarr (passthrough)

Validation

# Health check
curl http://192.168.1.100:8081/health

# Test transformation
curl -s 'http://192.168.1.100:8081/6/api?apikey=8735d52d20164be88fa80cd2b145edcf&t=tvsearch&q=Bluey.S01E08' | \
  python3 -c "import sys; from lxml import etree; \
  tree = etree.parse(sys.stdin); \
  print(tree.xpath('//item[1]/title/text()')[0])"

# Logs
pct exec 100 -- docker logs -f torznab-proxy

Monitoring

# Logs en temps réel
pct exec 100 -- docker logs -f torznab-proxy

# Dernières 50 lignes
pct exec 100 -- docker logs --tail 50 torznab-proxy

# Stats container
pct exec 100 -- docker stats torznab-proxy

Troubleshooting

Proxy Ne Répond Pas

# Vérifier statut
pct exec 100 -- docker ps | grep torznab-proxy

# Restart
pct exec 100 -- bash -c "cd /opt/docker && docker compose restart torznab-proxy"

# Rebuild complet
pct exec 100 -- bash -c "cd /opt/docker && docker compose up -d --build torznab-proxy"

Tags Non Injectés

Vérifier langue dans XML Prowlarr :

curl -s 'http://192.168.1.100:9696/6/api?apikey=8735d52d20164be88fa80cd2b145edcf&t=tvsearch&q=Bluey' | \
  grep -o 'name="language" value="[^"]*"'

Si l'attribut language ne contient pas French/français, le proxy ne modifie pas le titre.

Sonarr Ne Détecte Pas VFF

Vérifier profil Recyclarr :

pct exec 100 -- docker exec recyclarr recyclarr sync sonarr --preview | grep "Language: Not French"

Si score = 0, mettre à -10000 pour bloquer les releases sans français.

Maintenance

Mise à Jour Code

# Éditer proxy.py
pct exec 100 -- nano /opt/docker/torznab-proxy/proxy.py

# Rebuild
pct exec 100 -- bash -c "cd /opt/docker && docker compose up -d --build torznab-proxy"

Logs Détaillés

Modifier proxy.py pour activer debug Flask :

app.run(host='0.0.0.0', port=8080, debug=True)

Ressources

  • Code source : /opt/docker/torznab-proxy/proxy.py
  • Dockerfile : /opt/docker/torznab-proxy/Dockerfile
  • Tests : /opt/docker/torznab-proxy/test-proxy.sh
  • Documentation : /opt/docker/torznab-proxy/README.md