-
Notifications
You must be signed in to change notification settings - Fork 18
Fix forced 30x resolution in https://github.com/jkehler/unshortenit/issues/26, add minor logging and exceptions #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
# Conflicts: # setup.py
…ve them separate.
|
Note that I generally have fairly verbose logging, and it might be worth replacing all the log.info calls with log.debug, if you prefer the library to be more silent. |
|
Additional stupid junk: You can now provide a dict-like object to the UnshortenIt() instance, and it will then use that to allow you to provide already-resolved urls. This was done for my use case where I have some inputs that consume RSS feeds, and the RSS feeds contain shortened links. Due to the nature of RSS, I see the same posts fairly repeatedly, and waiting for them to resolve again, and again, and again..... This way, I can provide a custom dict-like object that saves the seen URLs in a database. The end result is a feed where I previously took > 5 minutes to process the contained links now takes ~5 seconds. I don't know why the pypy test is failing. It works in my local pypy3 install. Are the tests accidentally using pypy2? |
Push the caching up one layer so it's much more sensibly located. Add a flag that lets you forcibly ignore the cache entirely.
… modified. Instead, only do the cache query if we think we need to actually modify the link.
Principally, this fixes #26.
It also adds some simple logging (at the path "Main.LinkUnshortener"), and also imports the two exceptions into the
__init__.pyfile. This makes it much nicer to use, since you no longer need two separate imports if you want to catch exceptions.You can now do: