trying to make a steam download Automator but it doesn’t work

tried to make a steam download Automator using schedule subprocess pyautogui time requests
(and steam cmd)
im thinking the problem might come from steam cmd but I’m not too sure
when the time hits that its supposed to download it just does nothing everything other than the downloading works any help would be appreciated
heres the code

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>import schedule
import subprocess
import pyautogui
import time
import requests
def get_steam_app_id(game_name):
search_url = f"https://store.steampowered.com/api/storesearch/?term={game_name}&cc=us"
try:
response = requests.get(search_url)
response.raise_for_status()
results = response.json().get('items', [])
if results:
first_result = results[0]
app_id = first_result.get('id')
game_title = first_result.get('name')
print(f"Found '{game_title}' with app ID: {app_id}")
return app_id
else:
print(f"No results found for {game_name}.")
return None
except requests.RequestException as e:
print(f"Error fetching app ID: {e}")
return None
def connect_to_wifi():
wifi_name = "your wifi name"
try:
subprocess.run(f'netsh wlan connect name="{wifi_name}"', check=True, shell=True)
print(f"Connected to {wifi_name}")
except subprocess.CalledProcessError as e:
print(f"Failed to connect to {wifi_name}: {e}")
def start_steam_download(app_id):
try:
print(f"Starting Steam download for app ID: {app_id}...")
command = (
'C:\steamcmd\steamcmd +login anonymous '
f'+app_update {app_id} validate +quit'
)
subprocess.run(command, shell=True, check=True)
print("Steam download started.")
except subprocess.CalledProcessError as e:
print(f"Failed to start the download: {e}")
def pause_steam_download():
print("Pausing Steam download...")
time.sleep(2)
x_coord = 1819
y_coord = 359
pyautogui.click(x_coord, y_coord)
print(f"Clicked pause at coordinates ({x_coord}, {y_coord}). Steam download paused.")
def schedule_tasks(app_id):
schedule.every().day.at("09:17").do(lambda: connect_to_wifi())
schedule.every().day.at("09:17").do(lambda: start_steam_download(app_id))
schedule.every().day.at("09:19").do(lambda: pause_steam_download())
print("Tasks scheduled")
if __name__ == "__main__":
game_name = input("Enter the game name: ")
app_id = get_steam_app_id(game_name)
if app_id:
schedule_tasks(app_id)
while True:
schedule.run_pending()
time.sleep(5)
else:
print("Unable to schedule tasks without a valid app ID.")
</code>
<code>import schedule import subprocess import pyautogui import time import requests def get_steam_app_id(game_name): search_url = f"https://store.steampowered.com/api/storesearch/?term={game_name}&cc=us" try: response = requests.get(search_url) response.raise_for_status() results = response.json().get('items', []) if results: first_result = results[0] app_id = first_result.get('id') game_title = first_result.get('name') print(f"Found '{game_title}' with app ID: {app_id}") return app_id else: print(f"No results found for {game_name}.") return None except requests.RequestException as e: print(f"Error fetching app ID: {e}") return None def connect_to_wifi(): wifi_name = "your wifi name" try: subprocess.run(f'netsh wlan connect name="{wifi_name}"', check=True, shell=True) print(f"Connected to {wifi_name}") except subprocess.CalledProcessError as e: print(f"Failed to connect to {wifi_name}: {e}") def start_steam_download(app_id): try: print(f"Starting Steam download for app ID: {app_id}...") command = ( 'C:\steamcmd\steamcmd +login anonymous ' f'+app_update {app_id} validate +quit' ) subprocess.run(command, shell=True, check=True) print("Steam download started.") except subprocess.CalledProcessError as e: print(f"Failed to start the download: {e}") def pause_steam_download(): print("Pausing Steam download...") time.sleep(2) x_coord = 1819 y_coord = 359 pyautogui.click(x_coord, y_coord) print(f"Clicked pause at coordinates ({x_coord}, {y_coord}). Steam download paused.") def schedule_tasks(app_id): schedule.every().day.at("09:17").do(lambda: connect_to_wifi()) schedule.every().day.at("09:17").do(lambda: start_steam_download(app_id)) schedule.every().day.at("09:19").do(lambda: pause_steam_download()) print("Tasks scheduled") if __name__ == "__main__": game_name = input("Enter the game name: ") app_id = get_steam_app_id(game_name) if app_id: schedule_tasks(app_id) while True: schedule.run_pending() time.sleep(5) else: print("Unable to schedule tasks without a valid app ID.") </code>
import schedule
import subprocess
import pyautogui
import time
import requests


def get_steam_app_id(game_name):
    search_url = f"https://store.steampowered.com/api/storesearch/?term={game_name}&cc=us"
    try:
        response = requests.get(search_url)
        response.raise_for_status()
        results = response.json().get('items', [])
        if results:
            first_result = results[0]
            app_id = first_result.get('id')
            game_title = first_result.get('name')
            print(f"Found '{game_title}' with app ID: {app_id}")
            return app_id
        else:
            print(f"No results found for {game_name}.")
            return None
    except requests.RequestException as e:
        print(f"Error fetching app ID: {e}")
        return None


def connect_to_wifi():
    wifi_name = "your wifi name"
    try:
        subprocess.run(f'netsh wlan connect name="{wifi_name}"', check=True, shell=True)
        print(f"Connected to {wifi_name}")
    except subprocess.CalledProcessError as e:
        print(f"Failed to connect to {wifi_name}: {e}")


def start_steam_download(app_id):
    try:
        print(f"Starting Steam download for app ID: {app_id}...")
        command = (
            'C:\steamcmd\steamcmd +login anonymous '
            f'+app_update {app_id} validate +quit'
        )
        subprocess.run(command, shell=True, check=True)
        print("Steam download started.")
    except subprocess.CalledProcessError as e:
        print(f"Failed to start the download: {e}")


def pause_steam_download():
    print("Pausing Steam download...")
    time.sleep(2)
    x_coord = 1819
    y_coord = 359
    pyautogui.click(x_coord, y_coord)
    print(f"Clicked pause at coordinates ({x_coord}, {y_coord}). Steam download paused.")



def schedule_tasks(app_id):
    schedule.every().day.at("09:17").do(lambda: connect_to_wifi())
    schedule.every().day.at("09:17").do(lambda: start_steam_download(app_id))
    schedule.every().day.at("09:19").do(lambda: pause_steam_download())
    print("Tasks scheduled")


if __name__ == "__main__":
    game_name = input("Enter the game name: ")
    app_id = get_steam_app_id(game_name)

    if app_id:
        schedule_tasks(app_id)
        while True:
            schedule.run_pending()
            time.sleep(5)
    else:
        print("Unable to schedule tasks without a valid app ID.")

tried reinstalling steam cmd i was expecting it to connect to the Wi-Fi provided and then start the download to then stop the download with the coordinates given to pyautogui

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật