Quote:
Originally Posted by jens32
@loureiro Problem is the same with the adaption in the get_browser method.
Now I am always getting an Error Code 400, no matter what version of the get_browser method I am using:
PHP Code:
File "/tmp/calibre_0.8.2_tmp_EKxFgD/calibre_0.8.2_APXqCL_recipes/recipe0.py", line 57, in article_downloaded
br.open(self.mark_as_read_url, fields)
File "site-packages/mechanize/_opener.py", line 204, in open
File "site-packages/mechanize/_urllib2_fork.py", line 457, in http_response
File "site-packages/mechanize/_opener.py", line 227, in error
File "site-packages/mechanize/_urllib2_fork.py", line 332, in _call_chain
File "site-packages/mechanize/_urllib2_fork.py", line 477, in http_error_default
HTTPError: HTTP Error 400: Bad Request
Recipes run fine if there is no custom article_downloaded method.
Shouldn't have the id argument have a format like tag:google.com,2005:reader/item/041fa4grw5de72c9 when marking the article read? I can't find any id like this.
|
using "my version" of get_browser try changing this:
Code:
def article_downloaded(self, request, result):
br = self.browser
req = self.build_request(self.mark_as_read_url)
if not result[2]:
# Mark article as downloaded.
article = request.article
fields = urllib.urlencode([("i", article.id), ("a", "user/-/state/com.google/read"),
("ac", "edit-tags"), ("T", self.token)])
br.open(self.mark_as_read_url, fields)
return BasicNewsRecipe.article_downloaded(self, request, result)
to this:
Code:
def article_downloaded(self, request, result):
br = mybr # <----
req = self.build_request(self.mark_as_read_url)
if not result[2]:
# Mark article as downloaded.
article = request.article
fields = urllib.urlencode([("i", article.id), ("a", "user/-/state/com.google/read"),
("ac", "edit-tags"), ("T", self.token)])
br.open(self.mark_as_read_url, fields)
return BasicNewsRecipe.article_downloaded(self, request, result)