Advertisement
slashfan

autodl deluge

Oct 6th, 2017
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.39 KB | None | 0 0
  1. #for the autodl.cfg part, here are my settings
  2.  
  3. [options]
  4. upload-type = exec
  5. upload-command = /home99/slash/bin/deluge-console
  6. upload-args = connect 127.0.0.1:99999 ; "add $(TorrentPathName)" ; quit
  7. update-check = auto
  8. save-download-history = true
  9. max-saved-releases = 1000
  10.  
  11. -------------------------------------------------------------------------------
  12.  
  13. #Go to the directory you want to save your unregistered torrents error script. For me, I saved it in my files directory
  14.  
  15. cd files
  16. nano autodldeluge.sh
  17.  
  18. #(paste the code below)
  19. -------------------------------------------------------------------------------
  20.  
  21.  
  22. #!/bin/bash
  23. torrentid=$1
  24. torrentname=$2
  25. torrentpath=$3
  26.  
  27. x=1
  28. while [ $x -le 100 ]
  29. do
  30. sleep 2
  31. echo "Running $x times" >> ~/script.log
  32. echo "TorrentID: $torrentid" >> ~/script.log
  33. line=$(deluge-console "connect 127.0.0.1:99999; info" $1 | grep "Tracker status")
  34. echo $line >> ~/script.log
  35. case "$line" in
  36. *unregistered*|*Sent*|*End*of*file*|*Bad*Gateway*)
  37. deluge-console "connect 127.0.0.1:99999; pause '$torrentid'"
  38. sleep 3
  39. deluge-console "connect 127.0.0.1:99999; resume '$torrentid'"
  40. ;;
  41. *)
  42. echo "Found working torrent: $torrentname $torrentpath $torrentid" >> ~/script.log
  43. exit 1;;
  44. esac
  45. x=$(( $x + 1 ))
  46. done
  47.  
  48. -------------------------------------------------------------------------------
  49.  
  50. #After you saved that file, run this command
  51.  
  52. chmod +x autodldeluge.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement