mag2tor icon indicating copy to clipboard operation
mag2tor copied to clipboard

Upload the binary

Open ngosang opened this issue 4 years ago • 3 comments

Could you compile mag2tor.cpp and upload the binary to https://github.com/xrgtn/mag2tor/releases ?

ngosang avatar Jan 05 '20 15:01 ngosang

@ngosang say:

Could you compile

Can't compile? Is everything ok with your system? Which system? Can an alternative fit?

zvezdochiot avatar Jan 05 '20 16:01 zvezdochiot

Archlinux libtorrent-rasterbar:1.2.3

The Python script works fine if I remove these lines:

        'paused':False,
        'auto_managed':False,
        'upload_mode':True,

So, libtorrent is fine. They changed those parameters in latests releases => https://www.libtorrent.org/reference-Core.html#add_torrent_params

If I execute make:

g++ -std=c++11 -DBOOST_ASIO_DYN_LINK  -lstdc++ -lboost_system -ltorrent-rasterbar  mag2tor.cpp   -o mag2tor
In file included from /usr/include/boost/detail/endian.hpp:9,
                 from /usr/local/include/libtorrent/config.hpp:47,
                 from /usr/local/include/libtorrent/storage_defs.hpp:36,
                 from /usr/local/include/libtorrent/add_torrent_params.hpp:40,
                 from mag2tor.cpp:11:
/usr/include/boost/predef/detail/endian_compat.h:11:161: note: #pragma message: The use of BOOST_*_ENDIAN and BOOST_BYTE_ORDER is deprecated. Please include <boost/predef/other/endian.h> and use BOOST_ENDIAN_*_BYTE instead
   11 | #pragma message("The use of BOOST_*_ENDIAN and BOOST_BYTE_ORDER is deprecated. Please include <boost/predef/other/endian.h> and use BOOST_ENDIAN_*_BYTE instead")
      |                                                                                                                                                                 ^
mag2tor.cpp: In function ‘int main(int, char**)’:
mag2tor.cpp:126:27: warning: ‘const libtorrent::torrent_info& libtorrent::torrent_handle::get_torrent_info() const’ is deprecated [-Wdeprecated-declarations]
  126 |     torh.get_torrent_info();
      |                           ^
In file included from /usr/local/include/libtorrent/alert_types.hpp:37,
                 from mag2tor.cpp:12:
/usr/local/include/libtorrent/torrent_handle.hpp:842:23: note: declared here
  842 |   const torrent_info& get_torrent_info() const TORRENT_DEPRECATED;
      |                       ^~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/cchhJhxx.o: in function `main':
mag2tor.cpp:(.text+0x1ca): undefined reference to `libtorrent::session_settings::session_settings(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: mag2tor.cpp:(.text+0x1fb): undefined reference to `libtorrent::default_storage_constructor(libtorrent::file_storage const&, libtorrent::file_storage const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, libtorrent::file_pool&, std::vector<unsigned char, std::allocator<unsigned char> > const&)'
/usr/bin/ld: mag2tor.cpp:(.text+0x48c): undefined reference to `libtorrent::session::set_settings(libtorrent::session_settings const&)'
/usr/bin/ld: mag2tor.cpp:(.text+0x4b6): undefined reference to `libtorrent::disabled_storage_constructor(libtorrent::file_storage const&, libtorrent::file_storage const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, libtorrent::file_pool&, std::vector<unsigned char, std::allocator<unsigned char> > const&)'
/usr/bin/ld: mag2tor.cpp:(.text+0x4fb): undefined reference to `libtorrent::session::add_torrent(libtorrent::add_torrent_params const&)'
/usr/bin/ld: mag2tor.cpp:(.text+0x54e): undefined reference to `libtorrent::session::pop_alerts(std::deque<libtorrent::alert*, std::allocator<libtorrent::alert*> >*)'
/usr/bin/ld: mag2tor.cpp:(.text+0x6b2): undefined reference to `libtorrent::torrent_handle::status(unsigned int) const'
/usr/bin/ld: mag2tor.cpp:(.text+0x6df): undefined reference to `libtorrent::session::pause()'
/usr/bin/ld: mag2tor.cpp:(.text+0x708): undefined reference to `libtorrent::torrent_info::torrent_info(libtorrent::torrent_info const&, int)'
/usr/bin/ld: mag2tor.cpp:(.text+0x89e): undefined reference to `libtorrent::session::remove_torrent(libtorrent::torrent_handle const&, int)'
/usr/bin/ld: mag2tor.cpp:(.text+0x97e): undefined reference to `libtorrent::session_settings::~session_settings()'
/usr/bin/ld: mag2tor.cpp:(.text+0xaba): undefined reference to `libtorrent::session_settings::~session_settings()'
/usr/bin/ld: /tmp/cchhJhxx.o: in function `__static_initialization_and_destruction_0(int, int)':
mag2tor.cpp:(.text+0xb42): undefined reference to `boost::asio::error::get_netdb_category()'
/usr/bin/ld: mag2tor.cpp:(.text+0xb4e): undefined reference to `boost::asio::error::get_addrinfo_category()'
/usr/bin/ld: mag2tor.cpp:(.text+0xb5a): undefined reference to `boost::asio::error::get_misc_category()'
/usr/bin/ld: /tmp/cchhJhxx.o: in function `libtorrent::session::session(libtorrent::fingerprint const&, int, unsigned int)':
mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0x33): undefined reference to `libtorrent::clocktime_deprecated_()'
/usr/bin/ld: mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0x77): undefined reference to `libtorrent::session::init(std::pair<int, int>, char const*, libtorrent::fingerprint const&, unsigned int)'
/usr/bin/ld: mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0x88): undefined reference to `libtorrent::session::start(int)'
/usr/bin/ld: /tmp/cchhJhxx.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]+0x127): undefined reference to `libtorrent::entry::list[abi:cxx11]() const'
/usr/bin/ld: mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x13f): undefined reference to `libtorrent::entry::list[abi:cxx11]() const'
/usr/bin/ld: /tmp/cchhJhxx.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)'
/usr/bin/ld: /tmp/cchhJhxx.o: in function `boost::asio::detail::posix_global_impl<boost::asio::system_context>::~posix_global_impl()':
mag2tor.cpp:(.text._ZN5boost4asio6detail17posix_global_implINS0_14system_contextEED2Ev[_ZN5boost4asio6detail17posix_global_implINS0_14system_contextEED5Ev]+0x1d): undefined reference to `boost::asio::system_context::~system_context()'
collect2: error: ld returned 1 exit status
make: *** [<builtin>: mag2tor] Error 1

I think this is not related to your program. I can't compile libtorrent source code because it's incompatible with boost version I have installed. That's why I'm asking for the standlaone binary. I think could be useful for people without knowledge to compile.

ngosang avatar Jan 05 '20 16:01 ngosang

@ngosang say:

I think this is not related to your program.

This is not my program, but I use it. Not everything I like about her.

@ngosang say:

I think could be useful for people without knowledge to compile.

Alternative: Script based on aria2c. In many cases works better.

$ cat aria2c-magnet-to-torrent.sh 
#!/bin/sh

tmagnet="$1"
if [ -z "$tmagnet" ]
then
    echo "Usage: $0 magnet-link"
    exit 1
fi

ttrackers="http://retracker.local/announce,udp://tracker.internetwarriors.net:1337/announce,http://tracker.tfile.me/announce,http://bt3.t-ru.org/ann?magnet,http://bt4.t-ru.org/ann?magnet,http://xbtrutor.com:2710/announce,http://bt.rutracker.cc/ann,http://bt2.rutracker.cc/ann,http://bt3.rutracker.cc/ann,http://bt4.rutracker.cc/ann,http://torrent.gresille.org/announce,udp://shubt.net:2710,udp://tracker.coppersurfer.tk:6969/announce,udp://tracker.leechers-paradise.org:6969/announce,udp://glotorrents.pw:6969/announce,udp://bt.rutor.org:2710/announce,udp://tracker.blackunicorn.xyz:6969/announce,udp://tracker.openbittorrent.com:80/announce,udp://tracker.opentrackr.org:1337/announce,udp://tracker.glotorrents.com:6969/announce,udp://eddie4.nl:6969/announce"

aria2c --bt-tracker="$ttrackers" --bt-metadata-only=true --bt-save-metadata=true "$tmagnet"

zvezdochiot avatar Jan 05 '20 16:01 zvezdochiot