Skip to content

Commit

Permalink
free download 10
Browse files Browse the repository at this point in the history
  • Loading branch information
BennyThink committed May 29, 2023
1 parent 4aa956b commit 8db05d6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Websites [supported by youtube-dl](https://ytdl-org.github.io/youtube-dl/support

Due to limitations on servers and bandwidth, there are some restrictions on this free service.

* Each user is limited to 5 free downloads per 24-hour period
* Each user is limited to 10 free downloads per 24-hour period
* there is a maximum of three subscriptions allowed for YouTube channels.

If you need more downloads, you can purchase additional tokens. Additionally, you have the option of deploying your
Expand Down
3 changes: 1 addition & 2 deletions ytdlbot/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ def subscribe_channel(self, user_id: int, share_link: str) -> str:
if ENABLE_VIP:
self.cur.execute("select count(user_id) from subscribe where user_id=%s", (user_id,))
usage = int(self.cur.fetchone()[0])
if usage >= 5:
# TODO: 5 tokens for one more subscription?
if usage >= 10:
logging.warning("User %s has subscribed %s channels", user_id, usage)
return "You have subscribed too many channels. Maximum 5 channels."

Expand Down
2 changes: 1 addition & 1 deletion ytdlbot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
PLAYLIST_SUPPORT = os.getenv("PLAYLIST_SUPPORT", False)
ENABLE_ARIA2 = os.getenv("ENABLE_ARIA2", False)

FREE_DOWNLOAD = os.getenv("FREE_DOWNLOAD", 5)
FREE_DOWNLOAD = os.getenv("FREE_DOWNLOAD", 10)
TOKEN_PRICE = os.getenv("BUY_UNIT", 20) # one USD=20 credits

RATE_LIMIT = os.getenv("RATE_LIMIT", 20)
Expand Down
3 changes: 1 addition & 2 deletions ytdlbot/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

class BotText:
start = "Welcome to YouTube Download bot. Type /help for more information."
rate_limit = "**I'm being rate limited by Telegram. Please expect a delay in processing your request.**"
help = f"""
1. This bot should work at all times. If it doesn't, please wait for a few minutes and try sending the link again.
Expand Down Expand Up @@ -93,7 +92,7 @@ def get_receive_link_text() -> str:
if ENABLE_CELERY and reserved:
text = f"Too many tasks. Your tasks was added to the reserved queue {reserved}."
else:
text = "Your task was added to active queue.\nProcessing...\n\n" + BotText.rate_limit
text = "Your task was added to active queue.\nProcessing...\n\n"

return text

Expand Down
2 changes: 1 addition & 1 deletion ytdlbot/ytdl_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def start_handler(client: Client, message: types.Message):
info = f"Free token: {free_token}, Pay token: {pay_token}, Reset: {reset}"
else:
info = ""
text = f"{BotText.start}\n\n{info}\n{BotText.custom_text}\n{BotText.rate_limit}"
text = f"{BotText.start}\n\n{info}\n{BotText.custom_text}"
client.send_message(message.chat.id, text)


Expand Down

0 comments on commit 8db05d6

Please sign in to comment.