Skip to content

[Bug] DeprecationWarning: add_magnet_uri() is deprecated in libtorrent 2.x #194

@stabldev

Description

@stabldev

What happened?

libtorrent 2.x has deprecated add_magnet_uri(), and our code still uses it when adding magnet links. this triggers a warning during tests.

we should migrate to the recommended modern API:

params = lt.parse_magnet_uri(magnet_uri)
session.add_torrent(params)

Version

torrra, v2.0.2

OS and architecture

Arch Linux x86_64

Terminal Output or Logs

tests/screens/test_home.py::test_home_screen_search tests/screens/test_home.py::test_home_screen_search tests/screens/test_home.py::test_home_screen_search tests/screens/test_home.py::test_home_screen_search tests/screens/test_home.py::test_home_screen_search tests/screens/test_home.py::test_home_screen_search tests/screens/test_home.py::test_home_screen_search /home/stabldev/dev/projects/torrra/src/torrra/core/download.py:34: DeprecationWarning: add_magnet_uri() is deprecated self.torrents[magnet_uri] = lt.add_magnet_uri(self.session, magnet_uri, params) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions