demagnetize


Namedemagnetize JSON
Version 0.3.0 PyPI version JSON
download
home_page
SummaryConvert magnet links to .torrent files
upload_time2023-11-19 19:19:42
maintainer
docs_urlNone
author
requires_python>=3.10
license
keywords bittorrent magnet link torrent
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://www.repostatus.org/badges/latest/active.svg
    :target: https://www.repostatus.org/#active
    :alt: Project Status: Active — The project has reached a stable, usable
          state and is being actively developed.

.. image:: https://github.com/jwodder/demagnetize/actions/workflows/test.yml/badge.svg
    :target: https://github.com/jwodder/demagnetize/actions/workflows/test.yml
    :alt: CI Status

.. image:: https://codecov.io/gh/jwodder/demagnetize/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/jwodder/demagnetize

.. image:: https://img.shields.io/pypi/pyversions/demagnetize.svg
    :target: https://pypi.org/project/demagnetize/

.. image:: https://img.shields.io/github/license/jwodder/demagnetize.svg
    :target: https://opensource.org/licenses/MIT
    :alt: MIT License

`GitHub <https://github.com/jwodder/demagnetize>`_
| `PyPI <https://pypi.org/project/demagnetize/>`_
| `Issues <https://github.com/jwodder/demagnetize/issues>`_
| `Changelog <https://github.com/jwodder/demagnetize/blob/master/CHANGELOG.md>`_

``demagnetize`` is a Python program for converting one or more BitTorrent
`magnet links`_ into ``.torrent`` files by downloading the torrent info from
active peers.

.. _magnet links: https://en.wikipedia.org/wiki/Magnet_URI_scheme

At the moment, ``demagnetize`` only supports basic features of the BitTorrent
protocol.  The following notable features are supported:

- BitTorrent protocol v1
- HTTP (including compact and IPv6 extensions) and UDP trackers
- magnet URIs with info hashes encoded in either hexadecimal or base32
- Fast extension (`BEP 6`_)
- UDP tracker protocol extensions (`BEP 41`_)

.. _BEP 6: https://www.bittorrent.org/beps/bep_0006.html
.. _BEP 41: https://www.bittorrent.org/beps/bep_0041.html

The following features are not currently supported but are planned, in no
particular order:

- Encryption
- Distributed hash tables
- BitTorrent protocol v2
- ``x.pe`` parameters in magnet links
- uTP

``demagnetize`` has also been translated by the author into Rust; you can find
the Rust version at <https://github.com/jwodder/demagnetize-rs>.


Installation
============
``demagnetize`` requires Python 3.10 or higher.  Just use `pip
<https://pip.pypa.io>`_ for Python 3 (You have pip, right?) to install it::

    python3 -m pip install demagnetize


Usage
=====

::

    demagnetize [<global options>] <subcommand> ...

The ``demagnetize`` command has two subcommands, ``get`` (for converting a
single magnet link) and ``batch`` (for converting a file of magnet links), both
detailed below.

Global Options
--------------

-l LEVEL, --log-level LEVEL
                        Set the log level to the given value.  Possible values
                        are "``CRITICAL``", "``ERROR``", "``WARNING``",
                        "``INFO``", "``DEBUG``", and "``TRACE``" (all
                        case-insensitive).  [default value: ``INFO``]


``demagnetize get``
-------------------

::

    demagnetize [<global options>] get [<options>] <magnet-link>

Convert a single magnet link specified on the command line to a ``.torrent``
file.  (Note that you will likely have to quote the link in order to prevent it
from being interpreted by the shell.)  By default, the file is saved at
``{name}.torrent``, where ``{name}`` is replaced by the value of the ``name``
field from the torrent info, but a different path can be set via the
``--outfile`` option.

Options
^^^^^^^

-o PATH, --outfile PATH
                        Save the ``.torrent`` file to the given path.  The path
                        may contain a ``{name}`` placeholder, which will be
                        replaced by the (sanitized) name of the torrent, and/or
                        a ``{hash}`` placeholder, which will be replaced by the
                        torrent's info hash in hexadecimal.  Specifying ``-``
                        will cause the torrent to be written to standard
                        output.  [default: ``{name}.torrent``]


``demagnetize batch``
---------------------

::

    demagnetize [<global options>] batch [<options>] <file>

Read magnet links from ``<file>``, one per line (ignoring empty lines and lines
that start with ``#``), and convert each one to a ``.torrent`` file.  By
default, each file is saved at ``{name}.torrent``, where ``{name}`` is replaced
by the value of the ``name`` field from the torrent info, but a different path
can be set via the ``--outfile`` option.

Options
^^^^^^^

-o PATH, --outfile PATH
                        Save the ``.torrent`` files to the given path.  The
                        path may contain a ``{name}`` placeholder, which will
                        be replaced by the (sanitized) name of each torrent,
                        and/or a ``{hash}`` placeholder, which will be replaced
                        by each torrent's info hash in hexadecimal.  [default:
                        ``{name}.torrent``]

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "demagnetize",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "bittorrent,magnet link,torrent",
    "author": "",
    "author_email": "John Thorvald Wodder II <demagnetize@varonathe.org>",
    "download_url": "https://files.pythonhosted.org/packages/4c/06/761ea05bd9367379f70afcc93db40d57f0b7ce423250dbf9d15729676c7f/demagnetize-0.3.0.tar.gz",
    "platform": null,
    "description": ".. image:: https://www.repostatus.org/badges/latest/active.svg\n    :target: https://www.repostatus.org/#active\n    :alt: Project Status: Active \u2014 The project has reached a stable, usable\n          state and is being actively developed.\n\n.. image:: https://github.com/jwodder/demagnetize/actions/workflows/test.yml/badge.svg\n    :target: https://github.com/jwodder/demagnetize/actions/workflows/test.yml\n    :alt: CI Status\n\n.. image:: https://codecov.io/gh/jwodder/demagnetize/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/jwodder/demagnetize\n\n.. image:: https://img.shields.io/pypi/pyversions/demagnetize.svg\n    :target: https://pypi.org/project/demagnetize/\n\n.. image:: https://img.shields.io/github/license/jwodder/demagnetize.svg\n    :target: https://opensource.org/licenses/MIT\n    :alt: MIT License\n\n`GitHub <https://github.com/jwodder/demagnetize>`_\n| `PyPI <https://pypi.org/project/demagnetize/>`_\n| `Issues <https://github.com/jwodder/demagnetize/issues>`_\n| `Changelog <https://github.com/jwodder/demagnetize/blob/master/CHANGELOG.md>`_\n\n``demagnetize`` is a Python program for converting one or more BitTorrent\n`magnet links`_ into ``.torrent`` files by downloading the torrent info from\nactive peers.\n\n.. _magnet links: https://en.wikipedia.org/wiki/Magnet_URI_scheme\n\nAt the moment, ``demagnetize`` only supports basic features of the BitTorrent\nprotocol.  The following notable features are supported:\n\n- BitTorrent protocol v1\n- HTTP (including compact and IPv6 extensions) and UDP trackers\n- magnet URIs with info hashes encoded in either hexadecimal or base32\n- Fast extension (`BEP 6`_)\n- UDP tracker protocol extensions (`BEP 41`_)\n\n.. _BEP 6: https://www.bittorrent.org/beps/bep_0006.html\n.. _BEP 41: https://www.bittorrent.org/beps/bep_0041.html\n\nThe following features are not currently supported but are planned, in no\nparticular order:\n\n- Encryption\n- Distributed hash tables\n- BitTorrent protocol v2\n- ``x.pe`` parameters in magnet links\n- uTP\n\n``demagnetize`` has also been translated by the author into Rust; you can find\nthe Rust version at <https://github.com/jwodder/demagnetize-rs>.\n\n\nInstallation\n============\n``demagnetize`` requires Python 3.10 or higher.  Just use `pip\n<https://pip.pypa.io>`_ for Python 3 (You have pip, right?) to install it::\n\n    python3 -m pip install demagnetize\n\n\nUsage\n=====\n\n::\n\n    demagnetize [<global options>] <subcommand> ...\n\nThe ``demagnetize`` command has two subcommands, ``get`` (for converting a\nsingle magnet link) and ``batch`` (for converting a file of magnet links), both\ndetailed below.\n\nGlobal Options\n--------------\n\n-l LEVEL, --log-level LEVEL\n                        Set the log level to the given value.  Possible values\n                        are \"``CRITICAL``\", \"``ERROR``\", \"``WARNING``\",\n                        \"``INFO``\", \"``DEBUG``\", and \"``TRACE``\" (all\n                        case-insensitive).  [default value: ``INFO``]\n\n\n``demagnetize get``\n-------------------\n\n::\n\n    demagnetize [<global options>] get [<options>] <magnet-link>\n\nConvert a single magnet link specified on the command line to a ``.torrent``\nfile.  (Note that you will likely have to quote the link in order to prevent it\nfrom being interpreted by the shell.)  By default, the file is saved at\n``{name}.torrent``, where ``{name}`` is replaced by the value of the ``name``\nfield from the torrent info, but a different path can be set via the\n``--outfile`` option.\n\nOptions\n^^^^^^^\n\n-o PATH, --outfile PATH\n                        Save the ``.torrent`` file to the given path.  The path\n                        may contain a ``{name}`` placeholder, which will be\n                        replaced by the (sanitized) name of the torrent, and/or\n                        a ``{hash}`` placeholder, which will be replaced by the\n                        torrent's info hash in hexadecimal.  Specifying ``-``\n                        will cause the torrent to be written to standard\n                        output.  [default: ``{name}.torrent``]\n\n\n``demagnetize batch``\n---------------------\n\n::\n\n    demagnetize [<global options>] batch [<options>] <file>\n\nRead magnet links from ``<file>``, one per line (ignoring empty lines and lines\nthat start with ``#``), and convert each one to a ``.torrent`` file.  By\ndefault, each file is saved at ``{name}.torrent``, where ``{name}`` is replaced\nby the value of the ``name`` field from the torrent info, but a different path\ncan be set via the ``--outfile`` option.\n\nOptions\n^^^^^^^\n\n-o PATH, --outfile PATH\n                        Save the ``.torrent`` files to the given path.  The\n                        path may contain a ``{name}`` placeholder, which will\n                        be replaced by the (sanitized) name of each torrent,\n                        and/or a ``{hash}`` placeholder, which will be replaced\n                        by each torrent's info hash in hexadecimal.  [default:\n                        ``{name}.torrent``]\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Convert magnet links to .torrent files",
    "version": "0.3.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/jwodder/demagnetize/issues",
        "Source Code": "https://github.com/jwodder/demagnetize"
    },
    "split_keywords": [
        "bittorrent",
        "magnet link",
        "torrent"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a92a51fcd920aa34212fe65e5e6acf6bf2eb6d9c3c5ed8223c42703708ca94e7",
                "md5": "7251dff0566e5506c9e142da89c150fb",
                "sha256": "a3ac825bb8d949d3d1ea17fb67b48d41c22a22bf0eae6c70817042aa7db9f01c"
            },
            "downloads": -1,
            "filename": "demagnetize-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7251dff0566e5506c9e142da89c150fb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 27904,
            "upload_time": "2023-11-19T19:19:40",
            "upload_time_iso_8601": "2023-11-19T19:19:40.992097Z",
            "url": "https://files.pythonhosted.org/packages/a9/2a/51fcd920aa34212fe65e5e6acf6bf2eb6d9c3c5ed8223c42703708ca94e7/demagnetize-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4c06761ea05bd9367379f70afcc93db40d57f0b7ce423250dbf9d15729676c7f",
                "md5": "5d7b5843a5e66765a72322d4f6349aa5",
                "sha256": "ab023ff72d03cc2ed369e94aa1d6d513e5774735c3adee9bc66e274e8207af4e"
            },
            "downloads": -1,
            "filename": "demagnetize-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5d7b5843a5e66765a72322d4f6349aa5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 27946,
            "upload_time": "2023-11-19T19:19:42",
            "upload_time_iso_8601": "2023-11-19T19:19:42.384349Z",
            "url": "https://files.pythonhosted.org/packages/4c/06/761ea05bd9367379f70afcc93db40d57f0b7ce423250dbf9d15729676c7f/demagnetize-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-19 19:19:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jwodder",
    "github_project": "demagnetize",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "demagnetize"
}
        
Elapsed time: 0.16617s