08-04-2019, 09:47 AM | #1 |
Big Poppa
Posts: 110
Karma: 10
Join Date: Jul 2010
Device: Nook
|
Times UK Failing right at recipe Download
On multiple machines it gets to either
Downloading recipe urn: custom:1005 on the windows app or Using downloaded builtin recipe on command line linux. and freezes. windows shows an error Code:
Python function terminated unexpectedly <urlopen error [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond> (Error Code: 1) Traceback (most recent call last): File "site.py", line 101, in main File "site.py", line 78, in run_entry_point File "site-packages\calibre\utils\ipc\worker.py", line 199, in main File "site-packages\calibre\gui2\convert\gui_conversion.py", line 35, in gui_convert_recipe File "site-packages\calibre\gui2\convert\gui_conversion.py", line 27, in gui_convert File "site-packages\calibre\ebooks\conversion\plumber.py", line 1106, in run File "site-packages\calibre\customize\conversion.py", line 244, in __call__ File "site-packages\calibre\ebooks\conversion\plugins\recipe_input.py", line 135, in convert File "site-packages\calibre\web\feeds\news.py", line 898, in __init__ File "<string>", line 86, in get_browser File "site-packages\mechanize\_mechanize.py", line 254, in open File "site-packages\mechanize\_mechanize.py", line 284, in _mech_open File "site-packages\mechanize\_opener.py", line 195, in open File "site-packages\mechanize\_urllib2_fork.py", line 352, in _open File "site-packages\mechanize\_urllib2_fork.py", line 340, in _call_chain File "site-packages\calibre\utils\browser.py", line 28, in https_open File "site-packages\mechanize\_urllib2_fork.py", line 1160, in do_open urllib2.URLError: <urlopen error [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond> |
08-04-2019, 10:35 AM | #2 |
creator of calibre
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That's an error originating at line 86 in the recipe. Not a failure to download the recipe
|
Advert | |
|
08-04-2019, 12:50 PM | #3 |
Big Poppa
Posts: 110
Karma: 10
Join Date: Jul 2010
Device: Nook
|
Weird. Kovid that is a simple login line to https://login.thetimes.co.uk/
Could you advise how to further troubleshoot? Curling that URL works fine for me. |
08-04-2019, 01:12 PM | #4 |
creator of calibre
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
most likely something is blocking calibre those often manifest as timeouts
|
08-04-2019, 02:57 PM | #5 |
Big Poppa
Posts: 110
Karma: 10
Join Date: Jul 2010
Device: Nook
|
|
Advert | |
|
08-05-2019, 12:12 AM | #6 |
creator of calibre
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I get a hang on line 89 not line 86 where the recipe is doing a POST. And you can use
br.set_debug_http(True) to get more detailed output about what is happening. |
08-05-2019, 01:35 PM | #7 |
Big Poppa
Posts: 110
Karma: 10
Join Date: Jul 2010
Device: Nook
|
Code:
def get_browser(self): USER_AGENT = 'Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0' br = BasicNewsRecipe.get_browser(self, user_agent=USER_AGENT) #br.set_debug_http(True) #br.set_debug_responses(True) br.set_debug_http(True) br.open(self.INDEX) if self.username is not None and self.password is not None: #data = {'login': self.username, 'password':self.password} data = dict(login=self.username,password=self.password) br.open(self.LOGIN, data) response = br.response() return br |
08-05-2019, 02:15 PM | #8 |
Big Poppa
Posts: 110
Karma: 10
Join Date: Jul 2010
Device: Nook
|
Weird, I can get it to post but still get error
Code:
Python function terminated unexpectedly <urlopen error [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond> (Error Code: 1) Traceback (most recent call last): File "site.py", line 101, in main File "site.py", line 78, in run_entry_point File "site-packages\calibre\utils\ipc\worker.py", line 199, in main File "site-packages\calibre\gui2\convert\gui_conversion.py", line 35, in gui_convert_recipe File "site-packages\calibre\gui2\convert\gui_conversion.py", line 27, in gui_convert File "site-packages\calibre\ebooks\conversion\plumber.py", line 1106, in run File "site-packages\calibre\customize\conversion.py", line 244, in __call__ File "site-packages\calibre\ebooks\conversion\plugins\recipe_input.py", line 135, in convert File "site-packages\calibre\web\feeds\news.py", line 898, in __init__ File "<string>", line 66, in get_browser File "site-packages\mechanize\_mechanize.py", line 254, in open File "site-packages\mechanize\_mechanize.py", line 284, in _mech_open File "site-packages\mechanize\_opener.py", line 195, in open File "site-packages\mechanize\_urllib2_fork.py", line 352, in _open File "site-packages\mechanize\_urllib2_fork.py", line 340, in _call_chain File "site-packages\calibre\utils\browser.py", line 28, in https_open File "site-packages\mechanize\_urllib2_fork.py", line 1160, in do_open urllib2.URLError: <urlopen error [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond> |
08-05-2019, 02:16 PM | #9 |
Big Poppa
Posts: 110
Karma: 10
Join Date: Jul 2010
Device: Nook
|
Code:
Sending login request... send: 'POST / HTTP/1.1\r\nAccept-Encoding: identity\r\nAccept-Language: en-US,en;q=0.8\r\nConnection: close\r\nAccept: text/html\r\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0\r\nCookie: nuk_customer_time_zone=GMT; nuk_customer_country_code=GB; nuk_customer_location_hint=UK\r\nContent-Length: 40\r\nContent-Type: application/x-www-form-urlencoded\r\nHost: login.thetimes.co.uk\r\nX-Http-Method-Override: POST\r\n\r\nlogin=times%40xxxxx.com&password=xxxxxxx' |
08-05-2019, 08:38 PM | #10 |
creator of calibre
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The POST is working with curl and not mechanize?
|
08-06-2019, 09:46 AM | #11 |
Big Poppa
Posts: 110
Karma: 10
Join Date: Jul 2010
Device: Nook
|
Strange. I tested just the GET of the page itself, but it's hanging on the POST itself. The manual CURL redirects via 302 then throws up an error with Akamai
Code:
< HTTP/1.1 411 Length Required < Server: AkamaiGHost Code:
-d "Content-Length: 108" |
08-06-2019, 09:56 AM | #12 |
Big Poppa
Posts: 110
Karma: 10
Join Date: Jul 2010
Device: Nook
|
fwiw the curl returns the 302 URL that has a valid token in it. the browser needs to return that or follow it directly to then authorize the session...
|
08-06-2019, 10:07 AM | #13 |
creator of calibre
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
turn off following redirects in the browser and manually get the token from the response headers in that case.
|
08-06-2019, 10:13 AM | #14 | |
Big Poppa
Posts: 110
Karma: 10
Join Date: Jul 2010
Device: Nook
|
Quote:
Code:
data = urlencode({ 'gotoUrl': self.INDEX, 's': 1, 'username': self.username, 'password': self.password}) geturl = br.open('https://login.thetimes.co.uk', data).geturl() |
|
08-06-2019, 10:17 AM | #15 |
creator of calibre
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
turn off following redirects and it wont hang. IIRC set_handle_redirect(False)
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
New Yorker recipe failing | adfadfsasdfafafd | Recipes | 2 | 03-28-2017 02:47 PM |
"The New York Times" recipe failing with error | mikebw | Recipes | 8 | 10-02-2015 05:48 PM |
New York Times Recipe failing to verify SSL Cert | Ramblurr | Recipes | 6 | 02-27-2015 04:31 AM |
download of wsj failing | amritsari | Calibre | 4 | 09-06-2012 05:53 PM |
Economist Recipe Failing... | awitko | Recipes | 2 | 11-06-2011 11:47 PM |