wishlist icon indicating copy to clipboard operation
wishlist copied to clipboard

Can't authenticate

Open arbolis opened this issue 4 years ago • 1 comments

I installed wishlist with pip (using the --user parameter so the installation isn't system-wide, only local, i.e. for my user). I can successfully set the name of the (private) wishlist. However typing /home/arbolis/.local/bin/wishlist auth yields:

Traceback (most recent call last): File "/home/arbolis/.local/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 72, in start self.process = subprocess.Popen(cmd, env=self.env, File "/usr/lib/python3.8/subprocess.py", line 854, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/arbolis/.local/bin/wishlist", line 33, in sys.exit(load_entry_point('wishlist==0.5.3', 'console_scripts', 'wishlist')()) File "/home/arbolis/.local/lib/python3.8/site-packages/wishlist/main.py", line 110, in console exit(name) File "/home/arbolis/.local/lib/python3.8/site-packages/captain/init.py", line 41, in exit ret_code = s.run(raw_args) File "/home/arbolis/.local/lib/python3.8/site-packages/captain/init.py", line 176, in run ret_code = callback(*args, **kwargs) File "/home/arbolis/.local/lib/python3.8/site-packages/wishlist/main.py", line 17, in main_auth with Wishlist.authenticate() as b: File "/usr/lib/python3.8/contextlib.py", line 113, in enter return next(self.gen) File "/home/arbolis/.local/lib/python3.8/site-packages/wishlist/core.py", line 427, in authenticate with FullBrowser.session() as b: File "/usr/lib/python3.8/contextlib.py", line 113, in enter return next(self.gen) File "/home/arbolis/.local/lib/python3.8/site-packages/brow/interface/base.py", line 70, in session reraise(*exc_info) File "/home/arbolis/.local/lib/python3.8/site-packages/brow/compat.py", line 52, in reraise raise value File "/home/arbolis/.local/lib/python3.8/site-packages/brow/interface/base.py", line 60, in session instance = cls(options=options) File "/home/arbolis/.local/lib/python3.8/site-packages/brow/interface/base.py", line 77, in init self.interface = self.create_interface(options) File "/home/arbolis/.local/lib/python3.8/site-packages/brow/interface/base.py", line 154, in create_interface return self._create_interface(options=options) File "/home/arbolis/.local/lib/python3.8/site-packages/brow/interface/selenium.py", line 263, in _create_interface inter = webdriver.Firefox(firefox_options=opts) File "/home/arbolis/.local/lib/python3.8/site-packages/selenium/webdriver/firefox/webdriver.py", line 164, in init self.service.start() File "/home/arbolis/.local/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 81, in start raise WebDriverException( selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

I am not sure how to fix the problem. As a side question, is it possible to authenticate "programmatically"? I.e. I'd dump the credentials in a file.py that I would run, for example, instead of using the command line.

arbolis avatar Dec 01 '20 12:12 arbolis

Sorry for the incredibly late response.

The geckodriver installation is talked about here.

As for your other question:

As a side question, is it possible to authenticate "programmatically"? I.e. I'd dump the credentials in a file.py that I would run, for example, instead of using the command line.

I tried to make this as easy I could at the time but I'm not sure if the auth stuff even works anymore because the nice thing about Amazon is they almost never log you out.

The authentication to read a private wishlist is really just cookie based, so I've always wondered if you could actually just log in normally in a browser and then just grab all the amazon cookies and dump them in a file.

Brow has a cache directory (which can be customized using BROW_CACHE_DIR=<PATH>, otherwise I think it just uses system temp) and in that cache directory there is a cookie file named www.amazon.com.txt which is basically in the form (I think) of:

KEY
VALUE
KEY
VALUE
...

My cookie file has 393 lines and is what is being used to read the private wishlist.

So yes, you can probably completely bypass trying to authenticate, but it will take a little bit of manual work to get wishlist into the right state to be able to read your private wishlist.

Jaymon avatar Sep 08 '21 00:09 Jaymon