Created
January 8, 2022 23:46
-
-
Save esibun/f0976d84a50aa9aa7dc133b648c6b7bf to your computer and use it in GitHub Desktop.
piu song item shop buyout script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from http import cookiejar | |
from pathlib import Path | |
import requests | |
import time | |
MEMBER_NUM = 0 # change me | |
cookies = Path('piugame.com_cookies.txt') | |
cj = cookiejar.MozillaCookieJar(cookies) | |
cj.load(ignore_discard=True, ignore_expires=True) | |
# make sure we send PHPSESSID so we're logged in properly | |
for cookie in cj: | |
if cookie.name == "PHPSESSID": | |
cookie.expires = time.time() + 9999 | |
sess = requests.Session() | |
sess.cookies = cj | |
r = sess.get('http://www.piugame.com/piu.xx/itemshop/xx_stepshop.php?item_prime_member_no=' + str(MEMBER_NUM)) | |
for line in r.text.split('\n'): | |
if "'Unlocking is possible'" in line: | |
linesplit = line.split("'") | |
# print(linesplit) | |
print("Buying item " + linesplit[17] + "...", end="") | |
sess.post('http://www.piugame.com/piu.xx/itemshop/piu.buy_item.php', data={ | |
"buy_item_no": linesplit[17], | |
"work_type": "buy_item", | |
"buy_prime_member_no": MEMBER_NUM, | |
"buy_item_type": linesplit[7] | |
}) | |
print("OK!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment