-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathupload.py
35 lines (30 loc) · 1005 Bytes
/
upload.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import os
from steam.client import SteamClient
from steam.enums import EResult
from steam.webapi import WebAPI
# Initialize Steam Web API
api_key = "your_steam_api_key"
api = WebAPI(key=api_key)
# Define the workshop item details
item = {
"title": "My Mod",
"description": "This is a description of my mod.",
"content_folder": "/path/to/your/mod/content",
"preview_image": "/path/to/your/preview/image.png",
"tags": ["Tag1", "Tag2"]
}
def upload_workshop_item(item):
# Create a new workshop item
response = api.ISteamRemoteStorage.CreatePublishedFile(
appid=your_app_id,
title=item["title"],
description=item["description"],
contentfolder=item["content_folder"],
previewfile=item["preview_image"],
tags=item["tags"]
)
if response["result"] == EResult.OK:
print("Workshop item uploaded successfully!")
else:
print(f"Failed to upload workshop item: {response['result']}")
upload_workshop_item(item)