yxmiler commited on
Commit
1536dc4
·
verified ·
1 Parent(s): 589d0de

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +7 -1
index.js CHANGED
@@ -47,7 +47,7 @@ const CONFIG = {
47
  SSO_INDEX: 0,//sso的索引
48
  TEMP_COOKIE_INDEX: 0,//临时cookie的下标
49
  ISSHOW_SEARCH_RESULTS: process.env.ISSHOW_SEARCH_RESULTS == undefined ? true : process.env.ISSHOW_SEARCH_RESULTS == 'true',//是否显示搜索结果
50
- CHROME_PATH: puppeteer.executablePath() || "/usr/bin/chromium"//chrome路径
51
  };
52
  puppeteer.use(StealthPlugin())
53
 
@@ -72,6 +72,12 @@ const DEFAULT_HEADERS = {
72
 
73
 
74
  async function initialization() {
 
 
 
 
 
 
75
  if (CONFIG.API.IS_CUSTOM_SSO) {
76
  if(CONFIG.API.IS_TEMP_GROK2){
77
  await tempCookieManager.ensureCookies();
 
47
  SSO_INDEX: 0,//sso的索引
48
  TEMP_COOKIE_INDEX: 0,//临时cookie的下标
49
  ISSHOW_SEARCH_RESULTS: process.env.ISSHOW_SEARCH_RESULTS == undefined ? true : process.env.ISSHOW_SEARCH_RESULTS == 'true',//是否显示搜索结果
50
+ CHROME_PATH: null
51
  };
52
  puppeteer.use(StealthPlugin())
53
 
 
72
 
73
 
74
  async function initialization() {
75
+ try {
76
+ CONFIG.CHROME_PATH = puppeteer.executablePath();
77
+ } catch (error) {
78
+ CONFIG.CHROME_PATH = "/usr/bin/chromium";
79
+ }
80
+ Logger.info(`CHROME_PATH: ${CONFIG.CHROME_PATH}`, 'Server');
81
  if (CONFIG.API.IS_CUSTOM_SSO) {
82
  if(CONFIG.API.IS_TEMP_GROK2){
83
  await tempCookieManager.ensureCookies();