Last seen bot for Telegram using Python, Selenium #KriosX

dark15s15

Katılımcı Üye
25 Ağu 2008
314
2
Kod:
[COLOR=#cc7832]from [/COLOR]selenium [COLOR=#cc7832]import [/COLOR]webdriver
[COLOR=#cc7832]import [/COLOR]time
[COLOR=#cc7832]from [/COLOR]random [COLOR=#cc7832]import [/COLOR]randint

fp = webdriver.FirefoxProfile([COLOR=#6a8759]'path of the firefox profile'[/COLOR])
fp.set_preference([COLOR=#6a8759]"browser.privatebrowsing.autostart"[/COLOR][COLOR=#cc7832], True[/COLOR])
driver = webdriver.Firefox([COLOR=#aa4926]firefox_profile[/COLOR]=fp[COLOR=#cc7832],
[/COLOR][COLOR=#aa4926]executable_path[/COLOR]=[COLOR=#6a8759]'path of the gecko driver'[/COLOR])
driver.get([COLOR=#6a8759]'https://web.telegram.org/#/login'[/COLOR])
username = [COLOR=#6a8759]"number"
[/COLOR]password = [COLOR=#6a8759]"if you have protection code use it if not you must edit codes"
time.sleep(10)
driver.find_element_by_xpath("/html/body/div[1]/div/div[3]/div[2]/form/div[2]/div[2]/input").send_keys(username)
time.sleep(2)
driver.find_element_by_xpath("/html/body/div[1]/div/div[3]/div[1]/div/a/i").click()
time.sleep(2)
driver.find_element_by_xpath("/html/body/div[4]/div[2]/div/div/div[2]/button[2]").click()
time.sleep(10)
driver.find_element_by_xpath("/html/body/div[1]/div/div[3]/div[2]/form/div[1]/input").send_keys(password)
time.sleep(1)
driver.find_element_by_xpath("/html/body/div[1]/div/div[3]/div[1]/div/a/i").click()
time.sleep(5)
lastSeen = driver.find_element_by_xpath("/html/body/div[1]/div[1]/div/div[2]/div[2]/div/div[2]/a/div/span[2]/span").text

while True:
    if lastSeen !=  driver.find_element_by_xpath("/html/body/div[1]/div[1]/div/div[2]/div[2]/div/div[2]/a/div/span[2]/span").text:
        f = open("TelegramLOG.txt", "a", encoding="UTF-8")
        f.write("# "+lastSeen+" #"+datetime.now().strftime('%Y-%m-%d %H:%M:%S')+"\n")
        f.close()
        lastSeen = driver.find_element_by_xpath("/html/body/div[1]/div[1]/div/div[2]/div[2]/div/div[2]/a/div/span[2]/span").text
    else:
        pass
[/COLOR][COLOR=#6a8759] time.sleep(1)[/COLOR]
When telegram sends verification code to your phone, there is delay 10 seconds while it you should text it
otherwise you will get error. End of code you should open the profile which person's lastseen should be followed.
 
Son düzenleme:
Üst

Turkhackteam.org internet sitesi 5651 sayılı kanun’un 2. maddesinin 1. fıkrasının m) bendi ile aynı kanunun 5. maddesi kapsamında "Yer Sağlayıcı" konumundadır. İçerikler ön onay olmaksızın tamamen kullanıcılar tarafından oluşturulmaktadır. Turkhackteam.org; Yer sağlayıcı olarak, kullanıcılar tarafından oluşturulan içeriği ya da hukuka aykırı paylaşımı kontrol etmekle ya da araştırmakla yükümlü değildir. Türkhackteam saldırı timleri Türk sitelerine hiçbir zararlı faaliyette bulunmaz. Türkhackteam üyelerinin yaptığı bireysel hack faaliyetlerinden Türkhackteam sorumlu değildir. Sitelerinize Türkhackteam ismi kullanılarak hack faaliyetinde bulunulursa, site-sunucu erişim loglarından bu faaliyeti gerçekleştiren ip adresini tespit edip diğer kanıtlarla birlikte savcılığa suç duyurusunda bulununuz.