diff --git a/pbincli/api.py b/pbincli/api.py index 858d19b..9bdf936 100644 --- a/pbincli/api.py +++ b/pbincli/api.py @@ -136,11 +136,17 @@ class Shortener: PBinCLIError("YOURLS: No status, statusCode or message fields in response! Received:\n{}".format(response)) elif self.api == 'clckru': - # from urllib.parse import quote_plus request = {'url': url} - result = self.session.post( url = "https://clck.ru/--", proxies = self.proxy, data = request) print("Short Link:\t{}".format(result.text)) + + elif self.api == 'tinyurl': + request = {'url': url} + result = self.session.post( + url = "https://tinyurl.com/api-create.php", + proxies = self.proxy, + data = request) + print("Short Link:\t{}".format(result.text)) diff --git a/pbincli/cli.py b/pbincli/cli.py index 14a0908..ff8739e 100755 --- a/pbincli/cli.py +++ b/pbincli/cli.py @@ -38,7 +38,7 @@ def main(): choices=["zlib", "none"], help="set compression for paste (default: zlib). Note: works only on v2 paste format") # URL shortener send_parser.add_argument("-S", "--short", default=False, action="store_true", help="use URL shortener") - send_parser.add_argument("--short-api", default=argparse.SUPPRESS, action="store", choices=["clckru", "yourls"], help="API used by shortener service") + send_parser.add_argument("--short-api", default=argparse.SUPPRESS, action="store", choices=["clckru", "tinyurl", "yourls"], help="API used by shortener service") send_parser.add_argument("--short-url", default=argparse.SUPPRESS, help="URL of shortener service API") send_parser.add_argument("--short-user", default=argparse.SUPPRESS, help="Shortener username") send_parser.add_argument("--short-pass", default=argparse.SUPPRESS, help="Shortener password")