Skip to content

Commit

Permalink
set premium at first
Browse files Browse the repository at this point in the history
  • Loading branch information
BennyThink committed Dec 22, 2023
1 parent 613f36b commit d0e2025
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ytdlbot/premium.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ async def hello(client: Client, message: types.Message):
url = data["url"]
user_id = data["user_id"]

redis = Redis()
redis.r.hset("premium", user_id, 1)
tempdir = tempfile.TemporaryDirectory(prefix="ytdl-")
output = pathlib.Path(tempdir.name, "%(title).70s.%(ext)s").as_posix()
ydl_opts = {"restrictfilenames": False, "quiet": True, "outtmpl": output, "progress_hooks": [download_hook]}
Expand Down Expand Up @@ -96,8 +98,6 @@ async def hello(client: Client, message: types.Message):
)

tempdir.cleanup()
redis = Redis()
redis.r.hset("premium", user_id, 1)


if __name__ == "__main__":
Expand Down

0 comments on commit d0e2025

Please sign in to comment.