diff --git a/sherlock/resources/data.json b/sherlock/resources/data.json index 09b59025..66e30409 100644 --- a/sherlock/resources/data.json +++ b/sherlock/resources/data.json @@ -294,7 +294,8 @@ "url": "https://pt.bongacams.com/profile/{}", "urlMain": "https://pt.bongacams.com", "username_claimed": "asuna-black", - "username_unclaimed": "noonewouldeverusethis77777" + "username_unclaimed": "noonewouldeverusethis77777", + "isNSFW": true }, "Bookcrossing": { "errorType": "status_code", @@ -369,7 +370,8 @@ "url": "https://chaturbate.com/{}", "urlMain": "https://chaturbate.com", "username_claimed": "cute18cute", - "username_unclaimed": "noonewouldeverusethis77777" + "username_unclaimed": "noonewouldeverusethis77777", + "isNSFW": true }, "Chess": { "errorMsg": "Username is valid", @@ -1385,7 +1387,8 @@ "urlMain": "https://onlyfans.com/", "urlProbe": "https://onlyfans.com/api2/v2/users/{}", "username_claimed": "theemilylynne", - "username_unclaimed": "noonewouldeverusethis7" + "username_unclaimed": "noonewouldeverusethis7", + "isNSFW": true }, "OpenStreetMap": { "errorType": "status_code", @@ -1511,7 +1514,8 @@ "url": "https://pornhub.com/users/{}", "urlMain": "https://pornhub.com/", "username_claimed": "blue", - "username_unclaimed": "noonewouldeverusethis7" + "username_unclaimed": "noonewouldeverusethis7", + "isNSFW": true }, "ProductHunt": { "errorMsg": "We seem to have lost this page", @@ -2117,8 +2121,8 @@ "url": "https://en.wikipedia.org/wiki/Special:CentralAuth/{}?uselang=qqx", "urlMain": "https://www.wikipedia.org/", "username_claimed": "Hoadlck", - "username_unclaimed": "noonewouldeverusethis8" - }, + "username_unclaimed": "noonewouldeverusethis8" + }, "Windy": { "errorType": "status_code", "url": "https://community.windy.com/user/{}", @@ -2178,7 +2182,8 @@ "url": "https://xvideos.com/profiles/{}", "urlMain": "https://xvideos.com/", "username_claimed": "blue", - "username_unclaimed": "noonewouldeverusethis7" + "username_unclaimed": "noonewouldeverusethis7", + "isNSFW": true }, "YouNow": { "errorMsg": "No users found", @@ -2201,7 +2206,8 @@ "url": "https://youporn.com/uservids/{}", "urlMain": "https://youporn.com", "username_claimed": "blue", - "username_unclaimed": "noonewouldeverusethis77777" + "username_unclaimed": "noonewouldeverusethis77777", + "isNSFW": true }, "Zhihu": { "errorMsg": "404", @@ -2704,4 +2710,4 @@ "username_claimed": "kossher", "username_unclaimed": "noonewouldeverusethis7" } -} +} \ No newline at end of file diff --git a/sherlock/sherlock.py b/sherlock/sherlock.py index c72daa5a..57a74a8f 100644 --- a/sherlock/sherlock.py +++ b/sherlock/sherlock.py @@ -561,6 +561,10 @@ def main(): action="store_true", default=False, help="Force the use of the local data.json file.") + parser.add_argument("--nsfw", + action="store_true", default=False, + help="Include checking of NSFW sites from default list. Default False") + args = parser.parse_args() # If the user presses CTRL-C, exit gracefully without throwing errors @@ -624,6 +628,9 @@ def main(): print(f"ERROR: {error}") sys.exit(1) + if not args.nsfw: + sites.remove_nsfw_sites() + # Create original dictionary from SitesInformation() object. # Eventually, the rest of the code will be updated to use the new object # directly, but this will glue the two pieces together. diff --git a/sherlock/sites.py b/sherlock/sites.py index 2ee9999c..90c6d11b 100644 --- a/sherlock/sites.py +++ b/sherlock/sites.py @@ -8,7 +8,7 @@ import requests class SiteInformation: def __init__(self, name, url_home, url_username_format, username_claimed, - username_unclaimed, information): + username_unclaimed, information, is_nsfw): """Create Site Information Object. Contains information about a specific website. @@ -52,6 +52,7 @@ class SiteInformation: self.username_claimed = username_claimed self.username_unclaimed = username_unclaimed self.information = information + self.is_nsfw = is_nsfw return @@ -162,7 +163,9 @@ class SitesInformation: site_data[site_name]["url"], site_data[site_name]["username_claimed"], site_data[site_name]["username_unclaimed"], - site_data[site_name] + site_data[site_name], + site_data[site_name].get("isNSFW",False) + ) except KeyError as error: raise ValueError( @@ -171,6 +174,23 @@ class SitesInformation: return + def remove_nsfw_sites(self): + """ + Remove NSFW sites from the sites, if isNSFW flag is true for site + + Keyword Arguments: + self -- This object. + + Return Value: + None + """ + sites = {} + for site in self.sites: + if self.sites[site].is_nsfw: + continue + sites[site] = self.sites[site] + self.sites = sites + def site_name_list(self): """Get Site Name List.