Recherche avancée

Médias (91)

Autres articles (81)

  • L’utiliser, en parler, le critiquer

    10 avril 2011

    La première attitude à adopter est d’en parler, soit directement avec les personnes impliquées dans son développement, soit autour de vous pour convaincre de nouvelles personnes à l’utiliser.
    Plus la communauté sera nombreuse et plus les évolutions seront rapides ...
    Une liste de discussion est disponible pour tout échange entre utilisateurs.

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

Sur d’autres sites (4782)

  • lavfi/opencl : add more opencl helper macro

    12 avril 2019, par Ruiling Song
    lavfi/opencl : add more opencl helper macro
    

    Signed-off-by : Ruiling Song <ruiling.song@intel.com>

    • [DH] libavfilter/opencl.h
  • doc/filters : add document for opencl filters

    29 octobre 2018, par Ruiling Song
    doc/filters : add document for opencl filters
    

    Signed-off-by : Danil Iashchenko <danyaschenko@gmail.com>
    Signed-off-by : Ruiling Song <ruiling.song@intel.com>
    Signed-off-by : Gyan Doshi <gyandoshi@gmail.com>

    • [DH] doc/filters.texi
  • How can I make my loop command for a pythin discord bot work ?

    17 octobre 2022, par Dio

    so I am kinda new to python and wanted to make a discord music bot. It works pretty well, except that I am not able to figure out how to code the queue loop command and the playing now command(this one gives me a full link instead of just the name). I have bolded the 2 commands that I cannot figure out.

    &#xA;

       from ast import alias&#xA;import discord&#xA;from discord.ext import commands&#xA;&#xA;from youtube_dl import YoutubeDL&#xA;&#xA;class music_cog(commands.Cog):&#xA;    def __init__(self, bot):&#xA;        self.bot = bot&#xA;    &#xA;        #all the music related stuff&#xA;        self.is_playing = False&#xA;        self.is_paused = False&#xA;        self.is_loop = False&#xA;        self.now_playing =""&#xA;        # 2d array containing [song, channel]&#xA;        self.music_queue = []&#xA;        self.YDL_OPTIONS = {&#x27;format&#x27;: &#x27;bestaudio&#x27;, &#x27;noplaylist&#x27;:&#x27;True&#x27;}&#xA;        self.FFMPEG_OPTIONS = {&#x27;before_options&#x27;: &#x27;-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5&#x27;, &#x27;options&#x27;: &#x27;-vn&#x27;}&#xA;&#xA;        self.vc = None&#xA;&#xA;     #searching the item on youtube&#xA;    def search_yt(self, item):&#xA;        with YoutubeDL(self.YDL_OPTIONS) as ydl:&#xA;            try: &#xA;                info = ydl.extract_info("ytsearch:%s" % item, download=False)[&#x27;entries&#x27;][0]&#xA;            except Exception: &#xA;                return False&#xA;&#xA;        return {&#x27;source&#x27;: info[&#x27;formats&#x27;][0][&#x27;url&#x27;], &#x27;title&#x27;: info[&#x27;title&#x27;]}&#xA;&#xA;    def play_next(self):&#xA;        if len(self.music_queue) > 0:&#xA;            self.is_playing = True&#xA;&#xA;            #get the first url&#xA;            m_url = self.music_queue[0][0][&#x27;source&#x27;]&#xA;            self.now_playing =  self.music_queue[0][0][&#x27;title&#x27;]&#xA;            #remove the first element as you are currently playing it&#xA;            self.music_queue.pop(0)&#xA;&#xA;            self.vc.play(discord.FFmpegPCMAudio(m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())&#xA;        else:&#xA;            self.is_playing = False&#xA;&#xA;    # infinite loop checking &#xA;    async def play_music(self, ctx):&#xA;        if len(self.music_queue) > 0:&#xA;            self.is_playing = True&#xA;            m_url = self.music_queue[0][0][&#x27;source&#x27;]&#xA;            &#xA;            #try to connect to voice channel if you are not already connected&#xA;            if self.vc == None or not self.vc.is_connected():&#xA;                self.vc = await self.music_queue[0][1].connect()&#xA;&#xA;                #in case we fail to connect&#xA;                if self.vc == None:&#xA;                    await ctx.send("Could not connect to the voice channel")&#xA;                    return&#xA;            else:&#xA;                await self.vc.move_to(self.music_queue[0][1])&#xA;            self.now_playing = m_url&#xA;            #remove the first element as you are currently playing it&#xA;            self.music_queue.pop(0)&#xA;&#xA;            self.vc.play(discord.FFmpegPCMAudio(m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())&#xA;        else:&#xA;            self.is_playing = False&#xA;&#xA;    @commands.command(name="play", aliases=["p","playing"], help="Plays a selected song from youtube")&#xA;    async def play(self, ctx, *args):&#xA;        query = " ".join(args)&#xA;        &#xA;        voice_channel = ctx.author.voice.channel&#xA;        if voice_channel is None:&#xA;            #you need to be connected so that the bot knows where to go&#xA;            await ctx.send("Connect to a voice channel!")&#xA;        elif self.is_paused:&#xA;            self.vc.resume()&#xA;        else:&#xA;            global song&#xA;            song = self.search_yt(query)&#xA;            if type(song) == type(True):&#xA;                await ctx.send("Could not download the song. Incorrect format try another keyword. This could be due to playlist or a livestream format.")&#xA;            else:&#xA;                await ctx.send("Song added to the queue")&#xA;                self.music_queue.append([song, voice_channel])&#xA;                &#xA;                if self.is_playing == False:&#xA;                    await self.play_music(ctx)&#xA;&#xA;    @commands.command(name="pause", help="Pauses the current song being played")&#xA;    async def pause(self, ctx, *args):&#xA;        if self.is_playing:&#xA;            self.is_playing = False&#xA;            self.is_paused = True&#xA;            self.vc.pause()&#xA;            await ctx.send("Music paused")&#xA;        elif self.is_paused:&#xA;            self.is_paused = False&#xA;            self.is_playing = True&#xA;            self.vc.resume()&#xA;            await ctx.send("Music resumed")&#xA;&#xA;    @commands.command(name = "resume", aliases=["r"], help="Resumes playing with the discord bot")&#xA;    async def resume(self, ctx, *args):&#xA;        if self.is_paused:&#xA;            self.is_paused = False&#xA;            self.is_playing = True&#xA;            self.vc.resume()&#xA;            await ctx.send("Music resumed")&#xA;        else:&#xA;            await ctx.send("Music is not paused")&#xA;&#xA;    @commands.command(name="skip", aliases=["s"], help="Skips the current song being played")&#xA;    async def skip(self, ctx):&#xA;        if self.vc != None and self.vc:&#xA;            self.vc.stop()&#xA;            #try to play next in the queue if it exists&#xA;            await self.play_music(ctx)&#xA;            await ctx.send("Skipped current song")&#xA;&#xA;    @commands.command(name="queue", aliases=["q"], help="Displays the current songs in queue")&#xA;    async def queue(self, ctx):&#xA;        global retval &#xA;        retval = "```"&#xA;        for i in range(0, len(self.music_queue)):&#xA;            # display a max of 5 songs in the current queue&#xA;            #if (i > 4): break&#xA;            l = str(i&#x2B;1)&#xA;            retval &#x2B;= l &#x2B;". " &#x2B; self.music_queue[i][0][&#x27;title&#x27;] &#x2B; "\n"&#xA;&#xA;        if retval != "```":&#xA;            retval&#x2B;="```"&#xA;            await ctx.send(retval)&#xA;        else:&#xA;            await ctx.send("No music in queue")&#xA;&#xA;    **@commands.command(name="loop", help="Loops the queue")**&#xA;    async def loop(self, ctx):&#xA;        if self.is_loop == False:&#xA;            self.is_loop = True&#xA;        else:&#xA;            self.is_loop = False &#xA;        if self.is_loop == True:&#xA;            if len(self.music_queue)==0:&#xA;                await ctx.send("No music to loop")&#xA;            else:&#xA;                i=0&#xA;                while self.is_loop == True and i code>

    &#xA;