bash Bash Shell Script
Download Transmission Bit Torrent - Get Torrent InfoDownload Transmission Bit Torrent - Get Torrent Info
Download Count: 155
Date Added: Sunday, 03-Jul-11 15:22:43 CDT
Tags: Transmission, shell script, torrent information,, Bit Torrent

Bash Shell Script to get information about a particular Transmission torrent.

Run the script from the command line to list all current torrents. The script then prompts you for a torrent ID. After entering the torrent ID, the scripts loops through and lists all available information about that torrent, then exits.

See my Completion Script for an example of how to use the information when a torrent completes downloading.

Make sure the file is executable (chmod 755 torrent_info.sh).

File Name: torrent_info.sh - Code Type: Bash
#!/bin/bash
 
## list current torrents
echo "Current Torrents:"
transmission-remote -l
 
## get Torrent ID from input
read -p ">>> Enter Torrent ID >>>: " TR_TORRENT_ID
 
## array of torrent fields
info=('Id:' 'Name:' 'Hash:' 'State:' 'Location:' 'Percent Done:' 'ETA:' 'Download Speed:' 'Upload Speed:' 'Have:' 'Availability:' 'Total size:' 'Downloaded:' 'Uploaded:' 'Ratio:' 'Ratio Limit:' 'Corrupt DL:' 'Peers:' 'Date added:' 'Latest activity:' 'Tracker #1:' 'Tracker #2:' 'Date created:' 'Public torrent:' 'Comment:' 'Creator:' 'Piece Count:' 'Piece Size:' 'Download Limit:' 'Upload Limit:' 'Honors Session Limits:' 'Peer limit:') 
#PIECES=()
 
## out put torrent info
array_count=${#info[@]}
index=0
while [ "$index" -lt "$array_count" ]
do   
        public=$(transmission-remote -t $TR_TORRENT_ID -i\
                   | grep "${info[$index]}"\
                   | cut -d: -f2-\
                   | sed 's/^ *//')
        echo ${info[$index]} $public
let "index += 1"
done
 
exit
Parsed in 0.067 seconds - Rate: 14.12 KB/s - GeSHi version: 1.0.8.10

Hope you find this helpful! If you have any questions, please leave a comment.


  • PHP
  • Scripts
  • MS
  • Office
  • Templates
  • and
  • Files
  • Assorted
  • Linux
  • Bash
  • Scripts
  • Perl
  • Scripts
  • PDF
  • FIles
  • MS
  • Excel
  • 2003
  • Template
  • employment
  • tools
  • job
  • search
  • tools
  • spreadsheet
  • Job
  • Search
  • Spreadsheet
  • Template
  • bash
  • shell
  • script
  • file
  • backup
  • linux
  • gzip
  • tar
  • File
  • Backup
  • Script
  • Transmission
  • shell
  • script
  • public
  • torrent
  • private
  • torrent
  • Bit
  • Torrent
  • Transmission
  • BitTorrent
  • Completion
  • Script
  • Transmission
  • shell
  • script
  • torrent
  • information
  • Bit
  • Torrent
  • Transmission
  • Bit
  • Torrent
  • Get
  • Torrent
  • Info
  • bash
  • shell
  • script
  • add
  • user
  • samba
  • samba
  • user
  • add
  • samba
  • user
  • linux
  • command
  • line
  • Add
  • System
  • and
  • Samba
  • User
  • geshi
  • pyrocms
  • php
  • codeigniter
  • PyroCMS/CodeIgniter
  • Geshi
  • Helper
  • File
  • geshi
  • pyrocms
  • php
  • codeigniter
  • GeSHi
  • Code
  • Highlighter
  • plugin
  • for
  • PyroCMS
  • perl
  • cgi
  • hit
  • counter
  • Simple
  • Perl
  • Hit
  • Counter
  • pyrocms
  • codeigniter
  • php
  • ip
  • address
  • session
  • userdata
  • PyroCMS
  • IP
  • Address
  • Plugin
  • Soyo
  • SY5SSM
  • Socket
  • 7
  • Motherboard
  • Quick
  • Start
  • Guide
  • Soyo
  • SY5SSM
  • Socket
  • 7
  • Motherboard
  • Quick
  • Start
  • Guide
  • Home
  • web
  • designit
  • supportlinuxphpbash
  • PRIVACY
  • Statement
  • LEGAL
  • Disclaimer
  • Ebay
  • Listings
  • Soyo
  • Motherboard
  • PDF
  • Why
  • I
  • Like
  • the
  • HoneyPi
  • Brand
  • IR
  • Receiver
  • Module
  • for
  • the
  • Raspberry
  • Pi
  • Using
  • GeSHi
  • Highlighter
  • with
  • PyroCMS/CodeIgniter
  • Easy
  • as
  • 1
  • 2
  • 3
  • PHP
  • Stuff
  • Raspberry
  • PI