Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
3.5 kB
2
Indexable
Never
import asyncio
import base64
import json
import time
from datetime import datetime

import requests
import telethon
from telethon.tl.functions.channels import JoinChannelRequest, LeaveChannelRequest
from PIL import Image
from random_username.generate import generate_username
import random
import os
from telethon import TelegramClient, events, sync,functions
from telethon.tl.types import InputPeerChannel
from twocaptcha import TwoCaptcha,TimeoutException
import threading
import os
from config import api_id,api_hash


def change_ip():
    key = 'DvxTlXgtbsoJ8Bjt1wBQka1700477969'
    url = f'https://app.proxyno1.com/api/change-key-ip/{key}'
    try:
        response2 = requests.get(url)
        print(response2.text)
    except:
        pass
    # print(response2.text)
    time.sleep(40)

    proxy_request = 'dogyuz:262157@hndc35.proxyno1.com:50556'
    proxy_ = {"http": f"http://{proxy_request}", "https": f"http://{proxy_request}"}


    try:
        response3 = requests.get('https://api.ipify.org/', proxies=proxy_)
        # print(response3.text)
        if response3.status_code == 200:
            print(response3.text)
    except:
        time.sleep(10)

# change_ip()
# input('a')
dem = 0
# username = generate_username(1)[0].lower()
'dogyuz:262157@svhn10.proxyno1.com:63303'
proxy1= {
    'proxy_type': 'http', # (mandatory) protocol to use (see above)
    'addr': 'svhn10.proxyno1.com',      # (mandatory) proxy IP address
    'port': 63303,           # (mandatory) proxy port number
    'username': 'dogyuz',      # (optional) username if the proxy requires auth
    'password': '262157',      # (optional) password if the proxy requires auth
    'rdns': True            # (optional) whether to use remote or local resolve, default remote
}
'check 87' '79, 94'
for i in [116,121,135,161,164]:
    client =   TelegramClient("session_alive_2nd/%s" % (i), api_id[i%30], api_hash[i%30],proxy=proxy1)
    # client =   TelegramClient("session/%s" % (1), api_id[1], api_hash[1])
    client.connect()
    # client.send_message("@TrnhPhan18", "ccccc")
    if (client.is_user_authorized() == False):
        # open('join_fail.txt', 'a').write(f'acc {i} banned' + '\n')
        # open('phone_tele_appquest.txt', 'a').write('\n')
        pass
    else:
        phone = client.get_me().phone
        print(phone)
        # client(JoinChannelRequest("https://t.me/raiinmakertalk"))
        msg = client.get_messages(777000, 5)
        for _ in range(len(msg)):
            # print(msg[_].message)
            if "You can press 'Disconnect' to disconnect app.questn.com" in msg[_].message:
                msg[_].click(0,0)
                print('clicked disconnect')

        # open('phone_tele_appquest.txt','a').write(phone+'\n')
        # try:
        #     client(JoinChannelRequest("https://t.me/raiinmakertalk"))
        #     time.sleep(1)
        #     msg = client.get_messages('@raiinmakertalk', 3)
        #     # print(msg)
        #     for a in range(0, 3):
        #         # print(msg[i].from_id.user_id)
        #         if msg[a].from_id.user_id == 5498957003:
        #             msg[0].click(0, 0)
        #             break
        # except Exception as e:
        #     print(f'acc {i} error: {str(e)}')
        #     open('join_fail.txt','a').write(f'acc {i} error: {str(e)}' + '\n')

        client.disconnect()
        if i%40 ==0:
            change_ip()
Leave a Comment