Closed dportabella closed 3 years ago
I can see your point here about the second call potentially returning a misleading response if the second shot at the API does in fact result in a fresh archive (where the first shot failed.)
However, I'm not sure I understand why you think it's necessary to remove the function entirely.
However, I'm not sure I understand why you think it's necessary to remove the function entirely.
because it is not necessary to call requests.get
twice. It's enough call it only once.
if it returns a cached result, and the user don't one a cached result, you raise a CachedPage exception.
if it returns a cached result, and the user accepts a cached result, you return this first response. no need to call requests.get
again.
In case you want to use this fix, I've rebased my fix with your last commits, and fixed the trailing space travis was complaining about. it seems travis is still complaining, but I don't see the actual problem.
This guy has gotten a bit stale and has a merge conflict. That's almost certainly due to me trying to debug some stuff going on with Wayback. If you want to clean up and resubmit, it would be welcome but in the interest of tidying up this neglected repo I'm going to close it for now.
bug fix: capture_or_cache was potentially making two calls to archive.org. Moreover, the second call would always return captured=False even if this second call resulted in a fresh capture