
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
github.com/imerkle/go-qbittorrent
Golang wrapper for qBittorrent Web API (for versions above v3.1.x).
This wrapper is based on the methods described in qBittorrent's Official Web API Documentation <https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-Documentation>
__
This project is based on the Python wrapper by v1k45 <https://github.com/v1k45/python-qBittorrent>
__
Some methods are only supported in qBittorent's latest version (v3.3.1 when writing).
It'll be best if you upgrade your client to a latest version.
An example can be found in main.go
The best way is to install with go get::
$ go get github.com/superturkey650/go-qbittorrent/qbt
.. code-block:: go
import (
"superturkey650/go-qbittorrent/qbt
)
qb := qbt.NewClient("http://localhost:8080/")
qb.Login("admin", "your-secret-password")
// not required when 'Bypass from localhost' setting is active.
torrents = qb.Torrents()
for torrent := range torrents{
fmt.Println(torrent.name)
}
Get all active
torrents::
.. code-block:: go
qb.Torrents()
Filter torrents:: .. code-block:: go
filters := map[string]string{
"filter": "downloading",
"category": "my category",
}
qb.Torrents(filters)
// This will return all torrents which are currently
// downloading and are labeled as my category
.
filters := map[string]string{ "filter": paused, "sort": ratio, } qb.Torrents(filters) // This will return all paused torrents sorted by their Leech:Seed ratio.
Refer to qBittorents WEB API documentation for all possible filters.
Download torrents by link:: .. code-block:: go
options := map[string]string{} magnetLink = "magnet:?xt=urn:btih:e334ab9ddd91c10938a7....." qb.DownloadFromLink(magnetLink, options)
// Will return response object with 200:OK
status code
// regardless of sucess of failure.
Download multipe torrents by looping over links:: .. code-block:: go
options := map[string]string{} links := [...]string{link1, link2, link3} for l := range links{ qb.DownloadFromLink(l, options) }
Downloading torrents by file:: .. code-block:: go
options := map[string]string{} file = "path/to/file.torrent" qb.DownloadFromFile(file, options)
Downloading multiple torrents by using files:: .. code-block:: go
options := map[string]string{} file = [...]string{path/to/file1, path/to/file2, path/to/file3} qb.DownloadFromFile(file, options)
Specifing save path for downloads:: .. code-block:: go
savePath = "/home/user/Downloads/special-dir/" options := map[string]string{ "savepath": savePath } file = "path/to/file.torrent" qb.DownloadFromFile(file, options)
// same for links. savePath = "/home/user/Downloads/special-dir/" options := map[string]string{ "savepath": savePath } magnetLink = "magnet:?xt=urn:btih:e334ab9ddd91c10938a7....." qb.DownloadFromLink(magnetLink, options)
Applying labels to downloads:: .. code-block:: go
label = "secret-files ;)" options := map[string]string{ "label": label } file = "path/to/file.torrent" qb.DownloadFromFile(file, options)
// same for links. category = "anime" options := map[string]string{ "label": label } magnetLink = "magnet:?xt=urn:btih:e334ab9ddd91c10938a7....." qb.DownloadFromLink(magnetLink, options)
Pausing/ Resuming all torrents:: .. code-block:: go
qb.PauseAll() qb.ResumeAll()
Pausing/ Resuming a specific torrent:: .. code-block:: go
infoHash = "e334ab9ddd....infohash....5d7fff526cb4" qb.Pause(infoHash) qb.Resume(infoHash)
Pausing/ Resuming multiple torrents:: .. code-block:: go
infoHashes = [...]string{ "e334ab9ddd9......infohash......fff526cb4", "c9dc36f46d9......infohash......90ebebc46", "4c859243615......infohash......8b1f20108", }
qb.PauseMultiple(infoHashes) qb.ResumeMultiple(infoHashes)
All API methods of qBittorrent are mentioned in docs.txt
Jared Mosley (jaredlmosley) <https://www.github.com/superturkey650/>
__FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.