mirror of
https://onedev.site.tesses.net/tesses-framework
synced 2026-02-08 15:55:46 +00:00
Push failed torrent code as backup before I remove it
This commit is contained in:
22
apps/tclearwebseed.cpp
Normal file
22
apps/tclearwebseed.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "TessesFramework/TessesFramework.hpp"
|
||||
using namespace Tesses::Framework;
|
||||
using namespace Tesses::Framework::BitTorrent;
|
||||
using namespace Tesses::Framework::Serialization::Bencode;
|
||||
using namespace Tesses::Framework::Filesystem;
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
TF_Init();
|
||||
if(argc < 2)
|
||||
{
|
||||
printf("USAGE: %s torrent_file\n",argv[0]);
|
||||
return 1;
|
||||
}
|
||||
auto strm = LocalFS->OpenFile((std::string)argv[1],"rb");
|
||||
auto data = Bencode::Load(strm);
|
||||
if(std::holds_alternative<BeDictionary>(data)){
|
||||
std::get<BeDictionary>(data).SetValue("url-list",BeUndefined());
|
||||
}
|
||||
strm = LocalFS->OpenFile((std::string)argv[1],"wb");
|
||||
Bencode::Save(strm,data);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user