Skip to content

Commit 7fcdb6e

Browse files
committed
changed placeholder
1 parent 2c8317e commit 7fcdb6e

File tree

3 files changed

+49
-26
lines changed

3 files changed

+49
-26
lines changed

AVAILABLE.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
https://steamcommunity.com/id/%dlgkjsdkgjl%
2+
https://steamcommunity.com/id/%kd9%
3+
https://steamcommunity.com/id/%plague%
4+
https://steamcommunity.com/id/%plain%
5+
https://steamcommunity.com/id/%plan%
6+
https://steamcommunity.com/id/%planet%
7+
https://steamcommunity.com/id/%player%
8+
https://steamcommunity.com/id/%plug%
9+
https://steamcommunity.com/id/%podium%
10+
https://steamcommunity.com/id/%poetry%
11+
https://steamcommunity.com/id/%point%
12+
https://steamcommunity.com/id/%police%
13+
https://steamcommunity.com/id/%policy%
14+
https://steamcommunity.com/id/%poodle%
15+
https://steamcommunity.com/id/%pool%
16+
https://steamcommunity.com/id/%pope%
17+
https://steamcommunity.com/id/%popular%

UsernameChecker.py

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Python Standard Modules
22
import sys
33
import os
4-
import json
54
import re
65
import string
76
import random
@@ -16,9 +15,8 @@
1615
OUTPUT = "AVAILABLE.txt"
1716

1817
# Regex Patterns
19-
PLACEHOLDER = r"(%word%)"
2018
URLPATT = r"(^https?:\/\/[-.a-zA-Z0-9]+)"
21-
DOMAIN = r"\Ahttps?:\/\/([-a-zA-Z0-9]+)\.[a-zA-Z]+"
19+
DOMAIN = r"https?:\/\/(\w*)(?(1)\.|(?(1)\w*))"
2220

2321
# Reads configuration file
2422
config = configparser.ConfigParser()
@@ -34,30 +32,31 @@
3432
# Site URLs
3533
URLS = {
3634
1:URL,
37-
2:"https://api.mojang.com/users/profiles/minecraft/%word%",
38-
3:"https://api.twitter.com/i/users/username_available.json?username=%word%",
35+
2:"https://api.mojang.com/users/profiles/minecraft/%s",
36+
3:"https://api.twitter.com/i/users/username_available.json?username=%s",
3937
4:"https://instagram.com/accounts/web_create_ajax/attempt/",
40-
5:"https://steamcommunity.com/id/%word%",
41-
6:"https://steamcommunity.com/groups/%word%",
42-
7:"https://soundcloud.com/%word%",
43-
8:"https://passport.twitch.tv/usernames/%word%",
44-
9:"https://mixer.com/api/v1/channels/%word%",
45-
10:"https://github.com/%word%",
46-
11:"https://about.me/%word%",
47-
12:"https://youtube.com/%word%"
38+
5:"https://steamcommunity.com/id/%s",
39+
6:"https://steamcommunity.com/groups/%s",
40+
7:"https://soundcloud.com/%s",
41+
8:"https://passport.twitch.tv/usernames/%s",
42+
9:"https://mixer.com/api/v1/channels/%s",
43+
10:"https://github.com/%s",
44+
11:"https://about.me/%s",
45+
12:"https://youtube.com/%s"
4846
}
4947

5048
# Proxy List
5149
proxyDict = {}
5250

51+
s = requests.Session()
52+
5353
def generate_pw(size=16, chars=string.ascii_uppercase + string.digits + string.ascii_lowercase):
5454
return ''.join(random.choice(chars) for _ in range(size))
5555

5656
def replace(word):
5757
# Finds and replaces matches of the name variable with the actual word to insert in URL
5858
if int(SITE) != 4: # if not Instagram
59-
x = re.sub(PLACEHOLDER, word, URLS[int(SITE)])
60-
return x
59+
return URLS[int(SITE)] % word
6160
else:
6261
print("instagram")
6362

@@ -146,7 +145,7 @@ def log_result(response, word, link, matches=None):
146145
manual(response, word, service)
147146

148147
def get_cookie():
149-
r = requests.get(URLS[int(SITE)])
148+
r = s.get(URLS[int(SITE)])
150149
return r.cookies
151150

152151
def ready_payload(word):
@@ -155,7 +154,7 @@ def ready_payload(word):
155154
"email":"[email protected]",
156155
"username": word,
157156
"password": generate_pw(),
158-
"first_name": "Croc"
157+
"first_name": word
159158
}
160159
else:
161160
print("Wrong site!")
@@ -176,19 +175,19 @@ def send_get(words):
176175
link = replace(words[w])
177176
if PROXY:
178177
proxyDict[PROTOCOL] = get_proxy()
179-
r = requests.get(link, proxies=proxyDict)
178+
r = s.get(link, proxies=proxyDict)
180179
else:
181-
r = requests.get(link)
180+
r = s.get(link)
182181
log_result(r, words[w], link)
183182

184183
def parse_page(words):
185184
for w in range(words.__len__()):
186185
link = replace(words[w])
187186
if PROXY:
188187
proxyDict[PROTOCOL] = get_proxy()
189-
r = requests.get(link, proxies=proxyDict)
188+
r = s.get(link, proxies=proxyDict)
190189
else:
191-
r = requests.get(link)
190+
r = s.get(link)
192191
page = r.content
193192
soup = BeautifulSoup(page, "html.parser")
194193
matches = []
@@ -218,7 +217,13 @@ def send_post(words):
218217
link = URLS[int(SITE)]
219218
for w in range(words.__len__()):
220219
payload = ready_payload(words[w])
221-
r = requests.post(URLS[int(SITE)], json=payload, headers=header, cookies=cookie)
220+
r = None
221+
if PROXY:
222+
proxyDict[PROTOCOL] = get_proxy()
223+
r = s.post(URLS[int(SITE)], data=payload, headers=header, cookies=cookie, proxies=proxyDict)
224+
else:
225+
r = s.post(URLS[int(SITE)], data=payload, headers=header, cookies=cookie)
226+
222227
log_result(r, words[w], link)
223228

224229
def main():

config.ini

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; This is the configuration file for Croc's Username Checker script.
1+
; This is the configuration file for OGCheckr CLI.
22
; A semicolon at the start of a line denotes a code comment.
33
; _________________________________
44
; | SERVICE | VALUE TO ENTER |
@@ -22,11 +22,11 @@
2222
; If your target site is not listed, put "1" for CUSTOM (without the quotes).
2323
siteNum = 5
2424
; Fill in the option below with the profile URL of the service you want to check available names for.
25-
; Use %%word%% as the placeholder for the username to check.
25+
; Use %s as the placeholder for the username to check.
2626
; customSite is only for sites not specifically listed in the chart above, but please be aware
2727
; that not every site will work this way. If there is a service you would like to see support for, please
2828
; don't hesistate to let Croc know.
29-
customSite = https://example.com
29+
customSite = https://example.com/%s
3030

3131
[lists]
3232
; Be sure to include the file extension if it has one
@@ -38,7 +38,8 @@ wordList = word_lists/WORD-LIST-1
3838
; To enable proxy support, put True. To disable, put False
3939
enableProxy = False
4040
; If proxy support is enabled, put http or https below depending on what type of proxies you are using.
41-
proxyProtocol = http
41+
proxyProtocol = https
4242
; If proxy support is enabled, you must specify the path to the proxy list you want to use here
4343
; Place all proxy lists in the proxy_lists directory
44+
; Place one proxy per line in the this format "###.###.###.###:####"
4445
proxyList = proxy_lists/proxies.txt

0 commit comments

Comments
 (0)