iojw / socialscan

Python library for accurately querying username and email usage on online platforms
Mozilla Public License 2.0
1.48k stars 185 forks source link

Using socialscan as a library giving wrong results #31

Closed axelabbas closed 3 years ago

axelabbas commented 3 years ago

I'm trying to use socialscan as a Library, the problem started today out of nowhere as it used to work in the past couple of days, Using socialscan with instagram (haven't tried any other) show's all emails as available even though some of them are not


with open("prefproxy.txt") as prox:    proxies = [i.strip() for i in prox.readlines()]
with open("input.txt") as f:    content = [i.strip() for i in f.readlines()]
c = open('output.txt', 'w')
c.close()

email = content
proxy = proxies
emailList = []
apps = [Platforms.INSTAGRAM]
results = sync_execute_queries(email, apps, proxy)
for result in results:
        try:
                if result.available:
                        print(result.query)
                        emailList.append(result.query)
                        with open("output.txt", "w") as f2:
                                for ele in emailList:
                                        f2.write(ele + '\n')
                else:
                        pass
        except KeyboardInterrupt:
                print('Interrupted')
                try:
                        sys.exit(0)
                except SystemExit:
                        os._exit(0)

And the input is:


aresjasim0@gmail.com #should be not available 
wkdksidkdd9wososo@gmail.com #should be available 
xdxdxdows92992dkxksksols@gmail.com #available
axelprivateig@gmail.com #not
axeluwuhasowoaditi@gmail.com #available 
jfjdjd@example.com #available 

While using socialscan, the tool gives accurate results, im not sure if its my file or?

axelabbas commented 3 years ago

Never-mind, Got it!

Printing the results gives me:

PlatformResponse(platform=<Platforms.INSTAGRAM: <class 'socialscan.platforms.Instagram'>>, query='aresjasim0@gmail.com', available=False, valid=False, success=False, message='ServerTimeoutError - Connection timeout to host https://instagram.com', link=None)
aresjasim0@gmail.com
PlatformResponse(platform=<Platforms.INSTAGRAM: <class 'socialscan.platforms.Instagram'>>, query='wkdksidkdd9wososo@gmail.com', available=False, valid=False, success=False, message="ClientHttpProxyError - 503, message='Service Unavailable', url=URL('http://115.223.7.110:80')", link=None)
wkdksidkdd9wososo@gmail.com
PlatformResponse(platform=<Platforms.INSTAGRAM: <class 'socialscan.platforms.Instagram'>>, query='xdxdxdows92992dkxksksols@gmail.com', available=False, valid=False, success=False, message="ClientHttpProxyError - 403, message='Forbidden', url=URL('http://119.81.189.194:8123')", link=None)
xdxdxdows92992dkxksksols@gmail.com
PlatformResponse(platform=<Platforms.INSTAGRAM: <class 'socialscan.platforms.Instagram'>>, query='axelprivateig@gmail.com', available=False, valid=False, success=False, message="ClientHttpProxyError - 403, message='Forbidden', url=URL('http://119.81.189.194:80')", link=None)
axelprivateig@gmail.com
PlatformResponse(platform=<Platforms.INSTAGRAM: <class 'socialscan.platforms.Instagram'>>, query='axeluwuhasowoaditi@gmail.com', available=False, valid=False, success=False, message='ServerTimeoutError - Connection timeout to host https://instagram.com', link=None)
axeluwuhasowoaditi@gmail.com
PlatformResponse(platform=<Platforms.INSTAGRAM: <class 'socialscan.platforms.Instagram'>>, query='jfjdjd@example.com', available=False, valid=False, success=False, message="ClientProxyConnectionError - Cannot connect to host 138.197.157.32:3128 ssl:default [Connect call failed ('138.197.157.32', 3128)]", link=None)
jfjdjd@example.com

My proxies aren't working. Feel free to close it!

iojw commented 3 years ago

Great! You might want to check the success attribute first to ensure that the query was performed succesfully.

axelabbas commented 3 years ago

Hey again, I have a question, I've been trying to find other proxies and every proxy I used ended up at failing, my question is that I have a list of proxies and the way the scanner works is it takes the proxy and uses it with the mail, if the proxy doesn't work it just skips the user, now my question is: is there a way to make it that it keeps taking proxies until it succeeds? Or do I need to do some editing in the source to get that working (sorry for the unprofessional explanation)

iojw commented 3 years ago

Yes, you are right. The current behavior is to cycle through proxies for each request regardless of whether the request succeeded. There isn't an option to retry until it succeeds currently so you could create an issue for this to request it or edit the source code to make it work as you described.