Closed GoogleCodeExporter closed 9 years ago
could you try this patch? It doesn't parse web seeds out of magnet links still
though.
Index: src/magnet_uri.cpp
===================================================================
--- src/magnet_uri.cpp (revision 9886)
+++ src/magnet_uri.cpp (working copy)
@@ -50,7 +50,6 @@
ret += to_hex(ih.to_string());
torrent_status st = handle.status(torrent_handle::query_name);
-
if (!st.name.empty())
{
ret += "&dn=";
@@ -58,7 +57,6 @@
}
std::vector<announce_entry> const& tr = handle.trackers();
-
for (std::vector<announce_entry>::const_iterator i = tr.begin(), end(tr.end()); i != end; ++i)
{
ret += "&tr=";
@@ -65,6 +63,14 @@
ret += escape_string(i->url.c_str(), i->url.length());
}
+ std::set<std::string> seeds = handle.url_seeds();
+ for (std::set<std::string>::iterator i = seeds.begin()
+ , end(seeds.end()); i != end; ++i)
+ {
+ ret += "&ws=";
+ ret += escape_string(i->c_str(), i->length());
+ }
+
return ret;
}
@@ -91,6 +97,16 @@
ret += escape_string(i->url.c_str(), i->url.length());
}
+ std::vector<web_seed_entry> const& seeds = info.web_seeds();
+ for (std::vector<web_seed_entry>::const_iterator i = seeds.begin()
+ , end(seeds.end()); i != end; ++i)
+ {
+ if (i->type != web_seed_entry::url_seed) continue;
+
+ ret += "&ws=";
+ ret += escape_string(i->url.c_str(), i->url.length());
+ }
+
return ret;
}
Original comment by arvid.no...@gmail.com
on 15 Apr 2014 at 7:13
Original comment by arvid.no...@gmail.com
on 24 Apr 2014 at 6:36
Original issue reported on code.google.com by
me@teran.ru
on 14 Apr 2014 at 2:04