You've already forked Douyin_Web_Live
update
This commit is contained in:
BIN
scripts/__pycache__/webdriver.cpython-39.pyc
Normal file
BIN
scripts/__pycache__/webdriver.cpython-39.pyc
Normal file
Binary file not shown.
13
scripts/mitmproxy.py
Normal file
13
scripts/mitmproxy.py
Normal 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()]
|
13
scripts/webdriver.py
Normal file
13
scripts/webdriver.py
Normal file
@ -0,0 +1,13 @@
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.chrome.options import Options
|
||||
|
||||
def lunch():
|
||||
chrome_options = Options()
|
||||
chrome_options.add_argument('--proxy-server=127.0.0.1:8080')
|
||||
chrome_options.add_argument('--headless')
|
||||
chrome_options.add_experimental_option('detach', True)
|
||||
|
||||
driver = webdriver.Chrome(options=chrome_options)
|
||||
|
||||
driver.get('https://live.douyin.com/515848215303')
|
||||
|
Reference in New Issue
Block a user