Update mitmproxy.py
This commit is contained in:
parent
718c67eddf
commit
07bf767f3f
@ -4,12 +4,10 @@
|
|||||||
import uuid
|
import uuid
|
||||||
from mitmproxy import http
|
from mitmproxy import http
|
||||||
|
|
||||||
from config.helper import config
|
|
||||||
|
|
||||||
class Writer:
|
class Writer:
|
||||||
def response(self, flow: http.HTTPFlow) -> None:
|
def response(self, flow: http.HTTPFlow) -> None:
|
||||||
if flow.request.host == 'live.douyin.com':
|
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))
|
f.write(bytes(flow.response.content))
|
||||||
|
|
||||||
addons = [Writer()]
|
addons = [Writer()]
|
||||||
|
Reference in New Issue
Block a user