Change yt-dl update frequency
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 30s
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 30s
This commit is contained in:
parent
64b02ee1ec
commit
c41d6c3843
1 changed files with 11 additions and 12 deletions
|
@ -228,7 +228,6 @@ class YTDLCog(commands.Cog):
|
|||
response.raise_for_status()
|
||||
|
||||
@commands.slash_command(name="yt-dl")
|
||||
@commands.max_concurrency(1, wait=False)
|
||||
# @commands.bot_has_permissions(send_messages=True, embed_links=True, attach_files=True)
|
||||
async def yt_dl_command(
|
||||
self,
|
||||
|
@ -294,7 +293,7 @@ class YTDLCog(commands.Cog):
|
|||
line = (f"{_percent}% [{bar}] | {_speed_megabits_per_second}Mbps | "
|
||||
f"ETA {discord.utils.format_dt(_eta, 'R')}")
|
||||
nonlocal last_edit
|
||||
if (n - last_edit) >= 5:
|
||||
if (n - last_edit) >= 1.1:
|
||||
embed.clear_fields()
|
||||
embed.add_field(name="Progress", value=line)
|
||||
ctx.bot.loop.create_task(ctx.edit(embed=embed))
|
||||
|
@ -374,19 +373,19 @@ class YTDLCog(commands.Cog):
|
|||
likes = views = 0
|
||||
chosen_format_id = str(uuid.uuid4())
|
||||
else:
|
||||
title = extracted_info.get("title", url)
|
||||
title = extracted_info.get("title", url) or url
|
||||
title = textwrap.shorten(title, 100)
|
||||
thumbnail_url = extracted_info.get("thumbnail") or None
|
||||
webpage_url = extracted_info.get("webpage_url", url)
|
||||
|
||||
chosen_format = extracted_info.get("format")
|
||||
chosen_format_id = extracted_info.get("format_id")
|
||||
final_extension = extracted_info.get("ext")
|
||||
format_note = extracted_info.get("format_note", "%s (%s)" % (chosen_format, chosen_format_id))
|
||||
resolution = extracted_info.get("resolution")
|
||||
fps = extracted_info.get("fps", 0.0)
|
||||
vcodec = extracted_info.get("vcodec")
|
||||
acodec = extracted_info.get("acodec")
|
||||
chosen_format = extracted_info.get("format") or chosen_format or str(uuid.uuid4())
|
||||
chosen_format_id = extracted_info.get("format_id") or str(uuid.uuid4())
|
||||
final_extension = extracted_info.get("ext") or "mp4"
|
||||
format_note = extracted_info.get("format_note", "%s (%s)" % (chosen_format, chosen_format_id)) or ""
|
||||
resolution = extracted_info.get("resolution") or "1x1"
|
||||
fps = extracted_info.get("fps", 0.0) or 0.0
|
||||
vcodec = extracted_info.get("vcodec") or "h264"
|
||||
acodec = extracted_info.get("acodec") or "aac"
|
||||
filesize = extracted_info.get("filesize", extracted_info.get("filesize_approx", 1))
|
||||
likes = extracted_info.get("like_count", extracted_info.get("average_rating", 0))
|
||||
views = extracted_info.get("view_count", 0)
|
||||
|
@ -423,7 +422,7 @@ class YTDLCog(commands.Cog):
|
|||
)
|
||||
embed.add_field(
|
||||
name="Progress",
|
||||
value="0% [..........] <t:253402300800:R>"
|
||||
value="0% [..........]"
|
||||
)
|
||||
embed.set_footer(text="Downloading (step 2/10)")
|
||||
embed.set_thumbnail(url=thumbnail_url)
|
||||
|
|
Loading…
Reference in a new issue