Quote:
Originally Posted by Pjama
Hoping someone can see what is going on in my plugin - sometimes it calls a magazine an ebook, maybe that is something to do with it?
It also does not like openbook = self.send_request(meta["urls"]["openbook"])
Could it maybe be looking for "openmagazine" in the square braces? Or maybe openbook on the left side of the assignment should be openmagazine?
Just putting it out there, as do not know the code behind all this.
|
No, openbook is correct.
When you download a magazine it sends a request to overdrive and you should get a response that looks like
Code:
{
"urls": {
"web": "https://dewey-c5a399a962cbe1bfd566f164d6158f5d.read.libbyshelf.com/",
"openbook": "https://dewey-c5a399a962cbe1bfd566f164d6158f5d.read.libbyshelf.com/_d/openbook.json",
"rosters": "https://dewey-c5a399a962cbe1bfd566f164d6158f5d.read.libbyshelf.com/_d/roster.json",
"possession": "https://dewey-c5a399a962cbe1bfd566f164d6158f5d.read.libbyshelf.com/_d/possession",
"activity": "https://dewey-c5a399a962cbe1bfd566f164d6158f5d.read.libbyshelf.com/_d/activity"
},
"message": ".....",
"bankscope": "title-c5a399a96",
"expires": 1716422399
}
(I've left out the message part and formatted it to make it more readable)
However if you don't have the correct id/token, then you get a response like
Code:
{
"urls": {
"web": "https://dewey-c5a399a962cbe1bfd566f164d6158f5d.read.libbyapp.com/",
"possession": "https://dewey-c5a399a962cbe1bfd566f164d6158f5d.read.libbyapp.com/_d/possession",
"activity": "https://dewey-c5a399a962cbe1bfd566f164d6158f5d.read.libbyapp.com/_d/activity"
},
"message": ".....,
"bankscope": "title-c5a399a96",
"expires": 1716422399
}
which is missing the two important bits openbook and rosters.
Hence the plugin crashes when it tries to read the value of meta["urls"]["openbook"]