-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 06bc5cf
Showing
4 changed files
with
211 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<pre> | ||
████████ ██████ ██ ██ ██████ ██ ██ ██ ██ | ||
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ | ||
██ ██████ █████ ██ ███████ █████ | ||
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ | ||
██ ██ ██ ██ ██ ██████ ██ ██ ██ ██ | ||
</pre> | ||
|
||
## Description | ||
trkchk is a simple script that checks if a private torrent tracker has open registrations or not. | ||
|
||
<br> | ||
|
||
## Installation | ||
1. Clone repo. | ||
2. Install requirements. | ||
3. Run script. | ||
|
||
<br> | ||
|
||
## Usage | ||
1. Follow instructions on screen. | ||
|
||
<br> | ||
|
||
## Contributing | ||
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
AlphaRatio|https://alpharatio.cc/register|Sorry, the site is currently invite only. | ||
AsianCinema|https://asiancinema.me/register/null|Open Registration is Closed! | ||
AvistaZ|https://avistaz.to/auth/register|AvistaZ is Invite Only | ||
BeyondHD|https://beyond-hd.me/register|You Must Be Invited To Register! | ||
BroadcastTheNet|https://broadcasthe.net/register.php|Sorry, the site is currently invite only. | ||
CHDBits|https://chdbits.co/signup.php|自由注册当前关闭,只允许邀请注册 | ||
CinemaZ|https://cinemaz.to/auth/register|We sometimes open registration or application. | ||
DanishBytes|https://danishbytes.club/register|Åben registrering er deaktiveret | ||
ExoticaZ|https://exoticaz.to/register|ExoticaZ is Invite Only | ||
PrivateHD|https://privatehd.to/auth/register|PrivateHD is Invite Only | ||
The Horror Charnel|https://horrorcharnel.org/signup.php|The site has been set to invite only by the staff | ||
Aither|https://aither.cc/register/|Open Registration Is Disabled and You Will Need A Invite To Gain Access! | ||
PassThePopcorn|https://passthepopcorn.me/register.php|Sorry, the site is currently invite only. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
requests==2.27.1 | ||
rich==12.4.4 | ||
termcolor==1.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
import requests | ||
import os | ||
from rich.console import Console | ||
from rich.table import Table | ||
from termcolor import colored | ||
|
||
# Tracker file | ||
TRACKER_FILE = 'data/trackers.txt' | ||
MENU = [ | ||
{ 'item': 1, 'name': 'Check for open signups', 'function': 'checkForOpenSignups' }, | ||
{ 'item': 2, 'name': 'List trackers', 'function': 'listTrackers' }, | ||
{ 'item': 3, 'name': 'Add a tracker to the list', 'function': 'addTrackerToFile' }, | ||
{ 'item': 4, 'name': 'Remove a tracker from the list', 'function': 'removeTrackerFromFile' }, | ||
{ 'item': 5, 'name': 'Exit', 'function': 'exit' } | ||
] | ||
|
||
# Logo | ||
def displayLogo(): | ||
print('████████ ██████ ██ ██ ██████ ██ ██ ██ ██'); | ||
print(' ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ '); | ||
print(' ██ ██████ █████ ██ ███████ █████ '); | ||
print(' ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ '); | ||
print(' ██ ██ ██ ██ ██ ██████ ██ ██ ██ ██'); | ||
print('-------------------------------------------------'); | ||
|
||
|
||
# Menu + input | ||
def getMenuInput(): | ||
for menuItem in MENU: | ||
print('[' + str(menuItem['item']) + '] ' + menuItem['name']) | ||
userInput = input('> ') | ||
print('\n') | ||
return userInput | ||
|
||
# Check that the tracker file exists | ||
def checkTrackerFileStatus(): | ||
if not os.path.isfile(TRACKER_FILE): | ||
print(colored('[ERROR]', 'red') + ' Tracker list not found!') | ||
input('Press enter to exit...') | ||
exit() | ||
|
||
# List trackers | ||
def listTrackers(): | ||
|
||
checkTrackerFileStatus() | ||
|
||
rows = [] | ||
columns = ['ID', 'Name', 'Reg. URL', 'Closed text'] | ||
|
||
# Open the file and read the trackers into an array | ||
with open(TRACKER_FILE, 'r', encoding='utf-8') as f: | ||
lines = f.readlines() | ||
|
||
i = 1 | ||
for line in lines: | ||
line = line.strip() | ||
tracker = line.split('|') | ||
trackerName = tracker[0] | ||
trackerUrl = tracker[1] | ||
trackerText = tracker[2] | ||
rows.append([str(i), tracker[0], tracker[1], tracker[2]]) | ||
i = i + 1 | ||
|
||
# Print the trackers in a table format | ||
table = Table(title='Trackers') | ||
for column in columns: | ||
table.add_column(column) | ||
for row in rows: | ||
table.add_row(*row, style='bright_green') | ||
console = Console() | ||
console.print(table) | ||
|
||
# Check for open signups | ||
def checkForOpenSignups(): | ||
|
||
checkTrackerFileStatus() | ||
|
||
print('[CHECKING FOR OPEN SIGNUPS]') | ||
trackers = [] | ||
|
||
# Open the file and read the trackers into an array | ||
with open(TRACKER_FILE, 'r', encoding='utf-8') as f: | ||
lines = f.readlines() | ||
|
||
for line in lines: | ||
line = line.strip() | ||
tracker = line.split('|') | ||
trackerName = tracker[0] | ||
trackerUrl = tracker[1] | ||
trackerText = tracker[2] | ||
trackers.append([tracker[0], tracker[1], tracker[2]]) | ||
|
||
# Check each tracker | ||
for tracker in trackers: | ||
|
||
# Get the tracker's response | ||
try: | ||
response = requests.get(tracker[1]) | ||
except: | ||
print(colored('[ERROR]', 'red') + ' Could not connect to ' + colored(tracker[0], 'yellow')) | ||
continue | ||
|
||
# If the response includes the text we are looking for it is closed | ||
if tracker[2] in response.text: | ||
print(colored(tracker[0], 'yellow') + ' is ' + colored('closed', 'red')) | ||
|
||
# If the response doesn't include the text we are looking for it is open | ||
else: | ||
print(colored(tracker[0], 'yellow') + ' is ' + colored('open', 'green') + ' | ' + colored(tracker[1], 'blue')) | ||
|
||
# Add tracker to file | ||
def addTrackerToFile(): | ||
|
||
print('[ADD TRACKER TO LIST]') | ||
tracker = input('Tracker name: ') | ||
url = input('Tracker registration URL: ') | ||
text = input('Text to look for: ') | ||
|
||
# Add the tracker to the list | ||
with open(TRACKER_FILE, 'a', encoding='utf-8') as f: | ||
f.write(tracker + '|' + url + '|' + text + '\n') | ||
|
||
print(colored('Tracker added!', 'green')) | ||
|
||
# Remove tracker from file | ||
def removeTrackerFromFile(): | ||
|
||
checkTrackerFileStatus() | ||
|
||
print('[REMOVE TRACKER FROM LIST]') | ||
listTrackers() | ||
trackerInput = input('Tracker ID: ') | ||
|
||
# Remove tracker from the list based on the ID (line number) | ||
with open(TRACKER_FILE, 'r', encoding='utf-8') as f: | ||
lines = f.readlines() | ||
|
||
# Check that the tracker ID is a valid line number | ||
if int(trackerInput) > len(lines): | ||
print(colored('[ERROR]', 'red') + ' Tracker ID not found!') | ||
input('Press enter to exit...') | ||
exit() | ||
|
||
# Remove the tracker from the list | ||
lines.pop(int(trackerInput) - 1) | ||
with open(TRACKER_FILE, 'w', encoding='utf-8') as f: | ||
f.writelines(lines) | ||
|
||
print(colored('Tracker removed!', 'green')) | ||
|
||
# Logo | ||
displayLogo() | ||
|
||
while True: | ||
|
||
# Grab user input | ||
userInput = getMenuInput() | ||
|
||
# Check if the user entered a valid number | ||
if userInput.isdigit(): | ||
userInput = int(userInput) | ||
if userInput == 5: | ||
exit() | ||
if userInput > 0 and userInput <= len(MENU): | ||
locals()[MENU[userInput - 1]['function']]() | ||
else: | ||
print(colored('[ERROR]', 'red') + ' Invalid menu item!') | ||
input('Press enter to exit...') |