-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSoror.py
103 lines (63 loc) · 2.95 KB
/
Soror.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Soror by Alex Arbuckle #
import os, time, discord
from selenium import webdriver
from discord.ext import commands
id = 'Soror'
username = ''
password = ''
token = ''
client = commands.Bot(command_prefix = '{} '.format(id))
@client.command()
async def Enable(ctx):
''' '''
global driver
driver = webdriver.Chrome()
try:
driver.get('https://www.instagram.com/'), time.sleep(1)
driver.find_element_by_name('username').send_keys(username), time.sleep(1)
driver.find_element_by_name('password').send_keys(password), time.sleep(1)
driver.find_element_by_xpath('/html/body/div[1]/section/main/article/div[2]/div[1]/div/form/div/div[3]/button').click()
time.sleep(3), driver.find_element_by_xpath('/html/body/div[1]/section/main/div/div/div/section/div/button').click()
time.sleep(3), driver.find_element_by_xpath('/html/body/div[4]/div/div/div/div[3]/button[2]').click()
await ctx.send('Online')
except Exception as e:
await ctx.send(e)
@client.command()
async def Disable(ctx):
''' '''
driver.quit()
await ctx.send('Offline')
@client.command()
async def Status(ctx):
''' '''
if (driver.service.is_connectable()):
await ctx.send('Online')
else:
await ctx.send('Offline')
@client.command()
async def Search(ctx, arg):
''' '''
driver.get('https://www.instagram.com/{}/'.format(arg)), time.sleep(1)
try:
l = [arg + ';']
var = driver.find_element_by_xpath('//*[@id="react-root"]/section/main/div/header/section/ul/li[2]/a/span').get_attribute('title')
if (int(var.replace(',', '')) < 5001):
driver.find_element_by_xpath('/html/body/div[1]/section/main/div/header/section/ul/li[2]').click(), time.sleep(2)
for i in range((int(var.replace(',', '')) // 12) + 1):
driver.execute_script('''var fDialog = document.querySelector('div[role="dialog"] .isgrP');
fDialog.scrollTop = fDialog.scrollHeight'''), time.sleep(0.25)
for k in range(12):
try:
l.append(driver.find_element_by_xpath('/html/body/div[5]/div/div/div[2]/ul/div/li[1]/div/div[1]/div[2]/div[1]/span/a').text)
except:
l.append(driver.find_element_by_xpath('/html/body/div[5]/div/div/div[2]/ul/div/li[1]/div/div[2]/div/div/div/span/a').text)
time.sleep(0.2)
driver.execute_script('''document.querySelector("body > div.RnEpo.Yx5HN > div > div > div.isgrP > ul > div > li:nth-child(1)").remove()''')
except Exception as e:
print(e) # remove
pass
with open('{}.txt'.format(arg), 'w') as f:
[f.write('{}\n'.format(i)) for i in l]
await ctx.send('Frater Write {}'.format(arg), file = discord.File('/home/alexarbuckle/Desktop/Comperio/{}.txt'.format(arg), '{}.txt'.format(arg)))
os.remove('{}.txt'.format(arg))
client.run(token)