-
Notifications
You must be signed in to change notification settings - Fork 18
/
config.py
81 lines (79 loc) · 2.46 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# -*- coding: utf-8 -*-
#
# PTLiar, a fake seeding software
# Copyright (C) 2011 PTLiar.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# In most cases, these values are fine..
# Torrent Paths
UP_TORRENT_DIR = "up_torrents"
DOWN_TORRENT_DIR = "down_torrents"
UP = 89
DOWN = 64
DIR = { UP:UP_TORRENT_DIR, DOWN:DOWN_TORRENT_DIR }
WORD = { UP:"uploading", DOWN:"downloading" }
# Port Number Limits
MAX_PORT = 65000
MIN_PORT = 10000
# Number of Connections
CONNECTION_PER_BOX = 4
# "numwant" value that uTorrent prefers
NUMWANT = 200
# Timeout Limit
CONNECTION_TIMEOUT = 40
# Assuming every 20 peers there is one downloading, it's safer to make this number larger
PEER_UPLOAD_RATE = 20
PEER_DOWNLOAD_RATE = 20
# Number of timeout retries
TIMEOUT_RETRY = 3
# Maximum number of redirect retries, avoid loops
REDIRECT_RETRY = 5
# A lucky number
LUCKY_NUMBER = 8964
# Lottery
ALL_TICKETS = 1000000
ZR_LUCK_L1 = 0.3
ZR_LUCK_L2 = 0.3
ZR_LUCK_L3 = 0.95
ZR_GOT_L1 = 0
ZR_GOT_L2 = int(0.3*ALL_TICKETS)
ZR_GOT_L3 = int(0.5*ALL_TICKETS)
# Logging
LOG_FILE = "debug.log"
FMT = "%(asctime)s %(levelname)s: %(message)s"
DATEFMT = "%m-%d %H:%M:%S"
# Default values
DEFAULT_MAX_UP_SPEED = 2048
DEFAULT_MAX_DOWN_SPEED = 1024
# Max torrent speed
DEFAULT_MAX_TORRENT_SPEED = 400
# Zzz...
SLEEP_BANNER = 1 # Time of sleep after banner
SLEEP_SETTINGS = 2 # Time of sleep after printing settings
SLEEP_TIMEOUT = 15 # Time of sleep before another retry
SLEEP_THREAD = 0.2 # Time of sleep between groups of requests
SLEEP_SCAN = 60 # Maximum inteval of checking folder change
# Banner
BANNER = """\
====================
PTLiar %(version)s (%(date)s)
%(url)s
====================\
"""
# Critical server responses
CRITICAL_RESPONSES = (
"torrent not registered with this tracker",
"Torrent is not authorized for use on this tracker.",
)