- Replace text=True with encoding='utf-8', errors='replace' in all subprocess.run calls (channels + cli.py) to fix GBK decode errors on Chinese Windows systems - Use shutil.which() resolved paths in channel subprocess calls to handle Windows .cmd wrappers (npm global installs) Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
This commit is contained in:
@@ -17,7 +17,8 @@ class LinkedInChannel(Channel):
|
||||
return "linkedin.com" in urlparse(url).netloc.lower()
|
||||
|
||||
def check(self, config=None):
|
||||
if not shutil.which("mcporter"):
|
||||
mcporter = shutil.which("mcporter")
|
||||
if not mcporter:
|
||||
return "off", (
|
||||
"基本内容可通过 Jina Reader 读取。完整功能需要:\n"
|
||||
" pip install linkedin-scraper-mcp\n"
|
||||
@@ -26,7 +27,8 @@ class LinkedInChannel(Channel):
|
||||
)
|
||||
try:
|
||||
r = subprocess.run(
|
||||
["mcporter", "config", "list"], capture_output=True, text=True, timeout=5
|
||||
[mcporter, "config", "list"], capture_output=True,
|
||||
encoding="utf-8", errors="replace", timeout=5
|
||||
)
|
||||
if "linkedin" in r.stdout.lower():
|
||||
return "ok", "完整可用(Profile、公司、职位搜索)"
|
||||
|
||||
Reference in New Issue
Block a user