Torrent viewer

Contenu du snippet

Script by Dark-Neko
Nom: Torrent Viewer
Version: 2.0
Description: Affiche les torrents actifs dans BitTorrent et Utorrent
/!\ installation de WebUI obligatoire /!\
Tester avec BitTorrent 6.3 (Build 16973)
Utilisation: Modifier les variables dans l'alias torrent.load puis taper /torrent.load pour charger la configuration. Taper /torrent pour utiliser
le script. vous pouvez aussi l'utiliser aussi avec un timer.

Information:
Tester sur vista, BitTorrent 6.3 (Build 16973).
Pour installer WebUI, télécharger http://www.utorrent.com/webui/webui.zip
puis déplacer le fichier webui.zip dans C:\Users\<user>\AppData\Roaming\BitTorrent pour BitTorrent ou C:\Users\<utorrent>\AppData\Roaming\Utorrent pour utorrent.

Ouvrer BitTorrent ou Utorrent, aller dans Options > Preferences > Web Ui, cocher "enable web ui", modifier Username et Password si vous le voulez.
Et cocher "Alternative listening port".

------------

Version 2.0

Listage des torrents:
/torrent.list

Action sur les torrents:
/torrent.action [start/stop/pause/unpause/forcestart/recheck/remove/removedata] [hash]

/torrent.action [dl/up] [<chiffre en KB surtout pas de /s apres le chiffre>] [hash]

Source / Exemple :


###################################
##      Script by Dark-Neko      ##
##      Nom: Torrent Viewer      ##
##          Version: 2.0         ##
##          Description:         ##
##  Affiche les torrents actifs  ##
##  dans BitTorrent et Utorrent  ##
##  /!\ Installation de WebUI    ##
##         obligatoire /!\       ##
##  Tester avec BiTorrent 6.3    ##
##          (Build 16973)        ##
##           Utilisation:        ##
##  Modifier les variables dans  ##
##   l'alias torrent.load puis   ##
##    taper /torrent.load pour   ##
##   charger la configuration    ##
## Taper /torrent pour utiliser  ##
## vous pouvez aussi l'utiliser  ##
##      aussi avec un timer      ##
###################################
alias torrent.load {
  ;### Configuration

  ;#Adresse IP (Ne pas toucher si BitTorrent sur votre ordinateur)
  set %torrent.adresse.ip localhost

  ;#Port du WebUI (8080 par défaut)
  set %torrent.adresse.port 8080

  ;#WebUI Pseudo
  set %torrent.webui.pseudo admin

  ;#WebUI Mot de passe
  set %torrent.webui.mdp 101094

  ;#Chan (ne pas modifier sauf si vous voulez utiliser un timer)
  set %torrent.chan $chan

  ;### Echo
  echo Chargement Ok
}

alias torrent {
  ;#Chargement
  sockclose torrent
  sockopen torrent %torrent.adresse.ip %torrent.adresse.port
}
on *:sockopen:torrent:{
  sockwrite -n torrent GET /gui/?list=1 HTTP/1.1
  sockwrite -n $sockname Host: %torrent.adresse.ip
  sockwrite -nt $sockname Authorization: Basic $encode(%torrent.webui.pseudo $+ : $+ %torrent.webui.mdp,m)
  sockwrite -nt $sockname $crlf
}
on *:sockread:torrent:{
  var %torrent.x
  sockread %torrent.x
  if ($gettok(%torrent.x,2,44) == 201) {
    set %torrent.pr $calc($calc($gettok(%torrent.x,6,44) / $gettok(%torrent.x,4,44)) * 100)
    if (%torrent.pr >= 0) { set %torrent.statbar 15|||||||||| }
    if (%torrent.pr >= 20) { set %torrent.statbar 9||15|||||||| }
    if (%torrent.pr >= 30) { set %torrent.statbar 9|||15||||||| }
    if (%torrent.pr >= 40) { set %torrent.statbar 9||||15|||||| }
    if (%torrent.pr >= 50) { set %torrent.statbar 9|||||15||||| }
    if (%torrent.pr >= 60) { set %torrent.statbar 9||||||15|||| }
    if (%torrent.pr >= 70) { set %torrent.statbar 9|||||||15||| }
    if (%torrent.pr >= 80) { set %torrent.statbar 9||||||||15|| }
    if (%torrent.pr >= 90) { set %torrent.statbar 9|||||||||15| }
    if (%torrent.pr >= 100) { set %torrent.statbar 9|||||||||| }
    msg %torrent.chan $remove($gettok(%torrent.x,3,44),") 15-7 $round($calc($calc($gettok(%torrent.x,6,44) / $gettok(%torrent.x,4,44)) * 100),1) $+ % [ %torrent.statbar ] 6  $round($calc($calc($gettok(%torrent.x,4,44) - $gettok(%torrent.x,6,44)) / 1048576),2) MO restant 152 $round($calc($gettok(%torrent.x,6,44) / 1048576),2) 14/12  $round($calc($gettok(%torrent.x,4,44) / 1048576),2)  15 5DL: $round($calc($gettok(%torrent.x,10,44) / 1024),1) KB/s 3UP: $round($calc($gettok(%torrent.x,9,44) / 1024),1) KB/s 15|| Encore:6  $duration($calc($calc($calc($gettok(%torrent.x,4,44) - $gettok(%torrent.x,6,44)) / 1024) / $calc($gettok(%torrent.x,10,44) / 1024)),3)
  }
}
# Torrent.list
alias torrent.list {
  window @torrent
  ;#Chargement
  sockclose torrent.list
  sockopen torrent.list %torrent.adresse.ip %torrent.adresse.port
}
on *:sockopen:torrent.list:{
  sockwrite -n torrent.list GET /gui/?list=1 HTTP/1.1
  sockwrite -n $sockname Host: %torrent.adresse.ip
  sockwrite -nt $sockname Authorization: Basic $encode(%torrent.webui.pseudo $+ : $+ %torrent.webui.mdp,m)
  sockwrite -nt $sockname $crlf
}
on *:sockread:torrent.list:{
  var %torrent.list.x
  sockread %torrent.list.x
  if ($gettok(%torrent.list.x,2,44) == 201) {
    aline @torrent 12#################################
    aline @torrent Nom: $remove($gettok(%torrent.list.x,3,44),")
    aline @torrent Etat: Actif / Download
    aline @torrent Hash: $gettok(%torrent.list.x,2,34)   
  } 
  if ($gettok(%torrent.list.x,2,44) == 200) {
    aline @torrent 4#################################
    aline @torrent Nom: $remove($gettok(%torrent.list.x,3,44),")
    aline @torrent Etat: Fini / Seed
    aline @torrent Hash: $gettok(%torrent.list.x,2,34)   
  } 
  if ($gettok(%torrent.list.x,6,44) == $gettok(%torrent.list.x,4,44) && $gettok(%torrent.list.x,2,34) != torrentc && $remove($gettok(%torrent.list.x,3,44),") != $null) {
    aline @torrent 14#################################
    aline @torrent Nom: $remove($gettok(%torrent.list.x,3,44),")
    aline @torrent Etat: Fini / Stop
    aline @torrent Hash: $gettok(%torrent.list.x,2,34)   
  }
  if ($gettok(%torrent.list.x,6,44) != $gettok(%torrent.list.x,4,44) && $gettok(%torrent.list.x,2,44) != 201) {
    aline @torrent 3#################################
    aline @torrent Nom: $remove($gettok(%torrent.list.x,3,44),")
    aline @torrent Etat: Pause
    aline @torrent Hash: $gettok(%torrent.list.x,2,34)   
  }
}
# Torrent.action
alias Torrent.action {

  if ($1 != set) {
    if ($2 != $null) {
      set %torrent.action $1
      ;#Chargement
      set %torrent.action.hash $2
      sockclose torrent.action
      sockopen torrent.action %torrent.adresse.ip %torrent.adresse.port
    }
    else {
      echo Erreur ! Entrer le hash du torrent
    }
  }
  if ($1 == set && $2 == dl) {
    set %torrent.action.hash $4 $+ &s=dlrate&v= $+ $calc($3 * 1024)
    set %torrent.action setprops 
    sockclose torrent.action
    sockopen torrent.action %torrent.adresse.ip %torrent.adresse.port
  }
  if ($1 == set && $2 == up) {
    set %torrent.action.hash $4 $+ &s=ulrate&v= $+ $calc($3 * 1024)
    set %torrent.action setprops 
    sockclose torrent.action
    sockopen torrent.action %torrent.adresse.ip %torrent.adresse.port
  }
}
on *:sockopen:torrent.action:{
  sockwrite -n torrent.action GET /gui/?action= $+ %torrent.action $+ &hash= $+ %torrent.action.hash HTTP/1.1
  sockwrite -n $sockname Host: %torrent.adresse.ip
  sockwrite -nt $sockname Authorization: Basic $encode(%torrent.webui.pseudo $+ : $+ %torrent.webui.mdp,m)
  sockwrite -nt $sockname $crlf
}

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.