Jared 2 年之前
父節點
當前提交
63f8058d32
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      choozmo/watch_yt.py

+ 5 - 5
choozmo/watch_yt.py

@@ -18,7 +18,7 @@ import time
 import traceback
 import sys
 import fire
-def init_browser(proxy1='proxy1',tiny1='tiny1',socks5="9050",debug='9922'):
+def init_browser(proxy1='proxy1',tiny1='tiny1',socks5="9050",debug='9922',cdriver=''):
     os.system('docker container restart '+proxy1)
     os.system('docker container restart '+tiny1)
 
@@ -39,7 +39,9 @@ def init_browser(proxy1='proxy1',tiny1='tiny1',socks5="9050",debug='9922'):
 
 #    options.add_argument("--user-agent=" +user_agent)
     options.add_argument("--incognito")
-    driver = webdriver.Chrome(executable_path=r'C:\portable\webdriver\chrome98\chromedriver.exe',options=options)
+#    driver = webdriver.Chrome(executable_path=r'C:\portable\webdriver\chrome98\chromedriver.exe',options=options)
+    driver = webdriver.Chrome(executable_path=cdriver,options=options)
+
 #    driver = webdriver.Chrome(executable_path=epath,options=options)
 
     driver.delete_all_cookies()
@@ -50,12 +52,10 @@ def init_browser(proxy1='proxy1',tiny1='tiny1',socks5="9050",debug='9922'):
 
 
 
-
-
 class JParams(object):
 
   def get(self, yt,proxy1,tiny1,socks5,debug):
-    driver=init_browser(proxy1='proxy1',tiny1='tiny1',socks5="9050",debug='9922')
+    driver=init_browser(proxy1='proxy1',tiny1='tiny1',socks5="9050",debug='9922',cdriver='/root/webdriver/98/chromedriver')
     #driver.get('https://www.youtube.com/watch?v=K5DEJXajtqA')
     driver.get('https://www.youtube.com/watch?v='+yt)