Update mitmproxy.py

This commit is contained in:
耿伦伦 2021-11-30 20:35:44 +08:00 committed by GitHub
parent 718c67eddf
commit 07bf767f3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,12 +4,10 @@
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:
with open('/Users/geng/douyin_live/' + uuid.uuid4().hex, 'wb') as f:
f.write(bytes(flow.response.content))
addons = [Writer()]