reddit upvote botu yazdım ama upvote yapıldı deyiip yapmıyor. sorunu çözene 1000 tl whatsapp
import requests
import time
# Hesap bilgileri
accounts = [
    {
        "username": "Empty-Ad-5746",
        "password": "zowuhocog184",
        "mail": "efrain39abshireivz@hotmail.com",
        "client_id": "7mpBCX4LoGLxRjQu5SutXQ",
        "client_secret": "V458nxNxE-5Fo89EYS-woBHW-0XFkg",
        "refresh_token": "113805365433421-1cnpYTgDqw97yR41qfsz7nQNPLnHog",
        "appname": "am429"
    },
    {
        "username": "Unhappy_Flamingo_693",
        "password": "xuvokyxyq8122",
        "mail": "qjyquwojav1986@hotmail.com",
        "client_id": "3o2V7EElzxWNq2GNY1zdBA",
        "client_secret": "wOOF3Qsm3LiTllYrvgKivqglF8Cykw",
        "refresh_token": "113806200694860-KnsxDpMlzCAUrVZS-_U5pw8LN9pbkw",
        "appname": "aa169"
    },
    {
        "username": "Effective_Cable_9457",
        "password": "nulykyx65",
        "mail": "qxowogilosiz1959@hotmail.com",
        "client_id": "mk1vyhSI26_5eFx0XDjRKg",
        "client_secret": "LVWzzai0Q3Q3toh8DWSNIbdfpM37WA",
        "refresh_token": "113806840584268-gLbfNICb2Gf8mQLbtZJNH1j3voad-A",
        "appname": "l1992"
    },
    {
        "username": "South_Music9217",
        "password": "zazusydybaqan5",
        "mail": "huwawumibu1982@hotmail.com",
        "client_id": "0uVufy8-I93M3hbHQW4eoQ",
        "client_secret": "mDsoDFJdp4X7QwrWkcvVX8fC8mQ8kQ",
        "refresh_token": "113807118831648-pG6RQVLLGW0QqW4Oa7dRB7XL5qQW5A",
        "appname": "io508"
    },
    {
        "username": "HopefulBluejay5570",
        "password": "fojiboki4",
        "mail": "jqanagafumiqu1981@hotmail.com",
        "client_id": "0_VkhDMumrDf4IdBLvEb1A",
        "client_secret": "U4S-V79uf5OxTdV3RBiyelF7yq5EQA",
        "refresh_token": "113807398522924-wdZv48-MoyuBqfFcn1KrGcV1sI6s2g",
        "appname": "flad0"
    },
    {
        "username": "Money-Reindeer8839",
        "password": "wuquvesasisiha",
        "mail": "rmubonekukyja1974@hotmail.com",
        "client_id": "EV97zO20kM0L3FYPIGWnBA",
        "client_secret": "RCxpP3EpS69vpmJ97UAXEAKEOOC8Ng",
        "refresh_token": "113807779916875-6eLscd8-8TigLbI4DBBRDjqweO-tGw",
        "appname": "s1992"
    },
    {
        "username": "Subject-Werewolf4117",
        "password": "pusutecosatezu81",
        "mail": "yajubohanabu1997@hotmail.com",
        "client_id": "jbot3Hz06IuCOxjJtj3evg",
        "client_secret": "Nmfzg-rCqsrq7qxggNnwaKyRQiXjAQ",
        "refresh_token": "113808727957536-aOsSGXh0bg-pWj5n00_8Wb6rJKU8JQ",
        "appname": "zg899"
    }
]
# Proxy bilgileri
proxy_url = "socks5://aspetwashere:Hadihadi3434_country-us@geo.iproyal.com:32325"
# Erişim token'ı alma
def get_access_token(client_id, client_secret, refresh_token, user_agent, proxies):
    auth = requests.auth.HTTPBasicAuth(client_id, client_secret)
    headers = {"User-Agent": user_agent}
    data = {
        "grant_type": "refresh_token",
        "refresh_token": refresh_token
    }
    response = requests.post("https://www.reddit.com/api/v1/access_token", auth=auth, headers=headers, data=data, proxies=proxies)
    response.raise_for_status()
    return response.json()["access_token"]
# Gönderiyi beğenme
def upvote_post(access_token, post_id, user_agent, proxies):
    headers = {
        "Authorization": f"Bearer {access_token}",
        "User-Agent": user_agent
    }
    data = {
        "id": post_id,
        "dir": 1  # 1 = upvote, 0 = remove vote, -1 = downvote
    }
    response = requests.post("https://oauth.reddit.com/api/vote", headers=headers, data=data, proxies=proxies)
    if response.status_code == 200:
        return True
    else:
        print(f"Upvote işlemi başarısız. Durum kodu: {response.status_code}, Yanıt: {response.text}")
        return False
# Hesabın askıya alınıp alınmadığını kontrol etme
def is_account_suspended(username, proxies):
    url = f"https://www.reddit.com/user/{username}/about.json"
    headers = {"User-Agent": "Mozilla/5.0"}
    response = requests.get(url, headers=headers, proxies=proxies)
    if response.status_code == 404:
        return True  # Hesap askıya alınmış veya mevcut değil
    return False
# Hesabın belirli bir gönderiyi zaten beğenip beğenmediğini kontrol etme
def has_already_upvoted(access_token, post_id, user_agent, proxies):
    headers = {
        "Authorization": f"Bearer {access_token}",
        "User-Agent": user_agent
    }
    response = requests.get(f"https://oauth.reddit.com/api/info.json?id={post_id}", headers=headers, proxies=proxies)
    if response.status_code == 200:
        data = response.json()
        if 'children' in data['data']:
            for child in data['data']['children']:
                if child['data']['id'] == post_id.split('_')[1] and child['data']['likes'] == True:
                    return True
    return False
if __name__ == "__main__":
    post_id = "t3_1e1dnse"  # Beğenmek istediğiniz gönderinin ID'si
    for account in accounts:
        try:
            # Proxy ayarları
            proxies = {
                "http": proxy_url,
                "https": proxy_url
            }
            print(f"{account['username']} - Hesap kontrol ediliyor.")
            if is_account_suspended(account["username"], proxies):
                print(f"{account['username']} - Hesap askıya alınmış veya mevcut değil.")
                continue
            print(f"{account['username']} - Erişim token'ı alınıyor.")
            access_token = get_access_token(account["client_id"], account["client_secret"], account["refresh_token"], account["appname"], proxies)
            
            print(f"{account['username']} - Gönderi beğenilip beğenilmediği kontrol ediliyor.")
            if has_already_upvoted(access_token, post_id, account["appname"], proxies):
                print(f"{account['username']} - Gönderi zaten beğenilmiş.")
                continue
            if upvote_post(access_token, post_id, account["appname"], proxies):
                print(f"{account['username']} - Gönderi başarıyla beğenildi.")
            else:
                print(f"{account['username']} - Gönderi beğenme başarısız.")
            
            time.sleep(2)  # Reddit API sınırlarına uymak için bekleme süresi
        except Exception as e:
            print(f"{account['username']} - Hata oluştu: {e}")