ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/tpb/common.pl
(Generate patch)

Comparing tpb/common.pl (file contents):
Revision 1.4 by root, Sun Jun 24 15:58:19 2018 UTC vs.
Revision 1.5 by root, Fri Aug 17 21:18:14 2018 UTC

1#!/opt/bin/perl 1#!/opt/bin/perl
2
3BEGIN {
4 $ENV{http_proxy} =
5 $ENV{https_proxy} = "http://127.0.0.1:8118"; # privoxy
6}
2 7
3use common::sense; 8use common::sense;
4use Compress::LZF; 9use Compress::LZF;
5use EV; 10use EV;
6use AnyEvent::HTTP; 11use AnyEvent::HTTP;
14use Compress::Raw::Zlib (); 19use Compress::Raw::Zlib ();
15use AnyEvent::TLS; 20use AnyEvent::TLS;
16 21
17BDB::min_parallel 8; 22BDB::min_parallel 8;
18 23
19#our @TPB = qw(thepiratebay.org); 24#our @TPB = qw(https://thepiratebay.org);
20#our @TPB = qw(pirateproxy.ist); 25#our @TPB = qw(https://baypirateproxy.org);
21#our @TPB = qw(thepiratebay.futbol); 26our @TPB = qw(http://uj3wazyk5u4hnvtk.onion);
22our @TPB = qw(tpbproxy.club);
23our $TPB = $TPB[0]; 27our $TPB = $TPB[0];
24 28
25our $TODAY = int time / 86400; 29our $TODAY = int time / 86400;
26 30
27#our $TPB_SWITCHER = AE::timer 1, 0.02, sub { 31#our $TPB_SWITCHER = AE::timer 1, 0.02, sub {
53our $db_env = db_env_create; 57our $db_env = db_env_create;
54 58
55$db_env->set_flags (BDB::AUTO_COMMIT | BDB::TXN_WRITE_NOSYNC, 1); 59$db_env->set_flags (BDB::AUTO_COMMIT | BDB::TXN_WRITE_NOSYNC, 1);
56$db_env->log_set_config (BDB::LOG_AUTO_REMOVE); 60$db_env->log_set_config (BDB::LOG_AUTO_REMOVE);
57#$db_env->set_cachesize (0, 8 * 1024 * 1024); 61#$db_env->set_cachesize (0, 8 * 1024 * 1024);
58$db_env->set_cachesize (0, 64 * 1024); 62$db_env->set_cachesize (0, 512 * 1024);
59$db_env->set_lk_max_lockers (20480); 63$db_env->set_lk_max_lockers (20480);
60$db_env->set_lk_max_locks (20480); 64$db_env->set_lk_max_locks (20480);
61$db_env->set_lk_max_objects (20480); 65$db_env->set_lk_max_objects (20480);
62 66
63mkdir "db", 0777; 67mkdir "db", 0777;
177sub GET { 181sub GET {
178 my ($data, $hdr); 182 my ($data, $hdr);
179 183
180 for (1..50) { 184 for (1..50) {
181 http_get $_[0], 185 http_get $_[0],
182 proxy => undef, 186 #proxy => undef,
183 recurse => 0, 187 recurse => 0,
184 headers => { 188 headers => {
185 "user-agent" => "Mozilla/5.0 (X11; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0 Iceweasel/20.0", 189 "user-agent" => "Mozilla/5.0 (X11; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0 Iceweasel/20.0",
186 "referer" => undef, 190 "referer" => undef,
187 }, 191 },

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines