Advertisement
ExamV1

Sendit Spammer

Mar 13th, 2023 (edited)
946
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.60 KB | None | 0 0
  1. #Check out the replit: https://replit.com/@ExamV1/Sendit-Spammer?v=1
  2. #Check it out on github: https://github.com/ExamV1/Sendit-Spammer
  3.  
  4. import requests
  5. import random
  6. import time
  7. import re
  8. import html
  9. import lxml.html
  10. from lxml import html
  11.  
  12. #trivia api
  13. url = "https://opentdb.com/api.php"
  14. params = {
  15.     "amount": 1,
  16.     "type": 'multiple',
  17. }
  18. print('.----------------.')
  19. print('| Made By ExamV1 |')
  20. print("'----------------'")
  21. print('This will spam a bunch of random trivia questions to the chosen sendit')
  22. sticker_link = input("\nEnter the sendit link: ")
  23. match = re.search(r's/([a-f\d-]+)', sticker_link)
  24. sticker_id = match.group(1)
  25.  
  26.  
  27. while True:
  28.     response = requests.get(url, params=params)
  29.     data = response.json()
  30.     questions = [lxml.html.fromstring(q["question"]).text_content() for q in data["results"]]
  31.     answers = [lxml.html.fromstring(q["correct_answer"]).text_content() for q in data["results"]]
  32.     incorrect_answers = [[lxml.html.fromstring(answer).text_content() for answer in q["incorrect_answers"]] for q in data["results"]]
  33.  
  34.  
  35.  
  36.  
  37.     page1 = requests.get(sticker_link)
  38.     soup1 = html.fromstring(page1.content)
  39.     script_text1 = soup1.xpath('/html/body/script[1]/text()')[0]
  40.     author_display_name = soup1.xpath('//*[@id="postedByText"]/span/text()[1]')[0]  #this gets the display name
  41.     matches1 = re.findall(r'"(\w+)":\s*{"id":\s*"([^"]+)"', script_text1)  #this gets the unique id of the user you are sending to
  42.  
  43.     for i1, match1 in enumerate(matches1):
  44.         if i1 == 1:                             #this makes sure it gets the correct user id and outputs it correctly
  45.             var_id1 = match1[1]  
  46.  
  47. #the send post
  48.     send_url = "https://reply.getsendit.com/api/v1/sendpost"
  49.     headers = {
  50.         "accept": "*/*",
  51.         "accept-language": "en-GB,en;q=0.9,en-US;q=0.8",
  52.         "content-type": "text/plain;charset=UTF-8",
  53.         "sec-ch-ua": "\"Chromium\";v=\"110\", \"Not A(Brand\";v=\"24\", \"Microsoft Edge\";v=\"110\"",
  54.         "sec-ch-ua-mobile": "?0",
  55.         "sec-ch-ua-platform": "\"Windows\"",
  56.         "sec-fetch-dest": "empty",
  57.         "sec-fetch-mode": "cors",
  58.         "sec-fetch-site": "same-origin"
  59.     }
  60.  
  61. #makes sure the answer is in a random spot, aswell as the incorrect ones
  62.     for i in range(len(questions)):
  63.         choices = [answers[i]] + incorrect_answers[i]
  64.         random.shuffle(choices)
  65.  
  66.         prompt = f"{questions[i]}\n\nA) {choices[0]}\nB) {choices[1]}\nC) {choices[2]}\nD) {choices[3]}\n"
  67.         data = {
  68.             "data": {
  69.                 "postType": "sendit.post-type:question-and-answer-v1",
  70.                 "userId": var_id1,
  71.                 "stickerId": sticker_id,
  72.                 "shadowToken": "ffe4b23a-5977-435a-8109-d57cfb4ab6e2",
  73.                 "platform": "snapchat",
  74.                 "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.69"
  75.             },
  76.             "replyData": {
  77.                 "question": prompt,
  78.                 "promptText": ""
  79.             }
  80.         }
  81.  
  82.         response = requests.post(send_url, headers=headers, json=data)
  83.  
  84.         #more debug PRINT info
  85.         #print("Response Status Code:", response.status_code)
  86.         #print("Response Text:", response.text)
  87.         print("\nTrivia Qeuestion spam sent to sendit user: " + author_display_name + "\n#user id: " + var_id1)
  88.  
  89.  
  90.  
  91.         def loading_line(length):
  92.             return ''.join(random.choice(['-', '=']) for _ in range(length))
  93.  
  94.         print(loading_line(10)) # this is just so you know if the code has not stopped
  95.  
Advertisement
Comments
  • yammoe
    1 year
    Comment was deleted
Add Comment
Please, Sign In to add comment
Advertisement