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

[feature] Allow manually entering the URL on non-GUI environments #2

Open
michaelkrieger opened this issue Mar 10, 2023 · 0 comments
Open

Comments

@michaelkrieger
Copy link

The current workflow launches a web browser and then monitors the clipboard. If the web browser exits, it tries to read the data from the clipboard. Running from X, that's a non-issue.

That said, Python's webbrowser class supports text-based browsers and will bring up the search results in Lynx or similar. They look like this, with the URLs with no HTTPS:// before them.

   1.  "Title"
       Title 4.41 2,390 ratings401
       Title Continued
       www.goodreads.com/book/show/1234576-title-title

   2.  Title - Audiobook - Audible.com
       Title by Author - Audiobook - Audible.com Browse Sample "Title
       By: Author Narrated by: Author Length: 17 hrs and 31 mins
   4.9 (380 ratings) Try for $0.00 1 title per month from Audible's entire catalog of best sellers, and new releases.
       www.audible.com/pd/Title/H0H0H0H0

However a copy/paste mechanism isn't implemented at the console, so it errors out with this error:

Traceback (most recent call last):
  File "BadaBoomBooks-main/BadaBoomBooks.py", line 217, in <module>
    config = clipboard_queue(folder, config)
  File "BadaBoomBooks-main/BadaBoomBooks.py", line 142, in clipboard_queue
    clipboard_old = pyperclip.paste()
  File ".local/lib/python3.9/site-packages/pyperclip/__init__.py", line 681, in lazy_load_stub_paste
    return paste()
  File ".local/lib/python3.9/site-packages/pyperclip/__init__.py", line 336, in __call__
    raise PyperclipException(EXCEPT_MSG)
pyperclip.PyperclipException: 
    Pyperclip could not find a copy/paste mechanism for your system.
    For more information, please visit https://pyperclip.readthedocs.io/en/latest/index.html#not-implemented-error 

If the error from clipboard_queue was caught and a simple prompt added ("What was the URL?"), and we could use a terminal (Putty/SecureCRT/etc) and do a typical copy/paste, with BadaBoomBooks adding the https:// appropriately, it would make this product work in the terminal/console without a GUI.

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

No branches or pull requests

1 participant