Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 07-17-2017, 02:03 PM   #1
julio:map
Member
julio:map began at the beginning.
 
Posts: 23
Karma: 12
Join Date: Jul 2011
Device: Cool-er
Pocket recipe stopped working?

Since a few days ago, my pocket recipe has stopped working.

I see some comments in the get_textview function definition:
"This function will break when pocket hates us"
I'm afraid, it has started to hate us now ;-)

I follow the function, and see a first lookup of a page...
soup = self.index_to_soup(url)

But the page returned (which I have seen "prettified"), seems as if the browser from which it is taken was not logged in...
And thus...
fc_tag = soup.find('script', text=re.compile("formCheck"))
...returns None, because the browser it is taken from is not logged in...
...and the rest of the recipe fails.

When I try to get on my Firefox browser the exact same URL, it returns a page with a formCheck inside a script. (so the recipe is well constructed, but not logged in at this point).

Can somebody help?
julio:map is offline   Reply With Quote
Old 07-17-2017, 02:14 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,857
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The login for all recipes happens in get_browser() so look at that function. Probably it needs to be updated.
kovidgoyal is offline   Reply With Quote
Old 07-17-2017, 05:08 PM   #3
julio:map
Member
julio:map began at the beginning.
 
Posts: 23
Karma: 12
Join Date: Jul 2011
Device: Cool-er
Quote:
Originally Posted by kovidgoyal View Post
The login for all recipes happens in get_browser() so look at that function. Probably it needs to be updated.
Thanks for your help.

get_browser does in fact login well.

The overall purpose of the recipe (pocket) formerly called "read it later" is to retrieve a set of articles that you have marked for later reading when navigating through internet, and build an ebook with them.

Well.. The list of articles collected for retrieving by the recipe is "my" list, so it has logged in correctly and retrieved the list of articles corresponding to the logged in user.

But when the recipe tries to retrieve each of those articles, using get_obfuscated_article, which in turn calls get_textview... it seems to have been logged out. (maybe, based on the comments of the author of the recipe, it has used an outdated mechanism of login in, and it has stopped working)

Maybe the problem is only with "my" user, or the specific list of articles I have tested for retrieving.

Surprisingly the author was expecting this to happen at some point of time.
julio:map is offline   Reply With Quote
Old 07-17-2017, 11:03 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,857
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Sorry I dont have any more insight to offer, as I dont use this recipe, you will need to contact the author.
kovidgoyal is offline   Reply With Quote
Old 07-18-2017, 05:01 AM   #5
Luzandro
Junior Member
Luzandro began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jul 2017
Device: Kindle v4
No, it's not just you. The problem seems to be in get_textview where the structure of the pocket site has changed and the search for formCheck doesn't work anymore. The value still does exist, it's just called a little bit different (hidden input field called "form_check"), so I've changed the code a little bit to extract it, but I still only get this return from Pocket:
Code:
{u'status': 0, u'error': 1}
So maybe as the author has expected the old API finally broke altogether
Luzandro is offline   Reply With Quote
Old 07-18-2017, 04:03 PM   #6
julio:map
Member
julio:map began at the beginning.
 
Posts: 23
Karma: 12
Join Date: Jul 2011
Device: Cool-er
Workaround

Solved.

The problem: Getpocket uses a variation of oAuth to authenticate. The authentication process is quite complex, so the author of the recipe decided to use an alternative method with an old URL that admitted user/password authentication. This alternative old URL has stopped working.

The solution: Either hours of programming, including a request for a special key which should be made by the author of the recipe, or...

The workaround: Get an instapaper account. There is a recipe for instapaper that works like a charm.

Lessons learned: Never ever block your legitimate users.
julio:map is offline   Reply With Quote
Old 07-25-2017, 01:48 AM   #7
Luzandro
Junior Member
Luzandro began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jul 2017
Device: Kindle v4
Actually oAuth isn't really the main problem. For one you can still login and get the list of your articles, but more importantly even with oAuth you couldn't get the full articles by using the public API as this is only allowed for selected partners
https://getpocket.com/developer/docs/v3/article-view

Therefore the author chose to mimic the ajax requests the browser makes when using the site on the desktop
Luzandro is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pagina/12 Recipe Stopped working macpablus Recipes 0 11-18-2016 10:20 PM
Boston Globe recipe has stopped working NSILMike Recipes 3 10-16-2012 04:22 PM
Built in recipe for Ottawa Citizen stopped working sylviebi Recipes 3 08-14-2012 05:48 PM
Men's Health Recipe has stopped working Syzygus Recipes 0 08-15-2011 05:22 AM
Guardian Recipe has stopped working jbambridge Calibre 2 04-11-2010 01:14 PM


All times are GMT -4. The time now is 02:06 AM.


MobileRead.com is a privately owned, operated and funded community.