MainKronos / Sonarr-AnimeDownloader

It is a Docker Container that uses Sonarr to download anime from AnimeWorld site (ITALY).
https://mainkronos.github.io/Sonarr-AnimeDownloader/
MIT License
43 stars 10 forks source link

[BUG] `๐Ÿ…ด๐Ÿ†๐Ÿ†๐Ÿ…พ๐Ÿ†` timed out #128

Closed EffeF closed 6 months ago

EffeF commented 10 months ago

Livello di Errore:

Messaggio di Errore

๐Ÿ…ด๐Ÿ†๐Ÿ†๐Ÿ…พ๐Ÿ† timed out

Descrizione

Dopo aver installato da zero non ha piรน funzionato, l'unica cosa che mostra la console di log รจ l'errore sopra riportato.

Log

Details ``` INFO โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€[28 Oct 2023 18:22:36]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” INFO โ”‚ _ _____ _ _ โ”‚ INFO โ”‚ /\ (_) | __ \ | | | | โ”‚ INFO โ”‚ / \ _ __ _ _ __ ___ ___| | | | _____ ___ __ | | ___ __ _ __| | ___ _ __ โ”‚ INFO โ”‚ / /\ \ | '_ \| | '_ ` _ \ / _ \ | | |/ _ \ \ /\ / / '_ \| |/ _ \ / _` |/ _` |/ _ \ '__| โ”‚ INFO โ”‚ / ____ \| | | | | | | | | | __/ |__| | (_) \ V V /| | | | | (_) | (_| | (_| | __/ | โ”‚ INFO โ”‚ /_/ \_\_| |_|_|_| |_| |_|\___|_____/ \___/ \_/\_/ |_| |_|_|\___/ \__,_|\__,_|\___|_| โ”‚ INFO โ”‚ โ”‚ INFO โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€2.0.0โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ INFO INFO Globals INFO โ”œโ”€โ”€ ctx.SONARR_URL = โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ INFO โ”œโ”€โ”€ ctx.API_KEY = โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ DEBUG โ”œโ”€โ”€ ctx.DOWNLOAD_FOLDER = /downloads DEBUG โ”œโ”€โ”€ ctx.DATABASE_FOLDER = /src/database DEBUG โ”œโ”€โ”€ ctx.SCRIPT_FOLDER = /src/script INFO โ””โ”€โ”€ ctx.VERSION = 2.0.0 INFO INFO Settings INFO โ”œโ”€โ”€ TagsMode = BLACKLIST INFO โ”œโ”€โ”€ ScanDelay = 30 INFO โ”œโ”€โ”€ RenameEp = True INFO โ”œโ”€โ”€ MoveEp = True INFO โ”œโ”€โ”€ LogLevel = DEBUG INFO โ””โ”€โ”€ AutoBind = False INFO DEBUG Tags DEBUG โ”œโ”€โ”€ 2 - tv (๐ŸŸข) DEBUG โ”œโ”€โ”€ 8 - anime (๐Ÿ”ด) DEBUG โ””โ”€โ”€ 5 - aniplanrr (๐Ÿ”ด) DEBUG DEBUG Connections DEBUG โ””โ”€โ”€ Pushover - pushover.sh (๐ŸŸข) DEBUG INFO INFO ]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€[ INFO INFO โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ใ€Œ28 Oct 2023 18:22:37ใ€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ INFO ERROR ๐Ÿ…ด๐Ÿ†๐Ÿ†๐Ÿ…พ๐Ÿ†: timed out INFO โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ใ€Œ28 Oct 2023 18:52:37ใ€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ INFO ```
EffeF commented 10 months ago

Puรฒ essere legato a questo? Togliendo il monitorato da alcune serie con molti episodi da Sonarr, รจ tornato a funzionare.

Per caso il numero di episodi che a sonarr risultano missing, compresi anime e non, superano i 1000? Perchรจ avevo messo questo limite pensando di ottimizzare il numero di richieste, ma a quanto pare il limite รจ troppo basso ๐Ÿ˜…

Originally posted by @MainKronos in https://github.com/MainKronos/Sonarr-AnimeDownloader/issues/122#issuecomment-1760082897

MainKronos commented 10 months ago

Se devo essere sincero รจ la prima volta che vedo questo errore.... Ma il docker si blocca? Mi puoi allegare anche il docker-compose che hai usato?

EffeF commented 10 months ago

No, il docker continua a funzionare perfettamente, solo continua mostrare l'errore senza scaricare niente ne fare altro.

Ecco il docker-compose:

Details ```yml --- version: '3.9' services: anime-downloader: image: ghcr.io/mainkronos/anime_downloader:latest container_name: anime-downloader hostname: anime-downloader environment: - PUID=1000 - PGID=1000 - TZ=Europe/Rome - SONARR_URL=โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ - API_KEY=โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ volumes: - /mnt/HDD1/config/anime-downloader/database:/src/database - /mnt/HDD1/config/anime-downloader/script:/src/script - /mnt/HDD1/data:/data - /mnt/HDD1/data/torrents/anime:/downloads ports: - 5000:5000 restart: unless-stopped sonarr: image: ghcr.io/linuxserver/sonarr:develop container_name: sonarr hostname: sonarr environment: - PUID=1000 - PGID=1000 - TZ=Europe/Rome volumes: - /mnt/HDD1/config/sonarr:/config - /mnt/HDD1/data:/data ports: - 8989:8989 restart: unless-stopped ```
MainKronos commented 9 months ago

Controlla se riesci a ottenere una risposta da:

http://{IP}:{PORT}/api/v3/wanted/missing?includeSeries=true

sostituendo IP e PORT con l'indirizzo ip e la porta di sonarr

inoltre prova la versione dev e dimmi se cambia qualcosa.

EffeF commented 9 months ago

Da questo no...

http://{IP}:{PORT}/api/v3/wanted/missing?includeSeries=true

ma da questo si

http://{IP}:{PORT}/api/v3/wanted/missing?includeSeries=true&apikey={API_KEY}

Comunque anche con la versione dev avevo lo stesso problema (avevo provato ad aggiornare dopo aver letto l'issue #122)... al momento pero funziona la versione latest, รจ bastato togliere il monitoraggio da alcune serie.

EffeF commented 9 months ago

al momento pero funziona la versione latest, รจ bastato togliere il monitoraggio da alcune serie.

Ho appena provato a rimettere il monitoraggio ad alcuni anime portando il numero degli episodi mancanti sopra 1000, ed il problema si ripresenta, quindi credo che effettivamente il problema sia quello.

MainKronos commented 9 months ago

prova a passare alla versione dev, l'ho appena aggiornata

EffeF commented 9 months ago

prova a passare alla versione dev, l'ho appena aggiornata

Con tutti gli anime monitorati su Sonarr, non mostra piรน l'errore, ma comunque non funziona

Details ``` INFO โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€[29 Oct 2023 21:08:03]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” INFO โ”‚ _ _____ _ _ โ”‚ INFO โ”‚ /\ (_) | __ \ | | | | โ”‚ INFO โ”‚ / \ _ __ _ _ __ ___ ___| | | | _____ ___ __ | | ___ __ _ __| | ___ _ __ โ”‚ INFO โ”‚ / /\ \ | '_ \| | '_ ` _ \ / _ \ | | |/ _ \ \ /\ / / '_ \| |/ _ \ / _` |/ _` |/ _ \ '__| โ”‚ INFO โ”‚ / ____ \| | | | | | | | | | __/ |__| | (_) \ V V /| | | | | (_) | (_| | (_| | __/ | โ”‚ INFO โ”‚ /_/ \_\_| |_|_|_| |_| |_|\___|_____/ \___/ \_/\_/ |_| |_|_|\___/ \__,_|\__,_|\___|_| โ”‚ INFO โ”‚ โ”‚ INFO โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€devโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ INFO INFO Globals INFO โ”œโ”€โ”€ ctx.SONARR_URL = โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ INFO โ”œโ”€โ”€ ctx.API_KEY = โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ DEBUG โ”œโ”€โ”€ ctx.DOWNLOAD_FOLDER = /downloads DEBUG โ”œโ”€โ”€ ctx.DATABASE_FOLDER = /src/database DEBUG โ”œโ”€โ”€ ctx.SCRIPT_FOLDER = /src/script INFO โ””โ”€โ”€ ctx.VERSION = dev INFO INFO Settings INFO โ”œโ”€โ”€ TagsMode = BLACKLIST INFO โ”œโ”€โ”€ ScanDelay = 30 INFO โ”œโ”€โ”€ RenameEp = True INFO โ”œโ”€โ”€ MoveEp = True INFO โ”œโ”€โ”€ LogLevel = DEBUG INFO โ””โ”€โ”€ AutoBind = False INFO DEBUG Tags DEBUG โ”œโ”€โ”€ 2 - tv (๐ŸŸข) DEBUG โ”œโ”€โ”€ 8 - anime (๐Ÿ”ด) DEBUG โ””โ”€โ”€ 5 - aniplanrr (๐Ÿ”ด) DEBUG DEBUG Connections DEBUG โ””โ”€โ”€ Pushover - pushover.sh (๐ŸŸข) DEBUG INFO INFO ]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€[ INFO INFO โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ใ€Œ29 Oct 2023 21:08:03ใ€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ INFO ]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€[CRITICAL]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€[ ```
EffeF commented 9 months ago

Ho fatto alcune prove togliendo e mettendo il monitorato su Sonarr... riabbassando il numero di episodi mancanti sotto 1000 (da risposta API riportata sopra: "totalRecords": 957) funziona perfettamente (come pure latest del resto), ma sopra 1000 (da API: "totalRecords": 1976), pur non mostrando l'errore ๐Ÿ…ด๐Ÿ†๐Ÿ†๐Ÿ…พ๐Ÿ† timed out, comunque non funziona, quindi evidentemente il problema c'รจ in entrambe le versioni.

EffeF commented 9 months ago

Se puรฒ servire, dai log che vedo su Portainer, sono presenti questi errori:

Details ``` 2023-10-29T20:50:49.230568000Z usermod: no changes 2023-10-29T20:51:07.854693000Z INFO โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€[29 Oct 2023 21:51:07]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” 2023-10-29T20:51:07.856898000Z INFO โ”‚ _ _____ _ _ โ”‚ 2023-10-29T20:51:07.857342000Z INFO โ”‚ /\ (_) | __ \ | | | | โ”‚ 2023-10-29T20:51:07.857727000Z INFO โ”‚ / \ _ __ _ _ __ ___ ___| | | | _____ ___ __ | | ___ __ _ __| | ___ _ __ โ”‚ 2023-10-29T20:51:07.858118000Z INFO โ”‚ / /\ \ | '_ \| | '_ ` _ \ / _ \ | | |/ _ \ \ /\ / / '_ \| |/ _ \ / _` |/ _` |/ _ \ '__| โ”‚ 2023-10-29T20:51:07.858580000Z INFO โ”‚ / ____ \| | | | | | | | | | __/ |__| | (_) \ V V /| | | | | (_) | (_| | (_| | __/ | โ”‚ 2023-10-29T20:51:07.858985000Z INFO โ”‚ /_/ \_\_| |_|_|_| |_| |_|\___|_____/ \___/ \_/\_/ |_| |_|_|\___/ \__,_|\__,_|\___|_| โ”‚ 2023-10-29T20:51:07.859345000Z INFO โ”‚ โ”‚ 2023-10-29T20:51:07.859814000Z INFO โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€devโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ 2023-10-29T20:51:07.860242000Z INFO 2023-10-29T20:51:07.860672000Z INFO Globals 2023-10-29T20:51:07.861123000Z INFO โ”œโ”€โ”€ ctx.SONARR_URL = โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 2023-10-29T20:51:07.861509000Z INFO โ”œโ”€โ”€ ctx.API_KEY = โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 2023-10-29T20:51:07.861912000Z DEBUG โ”œโ”€โ”€ ctx.DOWNLOAD_FOLDER = /downloads 2023-10-29T20:51:07.862287000Z DEBUG โ”œโ”€โ”€ ctx.DATABASE_FOLDER = /src/database 2023-10-29T20:51:07.862642000Z DEBUG โ”œโ”€โ”€ ctx.SCRIPT_FOLDER = /src/script 2023-10-29T20:51:07.863256000Z INFO โ””โ”€โ”€ ctx.VERSION = dev 2023-10-29T20:51:07.863880000Z INFO 2023-10-29T20:51:07.864491000Z INFO Settings 2023-10-29T20:51:07.865211000Z INFO โ”œโ”€โ”€ TagsMode = BLACKLIST 2023-10-29T20:51:07.865758000Z INFO โ”œโ”€โ”€ ScanDelay = 30 2023-10-29T20:51:07.866220000Z INFO โ”œโ”€โ”€ RenameEp = True 2023-10-29T20:51:07.866979000Z INFO โ”œโ”€โ”€ MoveEp = True 2023-10-29T20:51:07.867560000Z INFO โ”œโ”€โ”€ LogLevel = DEBUG 2023-10-29T20:51:07.867996000Z INFO โ””โ”€โ”€ AutoBind = False 2023-10-29T20:51:07.868380000Z INFO 2023-10-29T20:51:07.868761000Z DEBUG Tags 2023-10-29T20:51:07.869224000Z DEBUG โ”œโ”€โ”€ 2 - tv (๐ŸŸข) 2023-10-29T20:51:07.869797000Z DEBUG โ”œโ”€โ”€ 8 - anime (๐Ÿ”ด) 2023-10-29T20:51:07.870285000Z DEBUG โ””โ”€โ”€ 5 - aniplanrr (๐Ÿ”ด) 2023-10-29T20:51:07.870722000Z DEBUG 2023-10-29T20:51:07.871108000Z DEBUG Connections 2023-10-29T20:51:07.871564000Z DEBUG โ””โ”€โ”€ Pushover - pushover.sh (๐ŸŸข) 2023-10-29T20:51:07.871962000Z DEBUG 2023-10-29T20:51:08.133250000Z INFO 2023-10-29T20:51:08.134572000Z INFO ]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€[ 2023-10-29T20:51:08.136310000Z INFO 2023-10-29T20:51:08.138367000Z INFO โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ใ€Œ29 Oct 2023 21:51:08ใ€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ 2023-10-29T20:51:08.139587000Z INFO 2023-10-29T20:51:57.533995000Z CRITICAL ]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€[CRITICAL]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€[ 2023-10-29T20:51:57.553095000Z ERROR timed out 2023-10-29T20:51:57.553723000Z Traceback (most recent call last): 2023-10-29T20:51:57.554123000Z File "/usr/local/lib/python3.9/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions 2023-10-29T20:51:57.554521000Z yield 2023-10-29T20:51:57.554910000Z File "/usr/local/lib/python3.9/site-packages/httpcore/_backends/sync.py", line 126, in read 2023-10-29T20:51:57.555258000Z return self._sock.recv(max_bytes) 2023-10-29T20:51:57.555659000Z socket.timeout: timed out 2023-10-29T20:51:57.556045000Z 2023-10-29T20:51:57.556400000Z The above exception was the direct cause of the following exception: 2023-10-29T20:51:57.556825000Z 2023-10-29T20:51:57.557219000Z Traceback (most recent call last): 2023-10-29T20:51:57.557615000Z File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 66, in map_httpcore_exceptions 2023-10-29T20:51:57.557993000Z yield 2023-10-29T20:51:57.558378000Z File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 228, in handle_request 2023-10-29T20:51:57.558784000Z resp = self._pool.handle_request(req) 2023-10-29T20:51:57.559135000Z File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection_pool.py", line 262, in handle_request 2023-10-29T20:51:57.559606000Z raise exc 2023-10-29T20:51:57.559976000Z File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection_pool.py", line 245, in handle_request 2023-10-29T20:51:57.560332000Z response = connection.handle_request(request) 2023-10-29T20:51:57.560725000Z File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection.py", line 103, in handle_request 2023-10-29T20:51:57.561080000Z return self._connection.handle_request(request) 2023-10-29T20:51:57.561440000Z File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 133, in handle_request 2023-10-29T20:51:57.561780000Z raise exc 2023-10-29T20:51:57.562125000Z File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 111, in handle_request 2023-10-29T20:51:57.562475000Z ) = self._receive_response_headers(**kwargs) 2023-10-29T20:51:57.562850000Z File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 176, in _receive_response_headers 2023-10-29T20:51:57.563220000Z event = self._receive_event(timeout=timeout) 2023-10-29T20:51:57.563658000Z File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 212, in _receive_event 2023-10-29T20:51:57.564064000Z data = self._network_stream.read( 2023-10-29T20:51:57.564493000Z File "/usr/local/lib/python3.9/site-packages/httpcore/_backends/sync.py", line 126, in read 2023-10-29T20:51:57.564935000Z return self._sock.recv(max_bytes) 2023-10-29T20:51:57.565393000Z File "/usr/local/lib/python3.9/contextlib.py", line 135, in __exit__ 2023-10-29T20:51:57.565811000Z self.gen.throw(type, value, traceback) 2023-10-29T20:51:57.566206000Z File "/usr/local/lib/python3.9/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions 2023-10-29T20:51:57.566645000Z raise to_exc(exc) from exc 2023-10-29T20:51:57.567324000Z httpcore.ReadTimeout: timed out 2023-10-29T20:51:57.568133000Z 2023-10-29T20:51:57.568807000Z The above exception was the direct cause of the following exception: 2023-10-29T20:51:57.569489000Z 2023-10-29T20:51:57.570165000Z Traceback (most recent call last): 2023-10-29T20:51:57.570761000Z File "/src/components/backend/core/Core.py", line 141, in run 2023-10-29T20:51:57.571391000Z self.job() 2023-10-29T20:51:57.571993000Z File "/src/components/backend/core/Core.py", line 162, in job 2023-10-29T20:51:57.572562000Z missing = self.processor.getData() 2023-10-29T20:51:57.573147000Z File "/src/components/backend/core/Processor.py", line 24, in getData 2023-10-29T20:51:57.573732000Z missing:Iterable = self.getAllMissing() 2023-10-29T20:51:57.574335000Z File "/src/components/backend/core/Processor.py", line 48, in getAllMissing 2023-10-29T20:51:57.574968000Z res = self.sonarr.wantedMissing(page=page) 2023-10-29T20:51:57.575592000Z File "/src/components/backend/connection/Sonarr.py", line 44, in wantedMissing 2023-10-29T20:51:57.576169000Z return self.client.get("/wanted/missing", params={ 2023-10-29T20:51:57.576724000Z File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1041, in get 2023-10-29T20:51:57.577838000Z return self.request( 2023-10-29T20:51:57.578520000Z File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 814, in request 2023-10-29T20:51:57.579110000Z return self.send(request, auth=auth, follow_redirects=follow_redirects) 2023-10-29T20:51:57.579783000Z File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 901, in send 2023-10-29T20:51:57.580418000Z response = self._send_handling_auth( 2023-10-29T20:51:57.581077000Z File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 929, in _send_handling_auth 2023-10-29T20:51:57.581704000Z response = self._send_handling_redirects( 2023-10-29T20:51:57.582303000Z File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 966, in _send_handling_redirects 2023-10-29T20:51:57.582853000Z response = self._send_single_request(request) 2023-10-29T20:51:57.583925000Z File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1002, in _send_single_request 2023-10-29T20:51:57.584756000Z response = transport.handle_request(request) 2023-10-29T20:51:57.585466000Z File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 228, in handle_request 2023-10-29T20:51:57.586146000Z resp = self._pool.handle_request(req) 2023-10-29T20:51:57.586762000Z File "/usr/local/lib/python3.9/contextlib.py", line 135, in __exit__ 2023-10-29T20:51:57.587356000Z self.gen.throw(type, value, traceback) 2023-10-29T20:51:57.588083000Z File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 83, in map_httpcore_exceptions 2023-10-29T20:51:57.588855000Z raise mapped_exc(message) from exc 2023-10-29T20:51:57.589522000Z httpx.ReadTimeout: timed out ```
MainKronos commented 9 months ago

Infatti c'รจ un problema con la richiesta api/wanted/missing, il server Sonarr ci mette molto tempo a rispondere che fร  scattare il timeout. Il timeout non รจ neanche troppo stretto, dovrebbe essere 5 secondi... Prova a verificare, se riesci, che quando sonarr ha un numero superiore a 1000 episodi mancanti la risposta all'endpoint api/wanted/missing supera i 5 secondi. Nel mentre io provo a rendere meno restrittivo il timeout

EffeF commented 9 months ago

Prova a verificare, se riesci, che quando sonarr ha un numero superiore a 1000 episodi mancanti la risposta all'endpoint api/wanted/missing supera i 5 secondi.

image

EffeF commented 9 months ago

@MainKronos va bene verificato cosรฌ? Ci sono aggiornamenti sull'issue?

MainKronos commented 9 months ago

Si si, va benissimo. Scusami se non ti ho risposto ma in questo periodo sono un po' pieno di scadenze.

Comunque non sono ancora riuscito a capire come sia possibile che venga sollevato un timeout solo quando ci sono piรน di 1000 episodi mancanti. Attualmente il codice che scarica gli episodi mancanti da Sonarr รจ praticamente identico a quello che c'era prima della v2.0.0...

Non sono ancora riuscito a replicare il problema perchรฉ avere piรน di 1000 episodi mancanti รจ un po' complicato.

Quindi stavo aspettando se anche qualcun altro a avesse lo stesso problema

EffeF commented 9 months ago

avere piรน di 1000 episodi mancanti รจ un po' complicato

Basta aggiungere One Piece o Detective Conan ๐Ÿ˜‚

stavo aspettando se anche qualcun altro a avesse lo stesso problema

Nell'attesa, se serve, resto a disposizione per altre prove

MainKronos commented 9 months ago

Hai ragione, bastava aggiungere One Piece che sono piรน di mille episodi ๐Ÿ˜‚. Comunque ho fatto dei test, sia con One Piece che Detective Conan, ma non sono riuscito a replicare il problema. Sei sicuro che si verifica sempre quando il numero di episodi รจ molto alto o รจ stato un caso? Anche se fosse un caso andrebbe analizzato il motivo, ma almeno avrei un idea....

EffeF commented 9 months ago

Sei sicuro che si verifica sempre quando il numero di episodi รจ molto alto o รจ stato un caso?

La serie che mi faceva superare i 1000 episodi era One Piece, tolto il monitorato da essa funzionava, e visto anche che c'era un altro issue legato ai 1000 episodi ho dato per scontato fosse quello il problema... ma mi hai fatto venire il dubbio ed ho fatto delle prove.

Ho provato ad aggiungere altri anime a caso, al momento, senza One Piece, su Sonarr ho 3192 episodi mancanti, ben sopra i 1000, e funziona tutto perfettamente... ma appena rimetto il monitorato a One Piece ottengo di nuovo l'errore di time out.

Quindi a quanto pare il problema รจ One Piece ๐Ÿค”

Non so perchรฉ, ne quali altre prove potrei fare.

MainKronos commented 9 months ago

Questo รจ il codice (python) che scarica le informazioni relative agli episodi mancanti

from itertools import count
import requests

########################################################

SONARR_URL = "http://127.0.0.1:8080"
API_KEY = "abcdefghijklmnopqrs"

########################################################

missing = []
for page in count(1):
    res = requests.get(f"{SONARR_URL}/api/v3/wanted/missing", params={
        "includeSeries": True,
        "pageSize": 20,
        "page": page,
        "sortKey": "airDateUtc",
        "apikey": API_KEY
    })
    res.raise_for_status()
    data = res.json()

    if len(data["records"]) == 0: break

    missing.extend(data['records'])

print(missing)

prova ad eseguirlo avendo anche One Piece monitorato su Sonarr. Vediamo se esplode o no.

[!NOTE]
Se non hai installata la libreria requests basta eseguire questo comando

pip install requests
EffeF commented 9 months ago

Vediamo se esplode o no.

Esplodere non esplode, arriva alla fine senza errori, ma sicuramente รจ molto lento.

MainKronos commented 9 months ago

mhhhhhh, allora non รจ che forse รจ httpx ad avere un problema....

riprova lo stesso script ma con la libreria httpx

from itertools import count
import httpx

########################################################

SONARR_URL = "http://127.0.0.1:8080"
API_KEY = "abcdefghijklmnopqrs"

########################################################

missing = []
for page in count(1):
    res = httpx.get(f"{SONARR_URL}/api/v3/wanted/missing", params={
        "includeSeries": True,
        "pageSize": 20,
        "page": page,
        "sortKey": "airDateUtc",
        "apikey": API_KEY
    })
    res.raise_for_status()
    data = res.json()

    if len(data["records"]) == 0: break

    missing.extend(data['records'])

print(missing)
EffeF commented 9 months ago

Con httpx ottengo l'errore httpx.ReadTimeout: timed out

Se puรฒ servire, non so se รจ quella la causa del problema, la lentezza รจ data da "sortKey": "airDateUtc".

Giusto per mia curiositร  ho modificato lo script iniziale con requests per monitorarne la durata visto che ci metteva un sacco, senza quel parametro ci mette in totale 22.4822 secondi per ottenere i dati di 1961 episodi... con il parametro la bellezza di 653.0066 secondi ๐Ÿ˜…

codice modificato ```python import time from itertools import count import requests ######################################################## SONARR_URL = "http://127.0.0.1:8080" API_KEY = "abcdefghijklmnopqrs" ######################################################## start = time.perf_counter() missing = [] for page in count(1): request_start = time.perf_counter() res = requests.get( f"{SONARR_URL}/api/v3/wanted/missing", params={ "includeSeries": True, "pageSize": 20, "page": page, # "sortKey": "airDateUtc", "apikey": API_KEY, }, ) res.raise_for_status() data = res.json() request_end = time.perf_counter() if len(data["records"]) == 0: break print( f"page #{page:03} with {len(data['records'])} missing episodes loaded in {request_end - request_start:0.4f} seconds" ) missing.extend(data["records"]) # print(missing) print(f"{len(missing)} missing episodes") end = time.perf_counter() - start print(f"{end:0.4f} seconds") ```

La cosa strana รจ che ad ogni pagina la durata della singola richiesta aumenta, anche 10 secondi a richiesta... vedi sotto.

log senza parametro ``` page #001 with 20 missing episodes loaded in 0.1804 seconds page #002 with 20 missing episodes loaded in 0.1852 seconds page #003 with 20 missing episodes loaded in 0.2152 seconds page #004 with 20 missing episodes loaded in 0.2046 seconds page #005 with 20 missing episodes loaded in 0.1799 seconds page #006 with 20 missing episodes loaded in 0.1803 seconds page #007 with 20 missing episodes loaded in 0.1796 seconds page #008 with 20 missing episodes loaded in 0.1688 seconds page #009 with 20 missing episodes loaded in 0.2195 seconds page #010 with 20 missing episodes loaded in 0.1802 seconds page #011 with 20 missing episodes loaded in 0.1888 seconds page #012 with 20 missing episodes loaded in 0.1821 seconds page #013 with 20 missing episodes loaded in 0.1919 seconds page #014 with 20 missing episodes loaded in 0.2135 seconds page #015 with 20 missing episodes loaded in 0.1731 seconds page #016 with 20 missing episodes loaded in 0.1878 seconds page #017 with 20 missing episodes loaded in 0.1835 seconds page #018 with 20 missing episodes loaded in 0.1948 seconds page #019 with 20 missing episodes loaded in 0.1784 seconds page #020 with 20 missing episodes loaded in 0.1501 seconds page #021 with 20 missing episodes loaded in 0.1281 seconds page #022 with 20 missing episodes loaded in 0.1536 seconds page #023 with 20 missing episodes loaded in 0.2179 seconds page #024 with 20 missing episodes loaded in 0.2249 seconds page #025 with 20 missing episodes loaded in 0.2550 seconds page #026 with 20 missing episodes loaded in 0.2365 seconds page #027 with 20 missing episodes loaded in 0.2354 seconds page #028 with 20 missing episodes loaded in 0.2218 seconds page #029 with 20 missing episodes loaded in 0.2467 seconds page #030 with 20 missing episodes loaded in 0.2413 seconds page #031 with 20 missing episodes loaded in 0.2435 seconds page #032 with 20 missing episodes loaded in 0.2353 seconds page #033 with 20 missing episodes loaded in 0.2513 seconds page #034 with 20 missing episodes loaded in 0.2193 seconds page #035 with 20 missing episodes loaded in 0.2294 seconds page #036 with 20 missing episodes loaded in 0.2644 seconds page #037 with 20 missing episodes loaded in 0.2549 seconds page #038 with 20 missing episodes loaded in 0.2744 seconds page #039 with 20 missing episodes loaded in 0.2528 seconds page #040 with 20 missing episodes loaded in 0.2634 seconds page #041 with 20 missing episodes loaded in 0.2539 seconds page #042 with 20 missing episodes loaded in 0.2180 seconds page #043 with 20 missing episodes loaded in 0.2461 seconds page #044 with 20 missing episodes loaded in 0.2599 seconds page #045 with 20 missing episodes loaded in 0.2686 seconds page #046 with 20 missing episodes loaded in 0.2470 seconds page #047 with 20 missing episodes loaded in 0.2274 seconds page #048 with 20 missing episodes loaded in 0.2637 seconds page #049 with 20 missing episodes loaded in 0.2735 seconds page #050 with 20 missing episodes loaded in 0.2509 seconds page #051 with 20 missing episodes loaded in 0.2729 seconds page #052 with 20 missing episodes loaded in 0.2923 seconds page #053 with 20 missing episodes loaded in 0.3184 seconds page #054 with 20 missing episodes loaded in 0.2327 seconds page #055 with 20 missing episodes loaded in 0.2596 seconds page #056 with 20 missing episodes loaded in 0.2537 seconds page #057 with 20 missing episodes loaded in 0.2352 seconds page #058 with 20 missing episodes loaded in 0.2452 seconds page #059 with 20 missing episodes loaded in 0.2550 seconds page #060 with 20 missing episodes loaded in 0.2692 seconds page #061 with 20 missing episodes loaded in 0.2380 seconds page #062 with 20 missing episodes loaded in 0.2727 seconds page #063 with 20 missing episodes loaded in 0.2568 seconds page #064 with 20 missing episodes loaded in 0.2459 seconds page #065 with 20 missing episodes loaded in 0.2421 seconds page #066 with 20 missing episodes loaded in 0.2614 seconds page #067 with 20 missing episodes loaded in 0.2620 seconds page #068 with 20 missing episodes loaded in 0.2612 seconds page #069 with 20 missing episodes loaded in 0.2454 seconds page #070 with 20 missing episodes loaded in 0.2692 seconds page #071 with 20 missing episodes loaded in 0.2318 seconds page #072 with 20 missing episodes loaded in 0.2741 seconds page #073 with 20 missing episodes loaded in 0.2374 seconds page #074 with 20 missing episodes loaded in 0.1641 seconds page #075 with 20 missing episodes loaded in 0.2043 seconds page #076 with 20 missing episodes loaded in 0.2325 seconds page #077 with 20 missing episodes loaded in 0.2211 seconds page #078 with 20 missing episodes loaded in 0.2131 seconds page #079 with 20 missing episodes loaded in 0.2050 seconds page #080 with 20 missing episodes loaded in 0.2112 seconds page #081 with 20 missing episodes loaded in 0.2053 seconds page #082 with 20 missing episodes loaded in 0.2268 seconds page #083 with 20 missing episodes loaded in 0.2166 seconds page #084 with 20 missing episodes loaded in 0.2321 seconds page #085 with 20 missing episodes loaded in 0.2060 seconds page #086 with 20 missing episodes loaded in 0.2121 seconds page #087 with 20 missing episodes loaded in 0.2486 seconds page #088 with 20 missing episodes loaded in 0.2257 seconds page #089 with 20 missing episodes loaded in 0.2199 seconds page #090 with 20 missing episodes loaded in 0.2073 seconds page #091 with 20 missing episodes loaded in 0.2271 seconds page #092 with 20 missing episodes loaded in 0.2417 seconds page #093 with 20 missing episodes loaded in 0.2078 seconds page #094 with 20 missing episodes loaded in 0.1926 seconds page #095 with 20 missing episodes loaded in 0.1796 seconds page #096 with 20 missing episodes loaded in 0.1793 seconds page #097 with 20 missing episodes loaded in 0.2256 seconds page #098 with 20 missing episodes loaded in 0.1954 seconds page #099 with 1 missing episodes loaded in 0.1579 seconds 1961 missing episodes 22.4822 seconds ```
log senza parametro ``` page #001 with 20 missing episodes loaded in 0.4057 seconds page #002 with 20 missing episodes loaded in 0.4911 seconds page #003 with 20 missing episodes loaded in 0.6110 seconds page #004 with 20 missing episodes loaded in 0.6485 seconds page #005 with 20 missing episodes loaded in 0.8392 seconds page #006 with 20 missing episodes loaded in 0.9160 seconds page #007 with 20 missing episodes loaded in 0.9611 seconds page #008 with 20 missing episodes loaded in 1.1464 seconds page #009 with 20 missing episodes loaded in 1.4978 seconds page #010 with 20 missing episodes loaded in 1.3327 seconds page #011 with 20 missing episodes loaded in 1.6879 seconds page #012 with 20 missing episodes loaded in 1.8200 seconds page #013 with 20 missing episodes loaded in 1.7926 seconds page #014 with 20 missing episodes loaded in 2.0194 seconds page #015 with 20 missing episodes loaded in 1.8816 seconds page #016 with 20 missing episodes loaded in 2.3121 seconds page #017 with 20 missing episodes loaded in 2.3257 seconds page #018 with 20 missing episodes loaded in 2.2865 seconds page #019 with 20 missing episodes loaded in 2.4925 seconds page #020 with 20 missing episodes loaded in 2.7225 seconds page #021 with 20 missing episodes loaded in 2.7599 seconds page #022 with 20 missing episodes loaded in 3.6398 seconds page #023 with 20 missing episodes loaded in 4.3105 seconds page #024 with 20 missing episodes loaded in 4.5489 seconds page #025 with 20 missing episodes loaded in 5.0770 seconds page #026 with 20 missing episodes loaded in 5.5128 seconds page #027 with 20 missing episodes loaded in 4.8236 seconds page #028 with 20 missing episodes loaded in 5.4986 seconds page #029 with 20 missing episodes loaded in 6.1001 seconds page #030 with 20 missing episodes loaded in 5.4947 seconds page #031 with 20 missing episodes loaded in 5.2559 seconds page #032 with 20 missing episodes loaded in 5.6811 seconds page #033 with 20 missing episodes loaded in 5.5857 seconds page #034 with 20 missing episodes loaded in 6.0615 seconds page #035 with 20 missing episodes loaded in 5.7845 seconds page #036 with 20 missing episodes loaded in 6.1984 seconds page #037 with 20 missing episodes loaded in 6.1122 seconds page #038 with 20 missing episodes loaded in 5.8630 seconds page #039 with 20 missing episodes loaded in 6.0919 seconds page #040 with 20 missing episodes loaded in 6.3182 seconds page #041 with 20 missing episodes loaded in 6.6641 seconds page #042 with 20 missing episodes loaded in 6.4295 seconds page #043 with 20 missing episodes loaded in 6.7577 seconds page #044 with 20 missing episodes loaded in 7.0316 seconds page #045 with 20 missing episodes loaded in 6.2097 seconds page #046 with 20 missing episodes loaded in 6.3303 seconds page #047 with 20 missing episodes loaded in 6.0924 seconds page #048 with 20 missing episodes loaded in 6.3016 seconds page #049 with 20 missing episodes loaded in 6.3853 seconds page #050 with 20 missing episodes loaded in 6.1989 seconds page #051 with 20 missing episodes loaded in 6.3985 seconds page #052 with 20 missing episodes loaded in 6.4057 seconds page #053 with 20 missing episodes loaded in 7.9663 seconds page #054 with 20 missing episodes loaded in 7.3082 seconds page #055 with 20 missing episodes loaded in 6.9033 seconds page #056 with 20 missing episodes loaded in 6.9788 seconds page #057 with 20 missing episodes loaded in 7.1607 seconds page #058 with 20 missing episodes loaded in 7.2178 seconds page #059 with 20 missing episodes loaded in 7.4423 seconds page #060 with 20 missing episodes loaded in 7.9629 seconds page #061 with 20 missing episodes loaded in 8.0158 seconds page #062 with 20 missing episodes loaded in 8.1400 seconds page #063 with 20 missing episodes loaded in 8.2521 seconds page #064 with 20 missing episodes loaded in 8.3922 seconds page #065 with 20 missing episodes loaded in 8.7196 seconds page #066 with 20 missing episodes loaded in 8.4584 seconds page #067 with 20 missing episodes loaded in 9.2513 seconds page #068 with 20 missing episodes loaded in 9.0970 seconds page #069 with 20 missing episodes loaded in 8.8570 seconds page #070 with 20 missing episodes loaded in 8.9237 seconds page #071 with 20 missing episodes loaded in 8.9289 seconds page #072 with 20 missing episodes loaded in 9.0812 seconds page #073 with 20 missing episodes loaded in 8.8849 seconds page #074 with 20 missing episodes loaded in 8.8400 seconds page #075 with 20 missing episodes loaded in 10.4636 seconds page #076 with 20 missing episodes loaded in 19.1190 seconds page #077 with 20 missing episodes loaded in 13.4653 seconds page #078 with 20 missing episodes loaded in 11.4941 seconds page #079 with 20 missing episodes loaded in 11.5918 seconds page #080 with 20 missing episodes loaded in 9.9725 seconds page #081 with 20 missing episodes loaded in 9.0290 seconds page #082 with 20 missing episodes loaded in 13.5603 seconds page #083 with 20 missing episodes loaded in 9.2294 seconds page #084 with 20 missing episodes loaded in 8.7275 seconds page #085 with 20 missing episodes loaded in 8.9238 seconds page #086 with 20 missing episodes loaded in 8.8236 seconds page #087 with 20 missing episodes loaded in 8.7272 seconds page #088 with 20 missing episodes loaded in 8.5683 seconds page #089 with 20 missing episodes loaded in 8.6757 seconds page #090 with 20 missing episodes loaded in 8.5591 seconds page #091 with 20 missing episodes loaded in 8.5924 seconds page #092 with 20 missing episodes loaded in 8.5598 seconds page #093 with 20 missing episodes loaded in 9.0094 seconds page #094 with 20 missing episodes loaded in 8.3545 seconds page #095 with 20 missing episodes loaded in 9.2144 seconds page #096 with 20 missing episodes loaded in 9.0040 seconds page #097 with 20 missing episodes loaded in 9.2165 seconds page #098 with 20 missing episodes loaded in 8.9439 seconds page #099 with 1 missing episodes loaded in 9.0554 seconds 1961 missing episodes 653.0066 seconds ```

Comunque se devi recuperare tutti gli episodi mancanti credo non serva che siano in ordine di data, no?

MainKronos commented 9 months ago

Il parametro sortKey era importante per il fatto che andava a condizionare l'ordine di download. Esempio pratico: Voglio scaricare tutto l'anime di Attack on Titan; senza l'ordinamento degli episodi essi verranno scaricati nell'ordine di come sonarr me li ha forniti, quindi prima di vedere il primo episodio dovrรฒ aspettare molto. Perรฒ, visto che il tempo della risposta di sonarr aumenta di 2 ordini di grandezza, credo sia il caso di spostare l'ordinamento direttamente nel programma ๐Ÿ˜‚

comunque proviamo a riscrivere il codice in questo modo:

import time
from itertools import count
import httpx

########################################################

SONARR_URL = "http://127.0.0.1:8080"
API_KEY = "abcdefghijklmnopqrs"

########################################################

start = time.perf_counter()

missing = []
for page in count(1):
    res = httpx.get(f"{SONARR_URL}/api/v3/wanted/missing", params={
        "includeSeries": True,
        "pageSize": 20,
        "page": page,
        "apikey": API_KEY
    }, timeout=None)
    res.raise_for_status()
    data = res.json()

    if len(data["records"]) == 0: break

    missing.extend(data['records'])

end = time.perf_counter() - start

print(f"{len(missing)} missing episodes")

print(f"{end:0.4f} seconds")

Dimmi se viene sollevata di nuovo l'eccezione, e visto che ci sei quanto tempo ci mette ๐Ÿ‘

EffeF commented 9 months ago

L'output รจ:

1961 missing episodes
67.2522 seconds
MainKronos commented 9 months ago

ok, quindi simo riusciti ad arrivare ad un risultato apprezzabile. La cosa interessante sarebbe riuscire a trovare un timeout per cui non esploda

Se hai un po'di tempo libero prova ad eseguire questo codice e dimmi che valore di t esce fuori

from itertools import count
import httpx

########################################################

SONARR_URL = "http://127.0.0.1:8080"
API_KEY = "abcdefghijklmnopqrs"

########################################################

for t in count(3,2):

    try:
        missing = []
        for page in count(1):
            res = httpx.get(f"{SONARR_URL}/api/v3/wanted/missing", params={
                "includeSeries": True,
                "pageSize": 20,
                "page": page,
                "apikey": API_KEY
            }, timeout=t)
            res.raise_for_status()
            data = res.json()

            if len(data["records"]) == 0: break

            missing.extend(data['records'])
    except Exception:
        continue
    else:
        print(f'timeout: {t}')
        break
EffeF commented 9 months ago

Se hai un po'di tempo libero prova ad eseguire questo codice e dimmi che valore di t esce fuori

timeout: 3

MainKronos commented 9 months ago

magnifico, allora ho messo un timeout di 5 secondi per avere un margine di tolleranza. La versione dev dovrebbe aver risolto il problema.

EffeF commented 9 months ago

La versione dev dovrebbe aver risolto il problema.

Ho aggiornato, ed ho questo errore:

log ``` usermod: no changes INFO โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€[23 Nov 2023 21:38:29]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” INFO โ”‚ _ _____ _ _ โ”‚ INFO โ”‚ /\ (_) | __ \ | | | | โ”‚ INFO โ”‚ / \ _ __ _ _ __ ___ ___| | | | _____ ___ __ | | ___ __ _ __| | ___ _ __ โ”‚ INFO โ”‚ / /\ \ | '_ \| | '_ ` _ \ / _ \ | | |/ _ \ \ /\ / / '_ \| |/ _ \ / _` |/ _` |/ _ \ '__| โ”‚ INFO โ”‚ / ____ \| | | | | | | | | | __/ |__| | (_) \ V V /| | | | | (_) | (_| | (_| | __/ | โ”‚ INFO โ”‚ /_/ \_\_| |_|_|_| |_| |_|\___|_____/ \___/ \_/\_/ |_| |_|_|\___/ \__,_|\__,_|\___|_| โ”‚ INFO โ”‚ โ”‚ INFO โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€devโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  INFO Globals INFO โ”œโ”€โ”€ ctx.SONARR_URL = โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ INFO โ”œโ”€โ”€ ctx.API_KEY = โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ DEBUG โ”œโ”€โ”€ ctx.DOWNLOAD_FOLDER = /downloads DEBUG โ”œโ”€โ”€ ctx.DATABASE_FOLDER = /src/database DEBUG โ”œโ”€โ”€ ctx.SCRIPT_FOLDER = /src/script INFO โ””โ”€โ”€ ctx.VERSION = dev  INFO Settings INFO โ”œโ”€โ”€ TagsMode = BLACKLIST INFO โ”œโ”€โ”€ ScanDelay = 30 INFO โ”œโ”€โ”€ RenameEp = True INFO โ”œโ”€โ”€ MoveEp = True INFO โ”œโ”€โ”€ LogLevel = DEBUG INFO โ””โ”€โ”€ AutoBind = False  DEBUG Tags DEBUG โ”œโ”€โ”€ 2 - tv (๐ŸŸข) DEBUG โ”œโ”€โ”€ 8 - anime (๐Ÿ”ด) DEBUG โ””โ”€โ”€ 5 - aniplanrr (๐Ÿ”ด)  DEBUG Connections DEBUG โ””โ”€โ”€ Pushover - pushover.sh (๐ŸŸข)   INFO ]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€[  INFO โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ใ€Œ23 Nov 2023 21:38:30ใ€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ  CRITICAL ]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€[CRITICAL]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€[ ERROR timed out Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions  d File "/usr/local/lib/python3.9/site-packages/httpcore/_backends/sync.py", line 126, in read return self._sock.recv(max_bytes) socket.timeout: timed out The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 66, in map_httpcore_exceptions  d File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 228, in handle_request resp = self._pool.handle_request(req) File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection_pool.py", line 268, in handle_request raise exc File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection_pool.py", line 251, in handle_request response = connection.handle_request(request) File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection.py", line 103, in handle_request return self._connection.handle_request(request) File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 133, in handle_request raise exc File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 111, in handle_request ) = self._receive_response_headers(**kwargs) File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 176, in _receive_response_headers event = self._receive_event(timeout=timeout) File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 212, in _receive_event data = self._network_stream.read( File "/usr/local/lib/python3.9/site-packages/httpcore/_backends/sync.py", line 126, in read return self._sock.recv(max_bytes) File "/usr/local/lib/python3.9/contextlib.py", line 135, in __exit__ self.gen.throw(type, value, traceback) File "/usr/local/lib/python3.9/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions raise to_exc(exc) from exc httpcore.ReadTimeout: timed out The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/src/components/backend/core/Core.py", line 141, in run self.job() File "/src/components/backend/core/Core.py", line 162, in job missing = self.processor.getData() File "/src/components/backend/core/Processor.py", line 24, in getData missing:Iterable = self.getAllMissing() File "/src/components/backend/core/Processor.py", line 48, in getAllMissing res = self.sonarr.wantedMissing(page=page) File "/src/components/backend/connection/Sonarr.py", line 45, in wantedMissing return self.client.get("/wanted/missing", params={ File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1041, in get return self.request( File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 814, in request return self.send(request, auth=auth, follow_redirects=follow_redirects) File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 901, in send response = self._send_handling_auth( File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 929, in _send_handling_auth response = self._send_handling_redirects( Exception in thread Core: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 966, in _send_handling_redirects File "/usr/local/lib/python3.9/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions response = self._send_single_request(request) File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1002, in _send_single_request  d File "/usr/local/lib/python3.9/site-packages/httpcore/_backends/sync.py", line 126, in read response = transport.handle_request(request) File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 228, in handle_request resp = self._pool.handle_request(req) File "/usr/local/lib/python3.9/contextlib.py", line 135, in __exit__ return self._sock.recv(max_bytes) socket.timeout: timed out self.gen.throw(type, value, traceback) File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 83, in map_httpcore_exceptions The above exception was the direct cause of the following exception: raise mapped_exc(message) from exc httpx.ReadTimeout: timed out Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 66, in map_httpcore_exceptions  d File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 228, in handle_request resp = self._pool.handle_request(req) File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection_pool.py", line 268, in handle_request raise exc File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection_pool.py", line 251, in handle_request response = connection.handle_request(request) File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/connection.py", line 103, in handle_request return self._connection.handle_request(request) File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 133, in handle_request raise exc File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 111, in handle_request ) = self._receive_response_headers(**kwargs) File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 176, in _receive_response_headers event = self._receive_event(timeout=timeout) File "/usr/local/lib/python3.9/site-packages/httpcore/_sync/http11.py", line 212, in _receive_event data = self._network_stream.read( File "/usr/local/lib/python3.9/site-packages/httpcore/_backends/sync.py", line 126, in read return self._sock.recv(max_bytes) File "/usr/local/lib/python3.9/contextlib.py", line 135, in __exit__ self.gen.throw(type, value, traceback) File "/usr/local/lib/python3.9/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions raise to_exc(exc) from exc httpcore.ReadTimeout: timed out The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/src/components/backend/core/Core.py", line 141, in run self.job() File "/src/components/backend/core/Core.py", line 162, in job missing = self.processor.getData() File "/src/components/backend/core/Processor.py", line 24, in getData missing:Iterable = self.getAllMissing() File "/src/components/backend/core/Processor.py", line 48, in getAllMissing res = self.sonarr.wantedMissing(page=page) File "/src/components/backend/connection/Sonarr.py", line 45, in wantedMissing return self.client.get("/wanted/missing", params={ File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1041, in get return self.request( File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 814, in request return self.send(request, auth=auth, follow_redirects=follow_redirects) File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 901, in send response = self._send_handling_auth( File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 929, in _send_handling_auth response = self._send_handling_redirects( File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 966, in _send_handling_redirects response = self._send_single_request(request) File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1002, in _send_single_request response = transport.handle_request(request) File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 228, in handle_request resp = self._pool.handle_request(req) File "/usr/local/lib/python3.9/contextlib.py", line 135, in __exit__ self.gen.throw(type, value, traceback) File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 83, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.ReadTimeout: timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/src/components/backend/core/Core.py", line 151, in run self.log.exception(e) File "/usr/local/lib/python3.9/logging/__init__.py", line 1481, in exception self.error(msg, *args, exc_info=exc_info, **kwargs) File "/usr/local/lib/python3.9/logging/__init__.py", line 1475, in error self._log(ERROR, msg, args, **kwargs) File "/usr/local/lib/python3.9/logging/__init__.py", line 1589, in _log self.handle(record) File "/usr/local/lib/python3.9/logging/__init__.py", line 1599, in handle self.callHandlers(record) File "/usr/local/lib/python3.9/logging/__init__.py", line 1661, in callHandlers hdlr.handle(record) File "/usr/local/lib/python3.9/logging/__init__.py", line 952, in handle self.emit(record) File "/src/components/frontend_OLD/app.py", line 71, in emit socketio.emit("log", record.msg) File "/usr/local/lib/python3.9/site-packages/flask_socketio/__init__.py", line 462, in emit self.server.emit(event, *args, namespace=namespace, to=to, File "/usr/local/lib/python3.9/site-packages/socketio/server.py", line 161, in emit self.manager.emit(event, data, namespace, room=room, File "/usr/local/lib/python3.9/site-packages/socketio/manager.py", line 43, in emit encoded_packet = pkt.encode() File "/usr/local/lib/python3.9/site-packages/socketio/packet.py", line 64, in encode encoded_packet += self.json.dumps(data, separators=(',', ':')) File "/usr/local/lib/python3.9/json/__init__.py", line 234, in dumps return cls( File "/usr/local/lib/python3.9/json/encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "/usr/local/lib/python3.9/json/encoder.py", line 257, in iterencode return _iterencode(o, 0) File "/usr/local/lib/python3.9/json/encoder.py", line 179, in default raise TypeError(f'Object of type {o.__class__.__name__} ' TypeError: Object of type ReadTimeout is not JSON serializable ------------------------------------- GID/UID ------------------------------------- User uid: 1000 User gid: 1000 ------------------------------------- usermod: no changes ```
MainKronos commented 9 months ago

Sei sicuro di aver aggiornato l'immagine del docker?

docker pull ghcr.io/mainkronos/anime_downloader:dev
EffeF commented 9 months ago

Si, ho dato esattamente quel comando, ho anche riprovato adesso a ricreare l'immagine, e confermo l'errore riportato nel precedente messaggio

MainKronos commented 8 months ago

hahahaha, questa cosa รจ davvero incomprensibile ๐Ÿ˜‚. Non capisco cosa c'รจ che non funziona. Ripartiamo da questo frammento di codice (che รจ letteralmente il codice sorgente). Dimmi se funziona

import httpx
import time
from itertools import count

########################################################

SONARR_URL = "http://127.0.0.1:8080"
API_KEY = "abcdefghijklmnopqrs"

########################################################

class Sonarr:
    def __init__(self, url:str, api_key:str) -> None:
        self.url = url
        self.api_key = api_key
        self.client = httpx.Client(
            base_url=f"{url}/api/v3",
            headers={
                'X-Api-Key':api_key
            },
            timeout=5
        )
    def wantedMissing(self, n:int=20, page:int=1) -> httpx.Response:
        return self.client.get("/wanted/missing", params={
            "includeSeries": True,
            "pageSize": n,
            "page": page,
        })

sonarr = Sonarr(SONARR_URL, API_KEY)
missing = []
for page in count(1):
    res = sonarr.wantedMissing(page=page)
    res.raise_for_status()
    data = res.json()
    if len(data["records"]) == 0: break
    missing.extend(data['records'])

print(f"{len(missing)} missing episodes")

Inizio a pensare che la libreria httpx abbia qualche problema

EffeF commented 8 months ago

Dimmi se funziona

Funziona, restituisce il giusto numero di episodi mancanti senza alcun errore.

MainKronos commented 8 months ago

Dovrei aver risolto il problema (spero) con la nuova versione dev

EffeF commented 8 months ago

Sembra risolto, adesso con tutti gli anime monitorati funziona tutto senza errori!