// Copyright Andrew Resch 2008. Use, modification and distribution is // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt #include #include #include #include #include "gil.hpp" using namespace boost::python; using namespace libtorrent; extern void dict_to_add_torrent_params(dict params , add_torrent_params& p, std::vector& rd , std::list& storage); namespace { torrent_handle _add_magnet_uri(session& s, std::string uri, dict params) { add_torrent_params p; std::vector resume_buf; std::list string_storage; dict_to_add_torrent_params(params, p, resume_buf, string_storage); #ifndef BOOST_NO_EXCEPTIONS return add_magnet_uri(s, uri, p); #else error_code ec; return add_magnet_uri(s, uri, p, ec); #endif } } void bind_magnet_uri() { def("add_magnet_uri", &_add_magnet_uri); }