speric / kindle-highlights

Get your Kindle highlights.
https://rubygems.org/gems/kindle-highlights
MIT License
572 stars 51 forks source link

Nothing downloaded and no error message #21

Open woopla opened 6 years ago

woopla commented 6 years ago

Hello,

I'm modifying this script to work with v2.0.1 of kindle-highlights, but nothing happens. I've got a small test script, and it returns a book count of 0:

require 'kindle_highlights'
require 'htmlentities'

html = HTMLEntities.new
kindle = KindleHighlights::Client.new(email_address: ENV["AMAZON_USER"],
                                          password: ENV["AMAZON_PASS"])
@highlights = []

p kindle.books.count

kindle.books.each do |book|
    kindle.highlights_for(book.asin).each do |highlight|
        highlight["book"] = html.decode(book.title)
        highlight["highlight"] = html.decode(highlight["highlight"])
        @highlights << highlight
    end
end

p @highlights

I'm 100% that my Amazon email and password are correct. I ran the login + book count part in irb, no error is returned there.

Do you know if Amazon made further changes?

Thanks,

Clement

speric commented 6 years ago

@woopla I used the gem to fetch highlights this morning, with no issues.

Does your Kindle account show that you have highlights saved?

woopla commented 6 years ago

@speric the highlights are plentiful, yes 😸 It was actually working fine until Amazon changed their login page and you had to change your code.

There's no "debug mode that's super verbose" in your library, right? I'll look into debugging this on my end later this week.

woopla commented 6 years ago

OK, found the problem. Mechanize hits a page "Please confirm your identity". I've opened PR #22, any code feedback welcome, it's my first contrib to a Ruby project 😄