xrgtn / mag2tor Goto Github PK
View Code? Open in Web Editor NEWConvert magnet link to torrent file.
License: MIT License
Convert magnet link to torrent file.
License: MIT License
Hello there!
This little program of yours is exactly what I'm looking for, although unfortunately it doesn't seem to work at the moment. I have libtorrent-rasterbar10, libtorrent-rasterbar-dev, and python3-libtorrent all installed. Running python3 mag2tor.py [MAGNET]
results in:
Traceback (most recent call last):
File "/mnt/data/shared1/Projects/mag2tor/mag2tor.py", line 41, in <module>
for mag_link in sys.argv[1:]: mag2tor(mag_link)
File "/mnt/data/shared1/Projects/mag2tor/mag2tor.py", line 20, in mag2tor
torr = libtorrent.add_magnet_uri(sess, mag_link, prms)
KeyError: 'unknown name in torrent params: paused'
According to some stuff online, the add_magnet_uri
function of libtorrent has been deprecated, so I suppose that probably has something to do with it!
Here's a couple references to that:
Hope this can be of some help! :)
I am getting an error when I try compiling the C++ version. Can you spot my mistake?
matt@apollo:~/Downloads/dev/mag2tor$ sudo make g++ -std=c++11 -DBOOST_ASIO_DYN_LINK -lstdc++ -lboost_system -ltorrent-rasterbar mag2tor.cpp -o mag2tor mag2tor.cpp: In function ‘int main(int, char**)’: mag2tor.cpp:94:36: warning: ‘libtorrent::session::session(const libtorrent::fingerprint&, int, uint32_t)’ is deprecated [-Wdeprecated-declarations] lt::session::add_default_plugins); ^ In file included from mag2tor.cpp:16:0: /usr/include/libtorrent/session.hpp:205:3: note: declared here session(fingerprint const& print ^~~~~~~ mag2tor.cpp:95:24: warning: ‘void libtorrent::session_handle::set_settings(const libtorrent::session_settings&)’ is deprecated [-Wdeprecated-declarations] sess.set_settings(sset); ^ In file included from /usr/include/libtorrent/session.hpp:53:0, from mag2tor.cpp:16: /usr/include/libtorrent/session_handle.hpp:808:8: note: declared here void set_settings(session_settings const& s); ^~~~~~~~~~~~ mag2tor.cpp:114:26: warning: ‘void libtorrent::session_handle::pop_alerts(std::deque<libtorrent::alert*>*)’ is deprecated [-Wdeprecated-declarations] sess.pop_alerts(&alerts); ^ In file included from /usr/include/libtorrent/session.hpp:53:0, from mag2tor.cpp:16: /usr/include/libtorrent/session_handle.hpp:916:8: note: declared here void pop_alerts(std::deque<alert*>* alerts); ^~~~~~~~~~ mag2tor.cpp:126:27: warning: ‘const libtorrent::torrent_info& libtorrent::torrent_handle::get_torrent_info() const’ is deprecated [-Wdeprecated-declarations] torh.get_torrent_info(); ^ In file included from /usr/include/libtorrent/alert_types.hpp:38:0, from mag2tor.cpp:12: /usr/include/libtorrent/torrent_handle.hpp:920:23: note: declared here const torrent_info& get_torrent_info() const; ^~~~~~~~~~~~~~~~ /tmp/cciTCjJL.o: In function
main':
mag2tor.cpp:(.text+0x1ab): undefined reference to libtorrent::session_settings::session_settings(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' mag2tor.cpp:(.text+0x1dc): undefined reference to
libtorrent::default_storage_constructor(libtorrent::storage_params const&)'
mag2tor.cpp:(.text+0x43d): undefined reference to libtorrent::session_handle::set_settings(libtorrent::session_settings const&)' mag2tor.cpp:(.text+0x467): undefined reference to
libtorrent::disabled_storage_constructor(libtorrent::storage_params const&)'
mag2tor.cpp:(.text+0x4ae): undefined reference to libtorrent::session_handle::add_torrent(libtorrent::add_torrent_params const&)' mag2tor.cpp:(.text+0x501): undefined reference to
libtorrent::session_handle::pop_alerts(std::deque<libtorrent::alert*, std::allocatorlibtorrent::alert* >)'
mag2tor.cpp:(.text+0x665): undefined reference to libtorrent::torrent_handle::status(unsigned int) const' mag2tor.cpp:(.text+0x67b): undefined reference to
libtorrent::torrent_status::~torrent_status()'
mag2tor.cpp:(.text+0x692): undefined reference to libtorrent::session_handle::pause()' mag2tor.cpp:(.text+0x6a1): undefined reference to
libtorrent::torrent_handle::get_torrent_info() const'
mag2tor.cpp:(.text+0x6b6): undefined reference to libtorrent::torrent_info::torrent_info(libtorrent::torrent_info const&)' mag2tor.cpp:(.text+0x7b6): undefined reference to
libtorrent::create_torrent::create_torrent(libtorrent::torrent_info const&)'
mag2tor.cpp:(.text+0x7cf): undefined reference to libtorrent::create_torrent::generate() const' mag2tor.cpp:(.text+0x810): undefined reference to
libtorrent::entry::~entry()'
mag2tor.cpp:(.text+0x81f): undefined reference to libtorrent::create_torrent::~create_torrent()' mag2tor.cpp:(.text+0x84c): undefined reference to
libtorrent::session_handle::remove_torrent(libtorrent::torrent_handle const&, int)'
mag2tor.cpp:(.text+0x86b): undefined reference to libtorrent::torrent_info::~torrent_info()' mag2tor.cpp:(.text+0x910): undefined reference to
libtorrent::session::~session()'
mag2tor.cpp:(.text+0x92e): undefined reference to libtorrent::session_settings::~session_settings()' mag2tor.cpp:(.text+0x9ca): undefined reference to
libtorrent::entry::~entry()'
mag2tor.cpp:(.text+0x9de): undefined reference to libtorrent::create_torrent::~create_torrent()' mag2tor.cpp:(.text+0xa06): undefined reference to
libtorrent::torrent_info::~torrent_info()'
mag2tor.cpp:(.text+0xa42): undefined reference to libtorrent::session::~session()' mag2tor.cpp:(.text+0xa6a): undefined reference to
libtorrent::session_settings::~session_settings()'
/tmp/cciTCjJL.o: In function __static_initialization_and_destruction_0(int, int)': mag2tor.cpp:(.text+0xae7): undefined reference to
boost::system::generic_category()'
mag2tor.cpp:(.text+0xaf3): undefined reference to boost::system::generic_category()' mag2tor.cpp:(.text+0xaff): undefined reference to
boost::system::system_category()'
mag2tor.cpp:(.text+0xb17): undefined reference to boost::asio::error::get_netdb_category()' mag2tor.cpp:(.text+0xb23): undefined reference to
boost::asio::error::get_addrinfo_category()'
mag2tor.cpp:(.text+0xb2f): undefined reference to boost::asio::error::get_misc_category()' /tmp/cciTCjJL.o: In function
boost::asio::error::get_system_category()':
mag2tor.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[_ZN5boost4asio5error19get_system_categoryEv]+0x5): undefined reference to boost::system::system_category()' /tmp/cciTCjJL.o: In function
libtorrent::session::session(libtorrent::fingerprint const&, int, unsigned int)':
mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0x83): undefined reference to libtorrent::ipv6_deprecated_()' mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0xac): undefined reference to
libtorrent::settings_pack::set_int(int, int)'
mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0xda): undefined reference to libtorrent::settings_pack::set_str(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)' mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0x10c): undefined reference to
libtorrent::settings_pack::set_bool(int, bool)'
mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0x125): undefined reference to libtorrent::settings_pack::set_bool(int, bool)' mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0x13e): undefined reference to
libtorrent::settings_pack::set_bool(int, bool)'
mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0x157): undefined reference to libtorrent::settings_pack::set_bool(int, bool)' mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0x178): undefined reference to
libtorrent::session::start(int, libtorrent::settings_pack const&, boost::asio::io_service)'
/tmp/cciTCjJL.o: In function int libtorrent::detail::bencode_recursive<std::ostream_iterator<char, char, std::char_traits<char> > >(std::ostream_iterator<char, char, std::char_traits<char> >&, libtorrent::entry const&)': mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x2f): undefined reference to
libtorrent::entry::type() const'
mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x78): undefined reference to libtorrent::entry::integer() const' mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0xb3): undefined reference to
libtorrent::entry::stringabi:cxx11 const'
mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0xed): undefined reference to libtorrent::entry::string[abi:cxx11]() const' mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x128): undefined reference to
libtorrent::entry::listabi:cxx11 const'
mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x140): undefined reference to libtorrent::entry::list[abi:cxx11]() const' mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x1c9): undefined reference to
libtorrent::entry::dictabi:cxx11 const'
mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x1e1): undefined reference to libtorrent::entry::dict[abi:cxx11]() const' mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x2d3): undefined reference to
libtorrent::entry::preformatted() const'
mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x2ea): undefined reference to libtorrent::entry::preformatted() const' mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x317): undefined reference to
libtorrent::entry::preformatted() const'
/tmp/cciTCjJL.o: In function int libtorrent::detail::write_integer<std::ostream_iterator<char, char, std::char_traits<char> > >(std::ostream_iterator<char, char, std::char_traits<char> >&, long)': mag2tor.cpp:(.text._ZN10libtorrent6detail13write_integerISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_l[_ZN10libtorrent6detail13write_integerISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_l]+0x37): undefined reference to
libtorrent::detail::integer_to_str(char*, int, long)'
collect2: error: ld returned 1 exit status
: recipe for target 'mag2tor' failed
make: *** [mag2tor] Error 1
`
Could you compile mag2tor.cpp
and upload the binary to https://github.com/xrgtn/mag2tor/releases ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.