linuxserver / docker-pyload-ng

GNU General Public License v3.0
79 stars 10 forks source link

Add Python plugin passlib #17

Closed marapavelka closed 1 year ago

marapavelka commented 1 year ago

linuxserver.io


Desired Behavior

Integrated passlib plugin to make the WebshareCz account work by default.

Current Behavior

When I add the WebshareCz account and log in, the account status is invalid and I can't use it. I see this in the log:

[2022-11-16 10:58:14]  INFO                pyload  ACCOUNT WebshareCz: Adding user `Tro*******`...
[2022-11-16 10:58:14]  DEBUG               pyload  ACCOUNT WebshareCz: Reached login timeout for user `Tro****`
[2022-11-16 10:58:14]  INFO                pyload  ACCOUNT WebshareCz: Login user `Tro****`...
[2022-11-16 10:58:14]  DEBUG               pyload  ACCOUNT WebshareCz: LOAD URL https://webshare.cz/api/salt/ | get={} | post={'username_or_email': 'Tro****'} | ref=True | cookies=True | just_header=False | decode=True | multipart=False | redirect=True | req=None
[2022-11-16 10:58:14]  ERROR               pyload  ACCOUNT WebshareCz: Could not login user `Tro****` | name 'passlib' is not defined
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/pyload/plugins/base/account.py", line 135, in login
    self.signin(self.user, self.info["login"]["password"], self.info["data"])
  File "/usr/lib/python3.9/site-packages/pyload/plugins/accounts/WebshareCz.py", line 63, in signin
    password = hashlib.sha1(passlib.hash.md5_crypt.encrypt(password, salt=salt).encode()).hexdigest()
NameError: name 'passlib' is not defined

Alternatives Considered

I have to run pip install passlib via the Portainer console and restart pyLoad to get the account working. But I have to do this after every container update.

github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

aptalca commented 1 year ago

You can use this https://github.com/linuxserver/docker-mods/tree/universal-package-install

marapavelka commented 1 year ago

Thank you very much for the advice, it works!