Advertisement
Guest User

Phish_Py

a guest
Dec 9th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.97 KB | None | 0 0
  1. import requests
  2. import json
  3. import schedule
  4. import time
  5. import socket
  6. FollowArray = []
  7.  
  8. HOST = "irc.chat.twitch.tv"
  9. PORT = 6667
  10. NICK = "BOT_NAME_HERE"
  11. PASS = 'oauth:OAUTH_HERE'
  12. CHANNEL = "CHANNEL_TO_SIT_IN(I used my bot's channel)"
  13.  
  14. def send_message(msg):
  15.     s.send(bytes("PRIVMSG #" + CHANNEL + " :" + msg + "\r\n", "UTF-8"))
  16.  
  17. print("Connecting to host.")
  18. s = socket.socket()
  19. s.connect((HOST, PORT))
  20. s.send(bytes("PASS " + PASS + "\r\n", "UTF-8"))
  21. s.send(bytes("NICK " + NICK + "\r\n", "UTF-8"))
  22. s.send(bytes("JOIN #" + CHANNEL + " \r\n", "UTF-8"))
  23. print("Connected to host")
  24.  
  25. def PhishFind():
  26.     headers = {
  27.         'Client-ID': 'CLIENT_ID_HERE',
  28.     }
  29.     response = requests.get('https://api.twitch.tv/helix/streams?first=5&game_id=459931', headers=headers)
  30.     resp = response.json()
  31.     streams = resp['data']
  32.     for phishers in streams:
  33.         followerresp = requests.get('https://api.twitch.tv/helix/users/follows?to_id=' + (phishers['user_id']), headers=headers)
  34.         followers = followerresp.json()
  35.         streams2 = followers['data']
  36.         phisher = (phishers['user_name'])
  37.         if (followers['total']) < 100:
  38.             print ("\n\nThese people are phishing:\n Username:" + (phishers['user_name']) + "\n Title: " + (phishers['title']) + "\n Viewers: " + str((phishers['viewer_count'])) + "\n Followers: " + str((followers['total'])))
  39.             for following in streams2:
  40.                 follow = following['from_name']
  41.                 if follow not in FollowArray:
  42.                     FollowArray.append(follow)
  43.                     print ("This is FollowArray test: " + str(FollowArray))
  44.                     send_message("/w " + following['from_name'] + " Hi, The stream you followed: " + (phishers['user_name']) + " is actually a fake stream made to steal your Runescape password!")
  45.         elif (followers['total']) > 100:
  46.             continue
  47.  
  48. schedule.every(1).minutes.do(PhishFind)
  49.  
  50. while 1:
  51.     schedule.run_pending()
  52.     time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement