jarun / buku

:bookmark: Personal mini-web in text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot add a certain bookmark (ReadTimeoutError)

jarun opened this issue · comments

commented

Adding bookmarks from embedded.com fails all the time (tested with master):

$ buku -g -a www.embedded.com/flash-101-nand-flash-vs-nor-flash/
[DEBUG] buku v4.8
[DEBUG] Python v3.10.12
[DEBUG] netloc: www.embedded.com
[DEBUG] Starting new HTTP connection (1): www.embedded.com:80
[DEBUG] Incremented Retry for (url='/flash-101-nand-flash-vs-nor-flash/'): Retry(total=9, connect=None, read=None, redirect=10, status=None)
[WARNING] Retrying (Retry(total=9, connect=None, read=None, redirect=10, status=None)) after connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='www.embedded.com', port=80): Read timed out. (read timeout=15)")': /flash-101-nand-flash-vs-nor-flash/
[DEBUG] Starting new HTTP connection (2): www.embedded.com:80
[DEBUG] Incremented Retry for (url='/flash-101-nand-flash-vs-nor-flash/'): Retry(total=8, connect=None, read=None, redirect=10, status=None)
[WARNING] Retrying (Retry(total=8, connect=None, read=None, redirect=10, status=None)) after connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='www.embedded.com', port=80): Read timed out. (read timeout=15)")': /flash-101-nand-flash-vs-nor-flash/
[DEBUG] Starting new HTTP connection (3): www.embedded.com:80
[DEBUG] Incremented Retry for (url='/flash-101-nand-flash-vs-nor-flash/'): Retry(total=7, connect=None, read=None, redirect=10, status=None)
[WARNING] Retrying (Retry(total=7, connect=None, read=None, redirect=10, status=None)) after connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='www.embedded.com', port=80): Read timed out. (read timeout=15)")': /flash-101-nand-flash-vs-nor-flash/
[DEBUG] Starting new HTTP connection (4): www.embedded.com:80
^C
Interrupted.
$ buku -g -a https://www.embedded.com/flash-101-the-nand-flash-electrical-interface/
[DEBUG] buku v4.8
[DEBUG] Python v3.10.12
[DEBUG] netloc: www.embedded.com
[DEBUG] Starting new HTTPS connection (1): www.embedded.com:443
[DEBUG] Incremented Retry for (url='/flash-101-the-nand-flash-electrical-interface/'): Retry(total=9, connect=None, read=None, redirect=10, status=None)
[WARNING] Retrying (Retry(total=9, connect=None, read=None, redirect=10, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='www.embedded.com', port=443): Read timed out. (read timeout=15)")': /flash-101-the-nand-flash-electrical-interface/
[DEBUG] Starting new HTTPS connection (2): www.embedded.com:443
[DEBUG] Incremented Retry for (url='/flash-101-the-nand-flash-electrical-interface/'): Retry(total=8, connect=None, read=None, redirect=10, status=None)
[WARNING] Retrying (Retry(total=8, connect=None, read=None, redirect=10, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='www.embedded.com', port=443): Read timed out. (read timeout=15)")': /flash-101-the-nand-flash-electrical-interface/
[DEBUG] Starting new HTTPS connection (3): www.embedded.com:443
[DEBUG] Incremented Retry for (url='/flash-101-the-nand-flash-electrical-interface/'): Retry(total=7, connect=None, read=None, redirect=10, status=None)
[WARNING] Retrying (Retry(total=7, connect=None, read=None, redirect=10, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='www.embedded.com', port=443): Read timed out. (read timeout=15)")': /flash-101-the-nand-flash-electrical-interface/
[DEBUG] Starting new HTTPS connection (4): www.embedded.com:443
^C
Interrupted.

@LeXofLeviafan check this out if you have some time.

The site itself has connection issues:

  • Firefox: may refuse to load with transfer status NS_ERROR_NET_INTERRUPT (especially when accessing via VPN)
  • Chrome: completely inaccessible (for me) with status ERR_HTTP2_PROTOCOL_ERROR
  • Vivaldi: same result as Chrome but only when the site doesn't load in Firefox as well (…for some reason)
  • wget: permanently hangs after printing HTTP request sent, awaiting response...
  • curl: halts immediately with an error message saying (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2)

My best guess is that they have rather quirky security setup on their server.

I'd suggest implementing fallback behaviour for cases when the URL cannot be accessed (like prompting the user for bookmark title instead, or defaulting to the URL/empty string as the title). Also maybe don't try to load the page in the first place when both --title and --comment are supplied (and/or have an option to disable automatic fetch altogether, e.g. --offline); at the moment even supplying --immutable 1 doesn't prevent Buku from trying to access the URL passed to --add.

commented

I agree, an offline method is the best possible option.

commented

Implemented offline bookmark addition support at commit 0a526f0.