Closed Road-tech closed 1 year ago
已Merge。
不妨试试docker https://github.com/Road-tech/Docker_JableTVDownload在 2023年5月13日,上午12:07,澳诹科技 @.***> 写道: 换了一个版本 从新运行又报错 Traceback (most recent call last): File "main.py", line 26, in download(url) File "/volume2/shiyuan/Videos/JableTVDownload-main/download.py", line 40, in download dr = webdriver.Chrome(chrome_options=options) File "/var/packages/py3k/target/usr/local/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 82, in init service.path = DriverFinder.get_path(service, options) File "/var/packages/py3k/target/usr/local/lib/python3.8/site-packages/selenium/webdriver/common/driver_finder.py", line 40, in get_path path = shutil.which(service.path) or SeleniumManager().driver_location(options) File "/var/packages/py3k/target/usr/local/lib/python3.8/site-packages/selenium/webdriver/common/selenium_manager.py", line 91, in driver_location result = self.run(args) File "/var/packages/py3k/target/usr/local/lib/python3.8/site-packages/selenium/webdriver/common/selenium_manager.py", line 109, in run output = json.loads(stdout) File "/var/packages/py3k/target/usr/local/lib/python3.8/json/init.py", line 357, in loads return _default_decoder.decode(s) File "/var/packages/py3k/target/usr/local/lib/python3.8/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/var/packages/py3k/target/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
我测试使用的是ubuntu,直接运行脚本会出现类似的错误
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary
这是由于没有安装ChromeWebdriver导致的错误,可以通过手动修复,懒人可以通过以下命令安装:
由于使用服务器版本,缺少桌面环境,需要在download.py补充一些option 添加
from selenium.webdriver.chrome.options import Options
原改为
但是修改完依然有可能会出现错误
就是获取的网页内容里找不到m3u8链接,分析 dr.page_source网页内容,发现被CF盾拦住了。
百度一下可以发现,添加的
options.add_argument('--headless')
参数是触发CF盾的元凶,可以通过以下选项避免,然后就可以了,最终download.py代码如下:
以上