Skip to content

autobrr/go-deluge

 
 

Repository files navigation

go-libdeluge

Go library for native RPC connection to a Deluge daemon; it uses go-rencode for the RPC protocol serialization/deserialization.

Release blog post.

License

GNU GPL version 2

How to use

The library by itself is a Go package and needs to be embedded in a UI or CLI application.

	// you can use NewV1 to create a client for Deluge v1.3
	client := deluge.NewV2(deluge.Settings{
		Hostname:              "localhost",
		Port:                  58846,
		Login:                 "localclient",
		Password:              "*************",
	})

	// perform connection to Deluge server
	err := client.Connect(context.Background())

	// ... use the client methods

To debug the library you may want to set DebugServerResponses to true.

Supported deluge versions

Both deluge v2.0+ and v1.3+ are supported with the two different constructors NewV2 and NewV1.

RPC API supported methods

  • daemon.login
  • daemon.info
  • daemon.authorized_call
  • daemon.get_method_list
  • daemon.get_version
  • daemon.shutdown
  • core.add_torrent_file
  • core.add_torrent_file_async
  • core.add_torrent_files
  • core.add_torrent_magnet
  • core.add_torrent_url
  • core.connect_peer
  • core.create_account
  • core.create_torrent
  • core.disable_plugin
  • core.enable_plugin
  • core.force_reannounce
  • core.force_recheck
  • core.get_auth_levels_mappings
  • core.get_available_plugins
  • core.get_completion_paths
  • core.get_config
  • core.get_config_value
  • core.get_config_values
  • core.get_enabled_plugins
  • core.get_external_ip
  • core.get_filter_tree
  • core.get_free_space
  • core.get_known_accounts
  • core.get_libtorrent_version
  • core.get_listen_port
  • core.get_path_size
  • core.get_proxy
  • core.get_session_state
  • core.get_session_status
  • core.get_torrent_status
  • core.get_torrents_status
  • core.glob
  • core.is_session_paused
  • core.move_storage
  • core.pause_session
  • core.pause_torrent
  • core.pause_torrents
  • core.prefetch_magnet_metadata
  • core.queue_bottom
  • core.queue_down
  • core.queue_top
  • core.queue_up
  • core.remove_account
  • core.remove_torrent
  • core.remove_torrents
  • core.rename_files
  • core.rename_folder
  • core.rescan_plugins
  • core.resume_session
  • core.resume_torrent
  • core.resume_torrents
  • core.set_config
  • core.set_torrent_options
  • core.set_torrent_trackers
  • core.test_listen_port
  • core.update_account
  • core.upload_plugin

Plugins

Plugins can be used by calling the relative method and checking if the result is not nil, example:

	p, err := deluge.LabelPlugin()
	if err != nil {
		panic(err)
	}
	if p == nil {
		println("Label plugin not available")
		return
	}

	// call plugin methods
	labelsByTorrent, err := p.GetTorrentsLabels(delugeclient.StateUnspecified, nil)

Label

RPC API supported methods

  • label.add
  • label.get_config
  • label.get_labels
  • label.get_options
  • label.remove
  • label.set_config
  • label.set_options
  • label.set_torrent

About

A native Deluge RPC client library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 95.7%
  • Shell 3.9%
  • Makefile 0.4%