From 41dfd71e54c13a520e5e03c09d532ed06e74739b Mon Sep 17 00:00:00 2001 From: PRINCE KUMAR <56459297+princekrvert@users.noreply.github.com> Date: Fri, 15 Oct 2021 13:46:12 +0530 Subject: [PATCH] Add files via upload is gd usl dervice added --- short.py | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/short.py b/short.py index 74401ea..01500ad 100755 --- a/short.py +++ b/short.py @@ -1,21 +1,30 @@ -#!/data/data/com.termux/files/usr/bin/python3 +#!/usr/bin/python3 #Author prince kumar -# Modification date 28 mar 2021 -#start - - +# Modification date14 oct 2021 #import goes here import pyshorteners import argparse +import json +import requests import time import os import sys #take a input #make a function to update the repo--- +# make a banne function +def banner(): + print("\033[33;1m") + print('░s░h░o░r░t░', end=" ") + print("\033[32;1m MADE BY PRINCE") def repoUpdate(): - os.system("git pull https://github.com/princekrvert/Short.git > /dev/null 2>&1 & sleep .05 ") - print("Updating ...") - os.system("clear") + if sys.platform == "linux": + os.system("git pull https://github.com/princekrvert/Short.git > /dev/null 2>&1 & sleep .05 ") + print("Updating ...") + os.system("clear") + banner() + else: + os.system("cls") + banner() #Let's define a main function---- @@ -31,6 +40,10 @@ def main(): print("\033[36;1m Your short url is :", end=" ") print("\033[95;1m " ,short_url) print() + res = requests.get(f"https://is.gd/create.php?format=json&url={link}") + print("\033[36;1m Your short url is : ", end=" ") + short_link = res.json().get("shorturl") + print("\033[95;1m", short_link) except KeyboardInterrupt: print("\033[36;1m Exiting--->>>>") time.sleep(2)