mirror of
https://github.com/NanmiCoder/MediaCrawler.git
synced 2026-06-08 10:57:26 +08:00
refactor:优化部分代码
feat: 增加IP代理账号池
This commit is contained in:
2
config/__init__.py
Normal file
2
config/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from .base_config import *
|
||||
from .account_config import *
|
||||
27
config/account_config.py
Normal file
27
config/account_config.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# account_config.py
|
||||
|
||||
PHONE_LIST = [
|
||||
"13012345671",
|
||||
"13012345672",
|
||||
"13012345673",
|
||||
"13012345674",
|
||||
"13012345675",
|
||||
"13012345676",
|
||||
# ...
|
||||
]
|
||||
|
||||
IP_PROXY_LIST = [
|
||||
"111.122.xx.xx1:8888",
|
||||
"111.122.xx.xx2:8888",
|
||||
"111.122.xx.xx3:8888",
|
||||
"111.122.xx.xx4:8888",
|
||||
"111.122.xx.xx5:8888",
|
||||
"111.122.xx.xx6:8888",
|
||||
# ...
|
||||
]
|
||||
|
||||
IP_PROXY_PROTOCOL = "http://"
|
||||
IP_PROXY_USER = "xxxx"
|
||||
IP_PROXY_PASSWORD = "xxxx"
|
||||
|
||||
19
config/base_config.py
Normal file
19
config/base_config.py
Normal file
@@ -0,0 +1,19 @@
|
||||
PLATFORM = "xhs"
|
||||
KEYWORDS = "健身,旅游"
|
||||
LOGIN_TYPE = "qrcode" # qrcode or phone or cookies
|
||||
# If it's on the Xiaohongshu platform, only the web_session cookie will be kept.
|
||||
# xhs cookie format -> web_session=040069b2acxxxxxxxxxxxxxxxxxxxx;
|
||||
COOKIES = ""
|
||||
|
||||
# redis config
|
||||
REDIS_DB_HOST = "redis://127.0.0.1" # your redis host
|
||||
REDIS_DB_PWD = "123456" # your redis password
|
||||
|
||||
# enable ip proxy
|
||||
ENABLE_IP_PROXY = False
|
||||
|
||||
# retry_interval
|
||||
RETRY_INTERVAL = 60 * 30 # 30 minutes
|
||||
|
||||
# playwright headless
|
||||
HEADLESS = True
|
||||
Reference in New Issue
Block a user