View Single Post
Old 01-04-2013, 12:31 AM   #1128
FaceDeer will become famous soon enoughFaceDeer will become famous soon enoughFaceDeer will become famous soon enoughFaceDeer will become famous soon enoughFaceDeer will become famous soon enoughFaceDeer will become famous soon enoughFaceDeer will become famous soon enough
Posts: 81
Karma: 706
Join Date: Nov 2012
Device: Kobo Touch
The main story page gives the following chapter list:
  1. The Prologue
  2. Hey Sis...?
  3. B-b-but...
  4. Another Day of School

The API gives the following chapter list:

{"id":39733,"title":"The Prolouge","words":717,"views":1963,"link":"http:\/\/\/story\/13070\/1\/sweetie-belles-secret\/the-prolouge","date_modified":1331509540},

{"id":43012,"title":"Hey Sis...?","words":1161,"views":1386,"link":"http:\/\/\/story\/13070\/2\/sweetie-belles-secret\/hey-sis","date_modified":1331509495},


{"id":110478,"title":"Author Update","words":200,"views":542,"link":"http:\/\/\/story\/13070\/4\/sweetie-belles-secret\/author-update","date_modified":1341075370},

{"id":216887,"title":"Another Day of School","words":529,"views":246,"link":"http:\/\/\/story\/13070\/5\/sweetie-belles-secret\/another-day-of-school","date_modified":1355586884}

The fourth chapter in the API is something called "Author Update", which an old copy of the fanfic I've got kicking around from before reveals is a short note from the author talking about his update schedule. When I unescape and paste that link into my browser now, however, it takes me to the current fourth chapter, "Another Day of School." The problem is that the API's entry is telling FFDL that that chapter is called "Author Update", rather than "Another Day of School", and so it's titling the chapter that in the epub it generates. It seems that FiMFiction is basically ignoring all of the story URL beyond the chapter number, I can type whatever garbage I want in there and it still takes me to the fourth published chapter.

I guess the way to fix this would be to have FFDL parse the chapter title out of the page's text rather than trusting the API. Something like that could also fix the rare accented-character-in-title-gives-null-title-in-API bug too. But that seems like a bit of a hassle and a kludge to fix something that's properly FiMFiction's responsibility to correct. My only real concern is that if one of my epubs gets an incorrect chapter title inside it there's no error message letting me know it needs to be fixed, but I guess that's a pretty minor flaw.

Edit: it just occurred to me that this could potentially cause a bigger problem under the right circumstances, if there's a 50-chapter epic and the first chapter is "hidden" every chapter afterward would have its name shifted down to the next chapter. That's kinda annoying. *makes a new years' resolution to keep bugging Knighty at regular intervals*

As for the IPv6 URL problem, thanks for spotting the root cause. I figured it'd be something weirdly specific to this one story, I've used FFDL on a heck of a lot of FiMFiction stories and that's the first time I ever saw that error. I actually picked that one at random to download when I grabbed a few thousand story URLs a while back to try to find cases reproducing the other bugs. Maybe I should read it anyway since I've paid so much attention to it now.

Last edited by FaceDeer; 01-04-2013 at 12:44 AM. Reason: linking the API's URL for chapter 4 for convenience, and noting a worst-case scenario that just came to mind
FaceDeer is offline