This commit is contained in:
耿伦伦
2021-11-30 16:41:23 +08:00
parent febaf8599a
commit c5a38f00ae
10 changed files with 98 additions and 20 deletions

13
scripts/mitmproxy.py Normal file
View File

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