Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- import qbittorrentapi
- # instantiate a Client using the appropriate WebUI configuration
- qbt_client = qbittorrentapi.Client(host='pi:8080', username='admin', password='adminadmin')
- # the Client will automatically acquire/maintain a logged in state in line with any request.
- # therefore, this is not necessary; however, you many want to test the provided login credentials.
- try:
- qbt_client.auth_log_in()
- except qbittorrentapi.LoginFailed as e:
- print(e)
- #print(f'qBittorrent: {qbt_client.app.version}')
- #for torrent in qbt_client.torrents_info():
- # print(f'{torrent.hash[-6:]}: {torrent.name} ({torrent.state})')
- #help(qbt_client.torrents_add)
- bla=qbt_client.torrents_add(torrent_files=sys.argv[1],save_path="/m3")
- print(bla)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement