danieltanfh95 / btapi

baka tsuki api clean up
http://btapi-shadowys.rhcloud.com/
8 stars 5 forks source link

Light novel detail not working #9

Closed AzSiAz closed 9 years ago

AzSiAz commented 9 years ago

Hi,

I have en error when I try to open https://baka-tsuki-api.herokuapp.com/api?title=Rakudai_Kishi_no_Eiyuutan

I try on local and still an error

error :

SyntaxError: Unexpected end of input
    at Object.parse (native)
    at /Users/Stef/Documents/Workspace/JS/Reader/LN Reader/server/btapi/routes/api.js:270:25
    at IncomingMessage.<anonymous> (/Users/Stef/Documents/Workspace/JS/Reader/LN Reader/server/btapi/routes/api.js:556:7)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)
danieltanfh95 commented 9 years ago

Will get back to you once my internet connection is normal

AzSiAz commented 9 years ago

Ok :)

danieltanfh95 commented 9 years ago

So somehow the media wiki API has changed.

http://www.baka-tsuki.org/project/api.php?action=parse&prop=text&page=Zero_No_Tsukaima

no longer returns the data for the page. In the future the wrapper API may take data from the page directly

AzSiAz commented 9 years ago

More or less because this one for example work https://www.baka-tsuki.org/project/api.php?action=parse&prop=text&page=Rakudai_Kishi_no_Eiyuutan

Still it doesn't work in btapi

EDIT : In seriesTitleFilterByDownload (api.js) I change the url in download (currently "http://baka-tsuki.org/project/api.php?action=parse&format=json&prop=text&page=") by "http://www.baka-tsuki.org/project/api.php?action=parse&format=json&prop=text&page=" (the same just added www.) and it seem to work again, well not for Zero No Tsukaima (and probably other which don't work in api.php) but it should work with every LN currently working with the api

danieltanfh95 commented 9 years ago

Thanks. The API route failed to download anything if there wasn't a www in front the link, but changing it solved it. Will search for the reason later.

p.s. It was a typo on my part for ZnT. Zero_no_Tsukaima, not Zero_No_Tsukaima

AzSiAz commented 9 years ago

Didn't see this mistake, well there was no reason for it to doesn't work anyway