Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- '''
- 4UMB0T: adopteunmec bot
- Free for all. Made for educational purposes only
- With YOUR VALID account, visit profiles for you
- required args : -town
- -nb of iteration. 1= 24 profiles to visit
- optional args : -age
- This is a PYTHON3 script
- Required pip3 modules
- beautifulsoup4,bs4,certifi,chardet,idna,pkg-resources,requests,urllib3
- Files:
- aum-blacklist.txt = blacklist file that contains profile's ID not to visit.
- aum-data.json = DB that contains data/timestamp of profiles visited
- Enjoy
- '''
- from bs4 import BeautifulSoup
- import requests, time, sys, getpass, json, calendar, os.path
- import random, argparse, re
- from random import uniform
- '''
- User/Password : if you want, set them here. Otherwise they will be prompted later
- '''
- #user = ""
- #pwd = ""
- url_base = "https://www.%61do%70te%75%6Eme%63.com" #url a littlebit obfuscated :-)
- url_auth = "/auth/login"
- url_myprofil = "/profile/me"
- url_profil = "/profile"
- url_search = "/g%6Fg%6Fle"
- donotvisitbefore = 21600
- total = 0
- ignored_profiles = 0
- age = None
- def setUserAgent():
- myAgents = [
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36",
- "Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16",
- "Mozilla/5.0 (Linux; Android 5.1.1; SM-G928X Build/LMY47X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 7.0; Pixel C Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.98 Safari/537.36",
- "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a3pre) Gecko/20070330",
- "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0)",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36"
- ]
- return(random.choice(myAgents))
- def saveToJSON():
- with open('./aum-data.json', 'w') as outfile:
- json.dump(contacts, outfile)
- def isIDKnown(id, contacts):
- ''' Looking for 'id' into DB '''
- for contact in contacts:
- if contact['id'] == id:
- return True
- def isInBlackList(id):
- ''' Looking for 'id' into BlackList '''
- myBlackList = []
- if os.path.isfile("./aum-blacklist.txt"):
- with open('./aum-blacklist.txt') as fd:
- for line in fd:
- line = line.strip()
- myBlackList.append(line)
- if str(id) in myBlackList:
- return True
- def timeToVisitProfile(id, contacts):
- ''' Looking if enough seconds have elapsed since the last visit '''
- last_visit = 0
- now = calendar.timegm(time.gmtime())
- for contact in contacts:
- if contact['id'] == id:
- last_visit = contact['last_visit']
- if (now - last_visit >= donotvisitbefore):
- return True
- def updateLastVisit(id, contacts):
- ''' updating DB with 'last visit' timestamp '''
- now = calendar.timegm(time.gmtime())
- for contact in contacts:
- if contact['id'] == id:
- contact['last_visit'] = now
- def getDatas(session, town, url):
- ''' Call URL to retrieve raw datas '''
- session.headers.update({'referer':url_base+url_search+'?q=en+ligne+' + town})
- session.headers.update({'X-Requested-With':'XMLHttpRequest'})
- response=session.get(url, cookies=session.cookies)
- return json.loads(response.content.decode('utf-8'))
- def visitProfiles(dataset, db):
- ''' Parse the dataset and, if possible, visit each profile '''
- global vp
- global ip
- if 'members' in dataset:
- temp={}
- index=0
- for i in dataset['members']:
- temp.update({index: i})
- index += 1
- dataset = temp
- for key, value in dataset.items():
- if 'pseudo' in value:
- id = value['id']
- name = value['pseudo']
- pflage = value['age']
- if (age and not (int(age[0]) <= pflage <= int(age[1]))):
- print("-IGNORING profile \'" + name + "\' : not in AGE range")
- ip += 1
- continue
- if isInBlackList(id):
- print("-IGNORING profile \'" + name + "\' : present in BLACKLIST")
- ip += 1
- continue
- if not isIDKnown(id, db['people']):
- duree = uniform(4,6)
- print("+Profile \'" + name + "\' unknown : visit in " + str(round(duree,2)) + " seconds")
- time.sleep(duree)
- session.get(url_base+url_profil+"/"+id, cookies=session.cookies)
- vp += 1
- ''' New profile. Save it into DB '''
- db['people'].append({
- 'pseudo' : name,
- 'id' : id,
- 'url' : url_base + "/profile/"+id,
- 'last_visit' : calendar.timegm(time.gmtime())
- })
- saveToJSON()
- continue
- elif isIDKnown(id, db['people']):
- ''' DB known profile. Check if visit is possible '''
- if timeToVisitProfile(id, db['people']):
- duree = uniform(4,6)
- print("+Profile \'" + name + "\' KNOWN : visit possible into " + str(round(duree,2)) + " seconds", end="")
- time.sleep(duree)
- session.get(url_base+url_profil+"/"+id, cookies=session.cookies)
- print("....DONE!")
- vp += 1
- updateLastVisit(id, db['people'])
- saveToJSON()
- continue
- else:
- print("-IGNORE profile \'" + name + "\' : Last visit too close.")
- ip += 1
- else:
- continue
- ''' Main loop '''
- ap = argparse.ArgumentParser()
- ap.add_argument("-t", "--town", required=True, help="name of town")
- ap.add_argument("-i", "--iter", required=True, help="nb. of iteration [0=24*1 profiles, 1=24*2 profiles, etc]")
- ap.add_argument("-a", "--age", required=False, help="Age (ex:30, or 30-35")
- args = vars(ap.parse_args())
- town = args["town"]
- iteration = int(args["iter"])
- if age:
- age = args["age"].split("-")
- if len(age) == 1:
- age.append(age[0])
- print("====== AUM bot =======")
- '''Load DB '''
- if os.path.isfile("./aum-data.json"):
- with open('./aum-data.json') as fd:
- contacts = json.load(fd)
- print("\n" + str(len(contacts['people'])) + " profiles loaded from DB...")
- else:
- contacts = {}
- contacts['people'] = []
- try: user
- except NameError: user = input("Login > ")
- try:pwd
- except NameError: pwd = getpass.getpass("Password (no echo) > ")
- payload = { 'username': user, 'password': pwd, 'remember': 'on'}
- ''' prepare to connect, and set a random USerAgent '''
- session = requests.Session()
- session.headers.update({'User-Agent': setUserAgent()})
- ''' Authentication: get session cookie '''
- response=session.post(url_base+url_auth, data=payload, cookies=session.cookies)
- pseudo = BeautifulSoup(session.get(url_base+url_myprofil, cookies=session.cookies).text, "html.parser").find("div", attrs={"class" : "username _cb-pseudo"}).text
- print('Hi \"' + pseudo + '\"')
- print("Seeking for online girls near", town)
- loop = 0
- count = 24
- vp=0 #Total nb of visited profiles
- ip=0 #Total nb of ignored profiles
- while loop < iteration:
- url=url_base + url_search + "/more?q=en%20ligne%20" + town + "&offset=" + str(loop*count) + "&count=" + str(count) + "&last_seen=0"
- visitProfiles(getDatas(session, town, url), contacts)
- loop += 1
- print("\nEnd : ", vp, " Visited profiles / ", ip, "Ignored profiles")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement