This repository has been archived on 2024-09-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Douyin_Web_Live/scripts/mitmproxy.py
T
2021-11-30 20:33:32 +08:00

16 lines
452 B
Python

# ! IMPORT ! make sure you ran mitmproxy with this script,
# eg: `/path/to/mitmproxy -s mitmproxy.py`
import uuid
from mitmproxy import http
from config.helper import config
class Writer:
def response(self, flow: http.HTTPFlow) -> None:
if flow.request.host == 'live.douyin.com':
with open(config().mitmproxy.log_dir + uuid.uuid4().hex, 'wb') as f:
f.write(bytes(flow.response.content))
addons = [Writer()]