Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Battlefield 3, Battlefield 4 and Faceit #2077

Closed
wants to merge 11 commits into from
Closed
94 changes: 87 additions & 7 deletions sherlock/resources/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -653,13 +653,6 @@
"urlMain": "https://www.etsy.com/",
"username_claimed": "JennyKrafts"
},
"Euw": {
"errorMsg": "This summoner is not registered at OP.GG. Please check spelling.",
"errorType": "message",
"url": "https://euw.op.gg/summoner/userName={}",
"urlMain": "https://euw.op.gg/",
"username_claimed": "blue"
},
"Exposure": {
"errorType": "status_code",
"url": "https://{}.exposure.co/",
Expand All @@ -678,6 +671,14 @@
"urlMain": "https://f3.cool/",
"username_claimed": "blue"
},
"Faceit": {
"errorMsg": "Player not found!",
"errorType": "status_code",
"url": "https://faceittracker.net/players/{}",
"urlMain": "https://faceittracker.net/",
"username_claimed": "m0NESY",
"username_unclaimed": "noonewouldeverusethis77"
},
"Fameswap": {
"errorType": "status_code",
"url": "https://fameswap.com/user/{}",
Expand Down Expand Up @@ -1230,6 +1231,78 @@
"urlMain": "https://www.livejournal.com/",
"username_claimed": "blue"
},
"LoLBr": {
"errorMsg": "Not Found",
"errorType": "message",
"tag_required": true,
"url": "https://www.leagueofgraphs.com/summoner/br/{}",
"urlMain": "https://www.leagueofgraphs.com/",
"username_claimed": "frosty-KR3"
},
"LoLEune": {
"errorMsg": "Not Found",
"errorType": "message",
"tag_required": true,
"url": "https://www.leagueofgraphs.com/summoner/eune/{}-#",
"urlMain": "https://www.leagueofgraphs.com/",
"username_claimed": "NotPurple-EUNE"
},
"LoLEuw": {
"errorMsg": "Not Found",
"errorType": "message",
"tag_required": true,
"url": "https://www.leagueofgraphs.com/summoner/euw/{}",
"urlMain": "https://www.leagueofgraphs.com/",
"username_claimed": "KC+NEXT+ADKING-EUW"
},
"LoLJp": {
"errorMsg": "Not Found",
"errorType": "message",
"tag_required": true,
"url": "https://www.leagueofgraphs.com/summoner/jp/{}",
"urlMain": "https://www.leagueofgraphs.com/",
"username_claimed": "Ninja+of+Ninjas-JP1"
},
"LoLKr": {
"errorMsg": "Not Found",
"errorType": "message",
"tag_required": true,
"url": "https://www.leagueofgraphs.com/summoner/kr/{}",
"urlMain": "https://www.leagueofgraphs.com/",
"username_claimed": "NS+Callme-KR1"
},
"LoLNa": {
"errorMsg": "Not Found",
"errorType": "message",
"tag_required": true,
"url": "https://www.leagueofgraphs.com/summoner/na/{}",
"urlMain": "https://www.leagueofgraphs.com/",
"username_claimed": "Sheiden-0001"
},
"LoLOce": {
"errorMsg": "Not Found",
"errorType": "message",
"tag_required": true,
"url": "https://www.leagueofgraphs.com/summoner/oce/{}",
"urlMain": "https://www.leagueofgraphs.com/",
"username_claimed": "Stop+here-OCE"
},
"LoLTr": {
"errorMsg": "Not Found",
"errorType": "message",
"tag_required": true,
"url": "https://www.leagueofgraphs.com/summoner/tr/{}",
"urlMain": "https://www.leagueofgraphs.com/",
"username_claimed": "Hide+on+bush-MBM0"
},
"LoLVn": {
"errorMsg": "Not Found",
"errorType": "message",
"tag_required": true,
"url": "https://www.leagueofgraphs.com/summoner/vn/{}",
"urlMain": "https://www.leagueofgraphs.com/",
"username_claimed": "Shirou-2K5"
},
"Lobsters": {
"errorType": "status_code",
"regexCheck": "[A-Za-z0-9][A-Za-z0-9_-]{0,24}",
Expand Down Expand Up @@ -1477,6 +1550,13 @@
"urlMain": "https://psnprofiles.com/",
"username_claimed": "blue"
},
"PUBGTracker": {
"errorMsg": "Player not found",
"errorType": "status_code",
"url": "https://tracker.gg/pubg/profile/steam/{}",
"urlMain": "https://tracker.gg/pubg",
"username_claimed": "tedmanios13"
},
"Packagist": {
"errorType": "response_url",
"errorUrl": "https://packagist.org/search/?q={}&reason=vendor_not_found",
Expand Down
20 changes: 19 additions & 1 deletion sherlock/sherlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ def interpolate_string(input_object, username):
return [interpolate_string(i, username) for i in input_object]
return input_object


def interpolate_tag(input_object, tag):
return input_object.replace("#", tag)

def check_for_parameter(username):
"""checks if {?} exists in the username
if exist it means that sherlock is looking for more multiple username"""
Expand All @@ -159,6 +161,7 @@ def sherlock(
username,
site_data,
query_notify,
tag="",
tor=False,
unique_tor=False,
proxy=None,
Expand All @@ -175,6 +178,8 @@ def sherlock(
query_notify -- Object with base type of QueryNotify().
This will be used to notify the caller about
query results.
tag -- String indicating accompanying to the username tag,
empty string if --tag not given
tor -- Boolean indicating whether to use a tor circuit for the requests.
unique_tor -- Boolean indicating whether to use a new tor circuit for each request.
proxy -- String indicating the proxy URL
Expand Down Expand Up @@ -242,6 +247,9 @@ def sherlock(
# URL of user on site (if it exists)
url = interpolate_string(net_info["url"], username)

if net_info.get("tag_required") and tag is not None:
url = interpolate_tag(url, tag)

# Don't make request if username is invalid for the site
regex_check = net_info.get("regexCheck")
if regex_check and re.search(regex_check, username) is None:
Expand Down Expand Up @@ -283,6 +291,8 @@ def sherlock(
# There is a special URL for probing existence separate
# from where the user profile normally can be found.
url_probe = interpolate_string(url_probe, username)
if net_info.get("tag_required"):
url = interpolate_tag(url_probe, tag)

if request is None:
if net_info["errorType"] == "status_code":
Expand Down Expand Up @@ -643,6 +653,13 @@ def main():
help="Include checking of NSFW sites from default list.",
)

parser.add_argument(
"--tag",
action="store",
dest="tag",
help="Add a tag to the username",
)

args = parser.parse_args()

# If the user presses CTRL-C, exit gracefully without throwing errors
Expand Down Expand Up @@ -760,6 +777,7 @@ def main():
username,
site_data,
query_notify,
tag = args.tag,
tor=args.tor,
unique_tor=args.unique_tor,
proxy=args.proxy,
Expand Down
8 changes: 6 additions & 2 deletions sherlock/sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class SiteInformation:
def __init__(self, name, url_home, url_username_format, username_claimed,
information, is_nsfw, username_unclaimed=secrets.token_urlsafe(10)):
information, is_nsfw, tag_required, username_unclaimed=secrets.token_urlsafe(10)):
"""Create Site Information Object.

Contains information about a specific website.
Expand Down Expand Up @@ -42,6 +42,8 @@ def __init__(self, name, url_home, url_username_format, username_claimed,
but it is only recorded in this
object for future use.
is_nsfw -- Boolean indicating if site is Not Safe For Work.
tag_required -- Boolean indicating if site's usernames are
accompanied with tags

Return Value:
Nothing.
Expand All @@ -55,6 +57,7 @@ def __init__(self, name, url_home, url_username_format, username_claimed,
self.username_unclaimed = secrets.token_urlsafe(32)
self.information = information
self.is_nsfw = is_nsfw
self.tag_required = tag_required

return

Expand Down Expand Up @@ -165,7 +168,8 @@ def __init__(self, data_file_path=None):
site_data[site_name]["url"],
site_data[site_name]["username_claimed"],
site_data[site_name],
site_data[site_name].get("isNSFW",False)
site_data[site_name].get("isNSFW",False),
site_data[site_name].get("tag_required",False)

)
except KeyError as error:
Expand Down
14 changes: 12 additions & 2 deletions sites.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## List Of Supported Sites (395 Sites In Total!)
## List Of Supported Sites (405 Sites In Total!)
1. ![](https://www.google.com/s2/favicons?domain=https://2Dimensions.com/) [2Dimensions](https://2Dimensions.com/)
1. ![](https://www.google.com/s2/favicons?domain=http://forum.3dnews.ru/) [3dnews](http://forum.3dnews.ru/)
1. ![](https://www.google.com/s2/favicons?domain=https://www.7cups.com/) [7Cups](https://www.7cups.com/)
Expand Down Expand Up @@ -95,10 +95,10 @@
1. ![](https://www.google.com/s2/favicons?domain=https://forums.envato.com/) [Envato Forum](https://forums.envato.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://www.erome.com/) [Erome](https://www.erome.com/) **(NSFW)**
1. ![](https://www.google.com/s2/favicons?domain=https://www.etsy.com/) [Etsy](https://www.etsy.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://euw.op.gg/) [Euw](https://euw.op.gg/)
1. ![](https://www.google.com/s2/favicons?domain=https://exposure.co/) [Exposure](https://exposure.co/)
1. ![](https://www.google.com/s2/favicons?domain=https://www.eyeem.com/) [EyeEm](https://www.eyeem.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://f3.cool/) [F3.cool](https://f3.cool/)
1. ![](https://www.google.com/s2/favicons?domain=https://faceittracker.net/) [Faceit](https://faceittracker.net/)
1. ![](https://www.google.com/s2/favicons?domain=https://fameswap.com/) [Fameswap](https://fameswap.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://www.fandom.com/) [Fandom](https://www.fandom.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://www.finanzfrage.net/) [Finanzfrage](https://www.finanzfrage.net/)
Expand Down Expand Up @@ -179,6 +179,15 @@
1. ![](https://www.google.com/s2/favicons?domain=https://linktr.ee/) [Linktree](https://linktr.ee/)
1. ![](https://www.google.com/s2/favicons?domain=https://listed.to/) [Listed](https://listed.to/)
1. ![](https://www.google.com/s2/favicons?domain=https://www.livejournal.com/) [LiveJournal](https://www.livejournal.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://www.leagueofgraphs.com/) [LoLBr](https://www.leagueofgraphs.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://www.leagueofgraphs.com/) [LoLEune](https://www.leagueofgraphs.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://www.leagueofgraphs.com/) [LoLEuw](https://www.leagueofgraphs.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://www.leagueofgraphs.com/) [LoLJp](https://www.leagueofgraphs.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://www.leagueofgraphs.com/) [LoLKr](https://www.leagueofgraphs.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://www.leagueofgraphs.com/) [LoLNa](https://www.leagueofgraphs.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://www.leagueofgraphs.com/) [LoLOce](https://www.leagueofgraphs.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://www.leagueofgraphs.com/) [LoLTr](https://www.leagueofgraphs.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://www.leagueofgraphs.com/) [LoLVn](https://www.leagueofgraphs.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://lobste.rs/) [Lobsters](https://lobste.rs/)
1. ![](https://www.google.com/s2/favicons?domain=https://lottiefiles.com/) [LottieFiles](https://lottiefiles.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://www.lushstories.com/) [LushStories](https://www.lushstories.com/) **(NSFW)**
Expand Down Expand Up @@ -216,6 +225,7 @@
1. ![](https://www.google.com/s2/favicons?domain=https://ourdjtalk.com/) [OurDJTalk](https://ourdjtalk.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://pcgamer.com) [PCGamer](https://pcgamer.com)
1. ![](https://www.google.com/s2/favicons?domain=https://psnprofiles.com/) [PSNProfiles.com](https://psnprofiles.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://tracker.gg/pubg) [PUBGTracker](https://tracker.gg/pubg)
1. ![](https://www.google.com/s2/favicons?domain=https://packagist.org/) [Packagist](https://packagist.org/)
1. ![](https://www.google.com/s2/favicons?domain=https://pastebin.com/) [Pastebin](https://pastebin.com/)
1. ![](https://www.google.com/s2/favicons?domain=https://www.patreon.com/) [Patreon](https://www.patreon.com/)
Expand Down