Support scraping supported expiries #20
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Greetings. It is with pleasure I bring to you a new PR.
pbcli
offers a useful--expire
option but the server may not support arbitrary user set expire duration.If user provides an expiry that is not configured on the host, the host will unilaterally choose it's default expire duration. With no warning.
But how would we (as client users) know the supported expiry values for arbitrary privatebin hosts?
As discussed in PrivateBin/PrivateBin#1434 in lieu of an API, we can scrape the supported expiry(s) of a host directly. Or at-least attempt to, for hosts with close to default Privatebin webui.
This allows one to use the client without having to manually lookup supported expiry durations on the website.
This PR introduces
--scrape-expiries
flag, which will do just that: Attempt to scrape expiries supported by a privatebin host, and present them to user.Users can use this information to confidently enter
--expiry
duration on the command line.And similarly for other clients using this library.