Le putlog je l'ai mis en place, mais cela ne m'affiche rien sur el salon ou est donné le lien et l'erreur en PL que j'ai CC..
Je vais tenter comme tu dis des rehashs, voire restarts et re-essayer..
Je te tiens au courant
le code modifié :
Code:
proc getinfo { url } {
for { set i 1 } { $i <= 5 } { incr i } {
set rawpage [::http::data [::http::geturl "$url" -timeout 5000]]
if {[string length rawpage] > 0} { break }
}
putlog "m00nie::youtube::getinfo Rawpage length is: [string length $rawpage]"
putlog "Raw page content: $rawpage"
if {[string length $rawpage] == 0} { error "youtube returned ZERO no data :( or we couldnt connect properly" }
set ids [dict get [json::json2dict $rawpage] items]
return $ids
}
Coucou CrazyCat
Alors là bravo et merci après 2 restart et 1 rehash :
[17:58:50] <loulou>
https://www.youtube.com/watch?v=8hdBIi5c8ZE
[17:58:50] <RadioDJ> YouTube Soprano - Ninja (Clip officiel) by Soprano Officiel (duration: 3:51) on Wed Mar 04 15:00:07 CET 2020, 40943152 views
:)
Bonne fin de dimanche et bonnes vacs si tu/vous y êtes
Oups'ss je crois que j'ai du chanter trop fort.. pourtant rien modifié juste tésté :
Lien donné :
[18:21:51] <loulou>
https://www.youtube.com/watch?v=lvqxhSfVAAo
Erreur PL :
[18:21:51] <RadioDJ> [18:21:51] m00nie::youtube::autoinfo is running
[18:21:51] <RadioDJ> [18:21:51] m00nie::youtube::autoinfo url is:
www.youtube.com/watch?v=lvqxhSfVAAo and id is: lvqxhSfVAAo
[18:21:51] <RadioDJ> [18:21:51] m00nie::youtube::getinfo Rawpage length is: 340
[18:21:51] <RadioDJ> [18:21:51] Raw page content: {
[18:21:51] <RadioDJ> "error": {
[18:21:51] <RadioDJ> "code": 400,
[18:21:51] <RadioDJ> "message": "Invalid field selection dure",
[18:21:51] <RadioDJ> "errors": [
[18:21:51] <RadioDJ> {
[18:21:51] <RadioDJ> "message": "Invalid field selection dure",
[18:21:51] <RadioDJ> "domain": "global",
[18:21:51] <RadioDJ> "reason": "invalidParameter",
[18:21:51] <RadioDJ> "location": "fields",
[18:21:51] <RadioDJ> "locationType": "parameter"
[18:21:51] <RadioDJ> }
[18:21:51] <RadioDJ> ],
[18:21:51] <RadioDJ> "status": "INVALID_ARGUMENT"
[18:21:51] <RadioDJ> }
[18:21:51] <RadioDJ> }
[18:21:51] <RadioDJ> [18:21:51] Tcl error [m00nie::youtube::autoinfo]: key "items" not known in dictionary
[18:21:54] <N3O|BrB> .set errorInfo
[18:21:54] <RadioDJ> [18:21:54] #N3O# set errorInfo
[18:21:55] <RadioDJ> Currently: key "items" not known in dictionary
[18:21:55] <RadioDJ> Currently: while executing
[18:21:55] <RadioDJ> Currently: "dict get [json::json2dict $rawpage] items"
[18:21:55] <RadioDJ> Currently: (procedure "getinfo" line 9)
[18:21:55] <RadioDJ> Currently: invoked from within
[18:21:55] <RadioDJ> Currently: "getinfo $url"
[18:21:55] <RadioDJ> Currently: (procedure "m00nie::youtube::autoinfo" line 7)
[18:21:55] <RadioDJ> Currently: invoked from within
[18:21:55] <RadioDJ> Currently: "m00nie::youtube::autoinfo $_pubm1 $_pubm2 $_pubm3 $_pubm4 $_pubm5"
Tcl en PJ (j'ai renommé en -1 car retiré la "key"