dicking about with bash again
This commit is contained in:
parent
e3623002f4
commit
eea96b6b2f
3
api.py
3
api.py
|
@ -19,7 +19,8 @@ urls['start_study']='/study/conf.php'
|
|||
urls['time_items']='/study/time_item.php'
|
||||
|
||||
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):
|
||||
return r.post(urls['base']+urls[url], data=stuff, params={'P':conf.p}|params, headers={'User-Agent':uagent()}|headers,*args,**kwargs)
|
||||
|
|
2
conf.py
2
conf.py
|
@ -5,6 +5,8 @@ from cryptography.hazmat.primitives.padding import PKCS7
|
|||
from cryptography.hazmat.backends import default_backend
|
||||
backend=default_backend()
|
||||
|
||||
p=''
|
||||
|
||||
import json
|
||||
with open('conf.json') as b:
|
||||
conf=json.load(b)
|
||||
|
|
18
main.py
18
main.py
|
@ -1,16 +1,18 @@
|
|||
import api
|
||||
from dataclasses import dataclass
|
||||
|
||||
@dataclass
|
||||
class Player():
|
||||
def __init__(self):
|
||||
self.id=-1
|
||||
self.name=None
|
||||
self.level=0
|
||||
self.myroids=[]
|
||||
id:int
|
||||
name:str
|
||||
level:int=0
|
||||
myroids:List(Myroid)=#[]
|
||||
|
||||
@dataclass
|
||||
class Myroid():
|
||||
self.id=-1
|
||||
self.name=None
|
||||
self.outfit={}
|
||||
id:int
|
||||
name:str
|
||||
outfit:list(Clothing)={}
|
||||
|
||||
a=api.top()
|
||||
b=api.login('P-val needs adding','user','pass')
|
||||
|
|
16
recycle1.sh
Normal file
16
recycle1.sh
Normal 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
|
Loading…
Reference in New Issue
Block a user