[Python] Converting seconds to minutes and hours in youtubedl

Discussão em 'Python' iniciado por Stack, Março 6, 2025.

  1. Stack

    Stack Membro Participativo

    embed = discord.Embed(
    title=self.title, description=f"**Channel:** {self.uploader}\n **Duration:** {self.duration}", url=self.video_url)
    embed.set_footer(
    text=f"Requested by: {self.requested_by.name}",
    icon_url=self.requested_by.avatar_url)
    if self.thumbnail:
    embed.set_thumbnail(url=self.thumbnail)
    return embed


    So it is all about the second line. Right now the output is shown the duration in seconds. I would like to change the format so that the actual time is displayed. For example the video is 3 min long:

    • On YouTube 03:00 is shown. My bot converts it to 300 seconds. Is there a way to change this so the actual time is given?

    Continue reading...

Compartilhe esta Página