dicking about with bash again

This commit is contained in:
Zergling_man 2022-10-18 07:54:13 +11:00
parent e3623002f4
commit eea96b6b2f
4 changed files with 30 additions and 9 deletions

3
api.py
View File

@ -19,7 +19,8 @@ urls['start_study']='/study/conf.php'
urls['time_items']='/study/time_item.php' urls['time_items']='/study/time_item.php'
def get(url=None,params={},headers={},*args,**kwargs): def get(url=None,params={},headers={},*args,**kwargs):
return r.get(urls['base']+urls[url],params={'P':conf.p}|params, headers={'User-Agent':uagent()}|headers,*args,**kwargs) pp={'P':conf.p} if conf.p else {}
return r.get(urls['base']+urls[url],params=pp|params, headers={'User-Agent':uagent()}|headers,*args,**kwargs)
def post(url,stuff,params={},headers={},*args,**kwargs): def post(url,stuff,params={},headers={},*args,**kwargs):
return r.post(urls['base']+urls[url], data=stuff, params={'P':conf.p}|params, headers={'User-Agent':uagent()}|headers,*args,**kwargs) return r.post(urls['base']+urls[url], data=stuff, params={'P':conf.p}|params, headers={'User-Agent':uagent()}|headers,*args,**kwargs)

View File

@ -5,6 +5,8 @@ from cryptography.hazmat.primitives.padding import PKCS7
from cryptography.hazmat.backends import default_backend from cryptography.hazmat.backends import default_backend
backend=default_backend() backend=default_backend()
p=''
import json import json
with open('conf.json') as b: with open('conf.json') as b:
conf=json.load(b) conf=json.load(b)

18
main.py
View File

@ -1,16 +1,18 @@
import api import api
from dataclasses import dataclass
@dataclass
class Player(): class Player():
def __init__(self): id:int
self.id=-1 name:str
self.name=None level:int=0
self.level=0 myroids:List(Myroid)=#[]
self.myroids=[]
@dataclass
class Myroid(): class Myroid():
self.id=-1 id:int
self.name=None name:str
self.outfit={} outfit:list(Clothing)={}
a=api.top() a=api.top()
b=api.login('P-val needs adding','user','pass') b=api.login('P-val needs adding','user','pass')

16
recycle1.sh Normal file
View File

@ -0,0 +1,16 @@
source conf.sh
nums=$(curl -H "User-Agent: $UA" https://us-moe-app.amz-aws.jp/recycle/aimi_change_list.php?P=$p | grep -Eo '/ [0-9]<input type="hidden" name="item_id[0-9]" value="[^"]*"' | grep -Eo '[0-9]*')
out=
i=0
while read num; do
if [ $i -eq 0 ]; then stage="=$((num-1))"; fi
if [ $i -eq 1 ]; then stage="-F num$num$stage -F item_id$num="; fi
if [ $i -eq 2 ]; then out="$out $stage$num"; fi
i=$(( (i+1)%3 ))
done <<< "$nums"
curl -H "User-Agent: $UA" https://us-moe-app.amz-aws.jp/recycle/aimi_change_check.php?P=$p $out -F page=0 -F sel_num=6
curl -H "User-Agent: $UA" https://us-moe-app.amz-aws.jp/recycle/aimi_change_conf.php -F P=$p $out -F sel_num=6