Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetch missing SSL certificates #4478

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

milahu
Copy link

@milahu milahu commented Jun 1, 2024

fix #4469

based on danilobellini/aia#3

@CLAassistant
Copy link

CLAassistant commented Jun 1, 2024

CLA assistant check
All committers have signed the CLA.

@pep8speaks
Copy link

pep8speaks commented Jun 1, 2024

Hello @milahu! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 121:89: E501 line too long (96 > 88 characters)

We recommend to use black to automatically correct these files.

Comment last updated at 2024-06-16 09:25:18 UTC

@milahu milahu force-pushed the fetch-missing-ssl-certs branch 2 times, most recently from 4441638 to 5ec8b38 Compare June 2, 2024 19:56
@milahu
Copy link
Author

milahu commented Jun 2, 2024

mmkay. works for me

tests

missing root certs are rare, so this is not-yet implemented in the webui
when pyload finds a missing root cert, the cert is saved to
~/.pyload2/cache/untrusted-root-certs/
to trust that root cert, it must be moved to
~/.pyload2/settings/trusted-root-certs/
and pyload must be restarted

todo: remove debug prints

this error is probably not caused by my changes
the request succeeds on retry

  File "pyload/core/network/http/http_request.py", line 236, in set_request_context
    self.c.setopt(pycurl.URL, url)
pycurl.error: cannot invoke setopt() - perform() is currently running
[2024-06-05 18:51:15]  DEBUG               pyload  ADDON AntiCaptcha: LOAD URL https://api.anti-captcha.com/createTask | get={} | post={"clientKey": "xxx", "softId": 976, "task": xxx | ref=True | cookies=True | just_header=False | decode=True | multipart=False | redirect=True | req=None
Exception in thread Thread-46:
Traceback (most recent call last):
  File "/nix/store/k3701zl6gmx3la7y4dnflcvf3xfy88kh-python3-3.11.9/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "/nix/store/qi6lvjl6i1hiwp9r5fbinnia0nwj3rap-pyload-0.5.0b3.dev82-unstable/lib/python3.11/site-packages/pyload/core/threads/addon_thread.py", line 61, in run
    self.f(*self.args, **self.kwargs)
  File "/nix/store/qi6lvjl6i1hiwp9r5fbinnia0nwj3rap-pyload-0.5.0b3.dev82-unstable/lib/python3.11/site-packages/pyload/plugins/addons/AntiCaptcha.py", line 96, in _process_captcha
    api_data = self.api_request(
               ^^^^^^^^^^^^^^^^^
  File "/nix/store/qi6lvjl6i1hiwp9r5fbinnia0nwj3rap-pyload-0.5.0b3.dev82-unstable/lib/python3.11/site-packages/pyload/plugins/addons/AntiCaptcha.py", line 65, in api_request
    json_data = self.load(self.API_URL + method, post=json.dumps(post))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/qi6lvjl6i1hiwp9r5fbinnia0nwj3rap-pyload-0.5.0b3.dev82-unstable/lib/python3.11/site-packages/pyload/plugins/base/plugin.py", line 217, in load
    html = req.load(
           ^^^^^^^^^
  File "/nix/store/qi6lvjl6i1hiwp9r5fbinnia0nwj3rap-pyload-0.5.0b3.dev82-unstable/lib/python3.11/site-packages/pyload/core/network/browser.py", line 128, in load
    return self.http.load(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/qi6lvjl6i1hiwp9r5fbinnia0nwj3rap-pyload-0.5.0b3.dev82-unstable/lib/python3.11/site-packages/pyload/core/network/http/aia_retry_wrap_download.py", line 27, in download_wrapper_aia_retry
    return download(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/qi6lvjl6i1hiwp9r5fbinnia0nwj3rap-pyload-0.5.0b3.dev82-unstable/lib/python3.11/site-packages/pyload/core/network/http/http_request.py", line 307, in load
    self.set_request_context(url, get, post, referer, cookies, multipart, decode)
  File "/nix/store/qi6lvjl6i1hiwp9r5fbinnia0nwj3rap-pyload-0.5.0b3.dev82-unstable/lib/python3.11/site-packages/pyload/core/network/http/http_request.py", line 236, in set_request_context
    self.c.setopt(pycurl.URL, url)
pycurl.error: cannot invoke setopt() - perform() is currently running

@vuolter
Copy link
Contributor

vuolter commented Jun 15, 2024

Hi @milahu thanks for the pr!
I see some commits not related to the ssl issue you targeted, could you pls check them all again? thx.

fix curl error:

curl: (60) SSL certificate problem: unable to get local issuer certificate
@milahu
Copy link
Author

milahu commented Jun 16, 2024

done. should i squash this into one commit?

there are still some debug prints
which should be removed or converted to log.debug calls ...
feel free to help ^^
currently im more worried about fixing #3899

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

fetch missing SSL certificates to fix curl error: unable to get local issuer certificate
4 participants