Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pastebin-bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from yt_download_shorts import download_video, get_title
import instaloader
from link_shortner import short

bot = telebot.TeleBot(API_KEY)

# TBD
Expand Down Expand Up @@ -154,6 +155,7 @@ def handle_video_download_yt(message):
except instaloader.ConnectionException:
bot.reply_to(message, "IP is Blocked Please Try After Some Time")


# This Decorator Deals with /short
@bot.message_handler(commands=["short"])
def handle_short(message):
Expand All @@ -165,5 +167,6 @@ def handle_short(message):
except:
bot.reply_to(message, f"We can't abel to short{payload_link_data}")


if __name__ == "__main__":
bot.infinity_polling()
4 changes: 1 addition & 3 deletions pastebin-bot/link_shortner.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ def short(url: str):
headers = {
"content-type": "application/x-www-form-urlencoded",
"X-RapidAPI-Key": "e02923797dmshddea57448263f98p13ab17jsn9e252949aa6f",
"X-RapidAPI-Host": "url-shortener-service.p.rapidapi.com"
"X-RapidAPI-Host": "url-shortener-service.p.rapidapi.com",
}
response = requests.request("POST", url, data=payload, headers=headers)
x = dict(response.json())
return_link = ""
for i in x.values():
return_link = i
return return_link


9 changes: 6 additions & 3 deletions pastebin-bot/quotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
def preload_quotes():
global quotes
quotes.clear()

randon_quote = requests.get(api, headers={'X-Api-Key': 'ZSVhux9848gfWCCCLMlESQ==UwDZ4yCxgj0irhQu'}).json()

randon_quote = requests.get(
api, headers={"X-Api-Key": "ZSVhux9848gfWCCCLMlESQ==UwDZ4yCxgj0irhQu"}
).json()
content = randon_quote[0]
author = content["author"]
quote = content["quote"] + "\n\n" + "By " + author
quotes.append(quote)

#print(quotes[0])

# print(quotes[0])

# preload_quotes()
#
Expand Down