Closed annathecrow closed 8 years ago
What I found so far: according to the documentation for urllib3, it should be possible to get the final redirection url, but it just wouldn't work for me. What did work was to add parameter "redirect=false" to request(), and then get the final destination from http headers. I think that will work too, since we need to re-run with the proper url anyway. Next question is, how to restructure the try-catch block, how to make the new url, and how to repeat the call with the new one.
Could we maybe we could "mirror" the tag aliases on our side, so we could tax the ao3 server less?
(relevant commit: 6c375a7424e723dd3416430448ba7ecd03732b2e)
(more info on the Redirection pull request, #50)
fixed in #50.
API call
/api/v1.0/stats?tag_id=Imperator+Furiosa&complete=1
is redirected tohttp://archiveofourown.org/tags/Furiosa%20(Mad%20Max)/works
; numworks: 414. API callhttp://localhost:8080/api/v1.0/stats?tag_id=Furiosa+%28Mad+Max%29&complete=1
goes where it should; numworks: 287.If nothing else, we need an error message; better yet, get the canonical tag from the url being redirected to, and re-run the call.