mirror of
https://github.com/luzhisheng/js_reverse.git
synced 2025-04-20 01:34:55 +08:00
猿人学第7题-字体反爬
This commit is contained in:
parent
a9dcd36201
commit
e8ee2cb087
435
zy-rpc/match.yuanrenxue.com/match/7
Normal file
435
zy-rpc/match.yuanrenxue.com/match/7
Normal file
File diff suppressed because one or more lines are too long
BIN
猿人学第7题-字体反爬/font.ttf
Normal file
BIN
猿人学第7题-字体反爬/font.ttf
Normal file
Binary file not shown.
0
猿人学第7题-字体反爬/readme.md
Normal file
0
猿人学第7题-字体反爬/readme.md
Normal file
45
猿人学第7题-字体反爬/案例.py
Normal file
45
猿人学第7题-字体反爬/案例.py
Normal file
@ -0,0 +1,45 @@
|
||||
from urllib.parse import urlparse
|
||||
import requests
|
||||
import time
|
||||
import json
|
||||
import base64
|
||||
|
||||
|
||||
class App(object):
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def get_html(self, m, page):
|
||||
Headers = {
|
||||
"user-agent": "yuanrenxue.project",
|
||||
"cookie": m
|
||||
}
|
||||
url = f"https://match.yuanrenxue.com/api/match/7?page={page}"
|
||||
print(url)
|
||||
req = requests.get(url=url, headers=Headers)
|
||||
return json.loads(req.text)
|
||||
|
||||
def with_ttf(self, woff):
|
||||
b64_code = woff
|
||||
with open('font.ttf', 'wb') as f:
|
||||
f.write(base64.decodebytes(b64_code.encode()))
|
||||
|
||||
def run(self):
|
||||
data_sum = 0
|
||||
for page in range(1, 6):
|
||||
res = self.get_html("", page)
|
||||
woff = res.get('woff')
|
||||
self.with_ttf(woff)
|
||||
data_list = res.get('data')
|
||||
for data in data_list:
|
||||
print(data.get('value'))
|
||||
# data_sum += data.get('value')
|
||||
time.sleep(1)
|
||||
|
||||
print(data_sum)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = App()
|
||||
app.run()
|
Loading…
x
Reference in New Issue
Block a user