python-qbittorrent


Namepython-qbittorrent JSON
Version 0.4.3 PyPI version JSON
download
home_pagehttps://github.com/v1k45/python-qbittorrent
SummaryPython wrapper for qBittorrent >4.1.x
upload_time2022-09-30 05:55:47
maintainer
docs_urlNone
authorVikas Yadav
requires_python
licenseThe MIT License
keywords torrent qbittorent api wrapper
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ==================
python-qBittorrent
==================

.. image:: https://readthedocs.org/projects/python-qbittorrent/badge/?version=latest
   :target: http://python-qbittorrent.readthedocs.org/en/latest/?badge=latest
   :alt: Documentation Status

.. image:: https://badge.fury.io/py/python-qbittorrent.svg
   :target: https://badge.fury.io/py/python-qbittorrent

Python wrapper for qBittorrent Web API (for versions above 4.1, for version below and above v3.1.x please use 0.3.1 version).

For qBittorrent clients with earlier versions, use *mookfist's* `python-qbittorrent <https://github.com/mookfist/python-qbittorrent>`__.

This wrapper is based on the methods described in `qBittorrent's Official Web API Documentation <https://github.com/qbittorrent/qBittorrent/wiki/Web-API-Documentation>`__

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.

Installation
============

The best way is to install a stable release from PyPI::

    $ pip install python-qbittorrent

You can also stay on the bleeding edge of the package::

    $ git clone https://github.com/v1k45/python-qBittorrent.git
    $ cd python-qBittorrent
    $ python setup.py install

Prerequisite
============

qBittorent webUI must be enabled before using this API client. `How to enable the qBittorrent Web UI <https://github.com/lgallard/qBittorrent-Controller/wiki/How-to-enable-the-qBittorrent-Web-UI>`_

Quick usage guide
=================
.. code-block:: python

    from qbittorrent import Client

    qb = Client('http://127.0.0.1:8080/')

    qb.login('admin', 'your-secret-password')
    # not required when 'Bypass from localhost' setting is active.
    # defaults to admin:admin.
    # to use defaults, just do qb.login()

    torrents = qb.torrents()

    for torrent in torrents:
        print torrent['name']


If you have enabled SSL and are using a self-signed certificate, you'd probably want to disable SSL verification. This can be done by passing `verify=False` while initializing the `Client`.

.. code-block:: python

    from qbittorrent import Client

    qb = Client('https://127.0.0.1:8080/', verify=False)


API methods
===========

Getting torrents
----------------

- Get all ``active`` torrents::

    qb.torrents()

- Filter torrents::

    qb.torrents(filter='downloading', category='my category')
    # This will return all torrents which are currently
    # downloading and are labeled as ``my category``.

    qb.torrents(filter='paused', sort='ratio')
    # This will return all paused torrents sorted by their Leech:Seed ratio.

Refer qBittorents WEB API documentation for all possible filters.

Downloading torrents
--------------------

- Download torrents by link::

    magnet_link = "magnet:?xt=urn:btih:e334ab9ddd91c10938a7....."
    qb.download_from_link(magnet_link)

    # No matter the link is correct or not,
    # method will always return empty JSON object.

- Download multipe torrents by list of links::

    link_list = [link1, link2, link3]
    qb.download_from_link(link_list)

- Downloading torrents by file::

    torrent_file = open('my-torrent-file.torrent', 'rb')
    qb.download_from_file(torrent_file)

- Downloading multiple torrents by using files::

    torrent_file_list = [open('1.torrent', 'rb'), open('2.torrent', 'rb')]
    qb.download_from_file(torrent_file_list)

- Specifing save path for downloads::

    dl_path = '/home/user/Downloads/special-dir/'
    qb.download_from_file(myfile, savepath=dl_path)

    # same for links.
    qb.download_from_link(my_magnet_uri, savepath=dl_path)

- Applying labels to downloads::

    qb.download_from_file(myfile, label='secret-files ;) ')

    # same for links.
    qb.download_from_link(my_magnet_uri, category='anime')

Pause / Resume torrents
-----------------------

- Pausing/ Resuming all torrents::

    qb.pause_all()
    qb.resume_all()

- Pausing/ Resuming a speicific torrent::

    info_hash = 'e334ab9ddd....infohash....5d7fff526cb4'
    qb.pause(info_hash)
    qb.resume(info_hash)

- Pausing/ Resuming multiple torrents::

    info_hash_list = ['e334ab9ddd9......infohash......fff526cb4',
                      'c9dc36f46d9......infohash......90ebebc46',
                      '4c859243615......infohash......8b1f20108']

    qb.pause_multiple(info_hash_list)
    qb.resume_multipe(info_hash_list)


Full API method documentation
=============================

All API methods of qBittorrent are mentioned @ `Read the docs <http://python-qbittorrent.readthedocs.org/en/latest/?badge=latest>`__

Authors
=======

Maintainer
----------

- `Vikas Yadav (v1k45) <https://www.github.com/v1k45/>`__

Contributors
------------

*By chronological order*

- `Matt Smith (psykzz) <https://github.com/psykzz>`__
- `Nicolas Wright (dozedoff) <https://github.com/dozedoff>`__
- `sbivol <https://github.com/sbivol>`__
- `Christophe Ha (Shaance) <https://github.com/Shaance>`__
- Your name here :)

TODO
====

- Write tests

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/v1k45/python-qbittorrent",
    "name": "python-qbittorrent",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "torrent,qBittorent,API,wrapper",
    "author": "Vikas Yadav",
    "author_email": "v1k45x@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/86/25/a5ad35ad229c8016a8c98327495e649cb795be2fda63f8cace6c9a739af7/python-qbittorrent-0.4.3.tar.gz",
    "platform": "OS Independent",
    "description": "==================\npython-qBittorrent\n==================\n\n.. image:: https://readthedocs.org/projects/python-qbittorrent/badge/?version=latest\n   :target: http://python-qbittorrent.readthedocs.org/en/latest/?badge=latest\n   :alt: Documentation Status\n\n.. image:: https://badge.fury.io/py/python-qbittorrent.svg\n   :target: https://badge.fury.io/py/python-qbittorrent\n\nPython wrapper for qBittorrent Web API (for versions above 4.1, for version below and above v3.1.x please use 0.3.1 version).\n\nFor qBittorrent clients with earlier versions, use *mookfist's* `python-qbittorrent <https://github.com/mookfist/python-qbittorrent>`__.\n\nThis wrapper is based on the methods described in `qBittorrent's Official Web API Documentation <https://github.com/qbittorrent/qBittorrent/wiki/Web-API-Documentation>`__\n\nSome methods are only supported in qBittorent's latest version (v3.3.1 when writing).\n\nIt'll be best if you upgrade your client to a latest version.\n\nInstallation\n============\n\nThe best way is to install a stable release from PyPI::\n\n    $ pip install python-qbittorrent\n\nYou can also stay on the bleeding edge of the package::\n\n    $ git clone https://github.com/v1k45/python-qBittorrent.git\n    $ cd python-qBittorrent\n    $ python setup.py install\n\nPrerequisite\n============\n\nqBittorent webUI must be enabled before using this API client. `How to enable the qBittorrent Web UI <https://github.com/lgallard/qBittorrent-Controller/wiki/How-to-enable-the-qBittorrent-Web-UI>`_\n\nQuick usage guide\n=================\n.. code-block:: python\n\n    from qbittorrent import Client\n\n    qb = Client('http://127.0.0.1:8080/')\n\n    qb.login('admin', 'your-secret-password')\n    # not required when 'Bypass from localhost' setting is active.\n    # defaults to admin:admin.\n    # to use defaults, just do qb.login()\n\n    torrents = qb.torrents()\n\n    for torrent in torrents:\n        print torrent['name']\n\n\nIf you have enabled SSL and are using a self-signed certificate, you'd probably want to disable SSL verification. This can be done by passing `verify=False` while initializing the `Client`.\n\n.. code-block:: python\n\n    from qbittorrent import Client\n\n    qb = Client('https://127.0.0.1:8080/', verify=False)\n\n\nAPI methods\n===========\n\nGetting torrents\n----------------\n\n- Get all ``active`` torrents::\n\n    qb.torrents()\n\n- Filter torrents::\n\n    qb.torrents(filter='downloading', category='my category')\n    # This will return all torrents which are currently\n    # downloading and are labeled as ``my category``.\n\n    qb.torrents(filter='paused', sort='ratio')\n    # This will return all paused torrents sorted by their Leech:Seed ratio.\n\nRefer qBittorents WEB API documentation for all possible filters.\n\nDownloading torrents\n--------------------\n\n- Download torrents by link::\n\n    magnet_link = \"magnet:?xt=urn:btih:e334ab9ddd91c10938a7.....\"\n    qb.download_from_link(magnet_link)\n\n    # No matter the link is correct or not,\n    # method will always return empty JSON object.\n\n- Download multipe torrents by list of links::\n\n    link_list = [link1, link2, link3]\n    qb.download_from_link(link_list)\n\n- Downloading torrents by file::\n\n    torrent_file = open('my-torrent-file.torrent', 'rb')\n    qb.download_from_file(torrent_file)\n\n- Downloading multiple torrents by using files::\n\n    torrent_file_list = [open('1.torrent', 'rb'), open('2.torrent', 'rb')]\n    qb.download_from_file(torrent_file_list)\n\n- Specifing save path for downloads::\n\n    dl_path = '/home/user/Downloads/special-dir/'\n    qb.download_from_file(myfile, savepath=dl_path)\n\n    # same for links.\n    qb.download_from_link(my_magnet_uri, savepath=dl_path)\n\n- Applying labels to downloads::\n\n    qb.download_from_file(myfile, label='secret-files ;) ')\n\n    # same for links.\n    qb.download_from_link(my_magnet_uri, category='anime')\n\nPause / Resume torrents\n-----------------------\n\n- Pausing/ Resuming all torrents::\n\n    qb.pause_all()\n    qb.resume_all()\n\n- Pausing/ Resuming a speicific torrent::\n\n    info_hash = 'e334ab9ddd....infohash....5d7fff526cb4'\n    qb.pause(info_hash)\n    qb.resume(info_hash)\n\n- Pausing/ Resuming multiple torrents::\n\n    info_hash_list = ['e334ab9ddd9......infohash......fff526cb4',\n                      'c9dc36f46d9......infohash......90ebebc46',\n                      '4c859243615......infohash......8b1f20108']\n\n    qb.pause_multiple(info_hash_list)\n    qb.resume_multipe(info_hash_list)\n\n\nFull API method documentation\n=============================\n\nAll API methods of qBittorrent are mentioned @ `Read the docs <http://python-qbittorrent.readthedocs.org/en/latest/?badge=latest>`__\n\nAuthors\n=======\n\nMaintainer\n----------\n\n- `Vikas Yadav (v1k45) <https://www.github.com/v1k45/>`__\n\nContributors\n------------\n\n*By chronological order*\n\n- `Matt Smith (psykzz) <https://github.com/psykzz>`__\n- `Nicolas Wright (dozedoff) <https://github.com/dozedoff>`__\n- `sbivol <https://github.com/sbivol>`__\n- `Christophe Ha (Shaance) <https://github.com/Shaance>`__\n- Your name here :)\n\nTODO\n====\n\n- Write tests\n",
    "bugtrack_url": null,
    "license": "The MIT License",
    "summary": "Python wrapper for qBittorrent >4.1.x",
    "version": "0.4.3",
    "split_keywords": [
        "torrent",
        "qbittorent",
        "api",
        "wrapper"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e2839dd55e6c916b1dc6ce1fdd373c1c0c4aa1635bbc5f2e1c8770987625631f",
                "md5": "33afd7816a4957b1c8e9d99022ff1a61",
                "sha256": "dc2583226b69916ab96735537abd7696acc52e02e2d4d7afd10fa976f10d3aaa"
            },
            "downloads": -1,
            "filename": "python_qbittorrent-0.4.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "33afd7816a4957b1c8e9d99022ff1a61",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 9758,
            "upload_time": "2022-09-30T05:55:45",
            "upload_time_iso_8601": "2022-09-30T05:55:45.378593Z",
            "url": "https://files.pythonhosted.org/packages/e2/83/9dd55e6c916b1dc6ce1fdd373c1c0c4aa1635bbc5f2e1c8770987625631f/python_qbittorrent-0.4.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8625a5ad35ad229c8016a8c98327495e649cb795be2fda63f8cace6c9a739af7",
                "md5": "2d2cd5d93f750ffdb99c5ac5221f926f",
                "sha256": "4e22cf89890628b054a60aa4bd1161a68c2b0fad48ef0886fa4d325e69d3828a"
            },
            "downloads": -1,
            "filename": "python-qbittorrent-0.4.3.tar.gz",
            "has_sig": false,
            "md5_digest": "2d2cd5d93f750ffdb99c5ac5221f926f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 9732,
            "upload_time": "2022-09-30T05:55:47",
            "upload_time_iso_8601": "2022-09-30T05:55:47.070450Z",
            "url": "https://files.pythonhosted.org/packages/86/25/a5ad35ad229c8016a8c98327495e649cb795be2fda63f8cace6c9a739af7/python-qbittorrent-0.4.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-09-30 05:55:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "v1k45",
    "github_project": "python-qbittorrent",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "python-qbittorrent"
}
        
Elapsed time: 0.04895s