Untitled

 avatar
user_0623289
python
a year ago
2.4 kB
5
Indexable
import requests
from pymino import Client
import concurrent.futures
import queue
def calculate_transactions(total_coins, max_coins_per_transaction):
    return (total_coins + max_coins_per_transaction - 1) // max_coins_per_transaction

def send_coins(client, client2, influencer_id, total_coins, max_coins_per_transaction, num_transactions):
    transaction_queue = queue.Queue()

    # Enqueue transactions
    for _ in range(num_transactions):
        transaction_queue.put(max_coins_per_transaction)

    with concurrent.futures.ThreadPoolExecutor() as executor:
        futures = []
        for _ in range(num_transactions):
            futures.append(executor.submit(send_transaction, client, client2, influencer_id, transaction_queue))
        
        # Wait for all threads to complete
        concurrent.futures.wait(futures)

def send_transaction(client, client2, influencer_id, transaction_queue):
    coins = transaction_queue.get()
    client.community.add_influencer(influencer_id, coins)
    client2.community.subscribe_influencer(influencer_id)
    client.community.remove_influencer(influencer_id)


if __name__ == "__main__":
    client = Client(
        device_key="E7309ECC0953C6FA60005B2765F99DBBC965C8E9",
        signature_key="DFA5ED192DDA6E88A12FE12130DC6206B1251E44",
    )

    client2 = Client(
        device_key="E7309ECC0953C6FA60005B2765F99DBBC965C8E9",
        signature_key="DFA5ED192DDA6E88A12FE12130DC6206B1251E44",
    )

    influencer_id = client.fetch_object_info(input("url  :"))

    try:
        client2.login(
            secret="31 VhKVHeZo bc108cca-c755-4ccd-8308-5f56ae3772bc 61.0.100.129 c1c30a822cf86951fbcee26e18b4dfe623046d2c 1 1693740418 pyU7hYA6zK77W_lNHR99yVP42yg",
            use_cache=False,
        )

        client.login(email="unordinaryagent@gmail.com", password="sagar890@", use_cache=True)

        client.set_community_id(influencer_id.comId)
        client2.set_community_id(influencer_id.comId)

        total_coins = int(input("Enter the total number of coins: "))
        max_coins_per_transaction = 500

        num_transactions = calculate_transactions(total_coins, max_coins_per_transaction)

        send_coins(client, client2, influencer_id.objectId, total_coins, max_coins_per_transaction, num_transactions)

    except Exception as e:
        print(f"An error occurred: {str(e)}")
Leave a Comment