This repository has been archived by the owner on Apr 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path_base.py
46 lines (35 loc) · 1.71 KB
/
_base.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
import requests
from bs4 import BeautifulSoup
def github(posta, sifre) -> None:
host = "github.com"
origin = "https://github.com"
referer = "https://github.com/login"
headers = {
"User-Agent" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36",
"Host" : host,
"Origin" : origin,
"Referer" : referer,
}
oturum = requests.session()
payload_icin = BeautifulSoup(oturum.get(referer, headers=headers).content, "lxml")
payload = {
"commit" : "Sign in",
"authenticity_token" : payload_icin.find('input', attrs={"name":"authenticity_token"})['value'],
"login" : posta,
"password" : sifre,
"timestamp" : payload_icin.find('input', attrs={"name":"timestamp"})['value'],
"timestamp_secret" : payload_icin.find('input', attrs={"name":"timestamp_secret"})['value']
}
print(oturum.post('https://github.com/session', headers=headers, data=payload))
profil = BeautifulSoup(oturum.get("https://github.com/settings/profile").content, "lxml")
adi_soyadi = profil.find("input", id="user_profile_name")['value']
kullanici_adi = profil.find("div", class_="f5 text-gray-dark text-bold css-truncate css-truncate-target").text
e_posta = profil.find("select", id="user_profile_email").find("option", attrs={'selected' : 'selected'}).text
print(f"""
Adı Soyadı : {adi_soyadi}
Kullanıcı Adı : @{kullanici_adi}
e-Posta : {e_posta}
Şifre : {sifre}
""")
if __name__ == "__main__":
github(input("E Posta Giriniz : "), input("Sifre Giriniz : "))