Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #!/usr/bin/env python3
  2.  
  3. import qbittorrentapi
  4.  
  5. # instantiate a Client using the appropriate WebUI configuration
  6. qbt_client = qbittorrentapi.Client(host='pi:8080', username='admin', password='adminadmin')
  7.  
  8. # the Client will automatically acquire/maintain a logged in state in line with any request.
  9. # therefore, this is not necessary; however, you many want to test the provided login credentials.
  10. try:
  11. qbt_client.auth_log_in()
  12. except qbittorrentapi.LoginFailed as e:
  13. print(e)
  14.  
  15. #print(f'qBittorrent: {qbt_client.app.version}')
  16.  
  17. #for torrent in qbt_client.torrents_info():
  18. # print(f'{torrent.hash[-6:]}: {torrent.name} ({torrent.state})')
  19.  
  20. #help(qbt_client.torrents_add)
  21. bla=qbt_client.torrents_add(torrent_files=sys.argv[1],save_path="/m3")
  22. print(bla)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement