Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7214149

Browse files
load cookies with browser-cookies3 and add requirements.txt
1 parent e4c0ae2 commit 7214149

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

‎README.md‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ For the latest Windows version of Idle Master, [click here](https://github.com/j
1212
Requirements
1313
-------
1414

15-
This application requires Steam to be open and for you to be logged in.
15+
This application requires the Steam desktop application to be open and for you to be logged in.
16+
17+
It will also require you to be logged in semi-recently on `steamcommunity.com` so it can read the cookies from the browser. It may also ask for an administrator password if it doesn't yet have access to your browser's storage.
18+
19+
Finally, you will need to install python dependencies with `pip3 install -r requirements.txt`.
1620

1721
Config
1822
-------
@@ -21,22 +25,13 @@ The configuration is read from `settings.json`.
2125

2226
```json
2327
{
24-
"sessionid": "",
25-
"steamLoginSecure": "",
26-
"steamparental": "",
2728
"sort": "",
2829
"delayPerCard": 5,
2930
"blacklist": [
3031
]
3132
}
3233
```
3334

34-
`sessionid` - Go to `chrome://settings/siteData` and search for `steamcommunity.com`. Fill in `sessionid` with the value of the `sessionid` cookie.
35-
36-
`steamLoginSecure` - Same as above.
37-
38-
`steamparental` (optional) - Same as above, only needed for some accounts.
39-
4035
`sort` (optional) - If specified, sorts the order in which the games are idled. Possible sort types are `mostcards`, which idles the games with the most card drops available first, and `leastcards`, which does the opposite.
4136

4237
`delayPerCard` - Amount of time per card, in minutes, to wait between querying for how many card drops are remaining for the game. For example, if the `delayPerCard` is set to `5`, it will check every twenty minutes if there are four card drops remaining.

‎requirements.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
requests>=2.20.1
2+
browser-cookie3>=0.6.4
3+
colorama>=0.3.9

‎start.py‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import requests
22
from bs4 import BeautifulSoup
3+
import browser_cookie3
34
import time
45
import re
56
import subprocess
@@ -36,11 +37,9 @@ def __init__(self, **settings):
3637
self.logger.info(Fore.GREEN + "WELCOME TO IDLE MASTER" + Fore.RESET)
3738

3839
self.session = requests.Session()
39-
self.session.cookies.set(name="steamLoginSecure", value=settings["steamLoginSecure"])
40-
self.session.cookies.set(name="sessionid", value=settings["sessionid"])
41-
self.session.cookies.set(name="steamparental", value=settings["steamparental"])
40+
self.session.cookies = browser_cookie3.load(domain_name='steamcommunity.com')
4241

43-
self.accountId = settings["steamLoginSecure"][:17]
42+
self.accountId = requests.utils.dict_from_cookiejar(self.session.cookies)["steamLoginSecure"][:17]
4443

4544
self.sort = settings["sort"]
4645
self.blacklist = settings["blacklist"]
@@ -154,7 +153,7 @@ def startIdling(self, game):
154153
self.child = subprocess.Popen(["./steam-idle", str(game.gameId)])
155154

156155
def stopIdling(self):
157-
self.logger.info(Fore.GREEN + "Killing Idle Master process" + Fore.RESET)
156+
self.logger.info(Fore.GREEN + "Killing steam-idle process" + Fore.RESET)
158157
self.child.terminate()
159158

160159

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /