Recherche avancée

Médias (91)

Autres articles (73)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • Sélection de projets utilisant MediaSPIP

    29 avril 2011, par

    Les exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
    Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
    Ferme MediaSPIP @ Infini
    L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)

Sur d’autres sites (10362)

  • Keep getting "discord.ext.commands.errors.CommandInvokeError : Command raised an exception : KeyError : 'source'" error

    22 février 2023, par kris

    Everytime I try to run play command in my bot, I get this error in the terminal, kind of new to coding so not exactly sure whats going on. It was working just fine, then it started not to work.

    


    import discord

from discord.ext import commands

from youtube_dl import YoutubeDL

class music_cog(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        
        self.is_playing = False
        self.is_paused = False

        self.music_queue = []
        self.YDL_OPTIONS = {'format': 'bestaudio', 'noplaylist': 'True'}
        self.FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}

        self.vc = None

    def search_yt(self, item):
        with YoutubeDL(self.YDL_OPTIONS) as ydl:
            try:
                info = ydl.extract_info("ytsearch:%s" % item, download=False)['entries'][0]
            except Exception:
                return False
        return {'sourcffmpege': info['formats'][0]['url'], 'title': info['title']}
    
    def play_next(self):
        if len(self.music_queue) > 0:
            self.is_playing = True

            m_url = self.music_queue[0][0]['source']

            self.music_queue.pop(0)

            self.vc.play(discord.FFmpegPCMAudio(executable="ffmpeg", source=m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())
        else:
            self.is_playing = False

    async def play_music(self, ctx):
        if len(self.music_queue) > 0:
            self.is_playing = True

            m_url=self.music_queue[0][0]['source']

            if self.vc == None or not self.vc.is_connected():
                self.vc = await self.music_queue[0][1].connect()

                if self.vc == None:
                    await ctx.send("Could not connect to the voice channel")
                    return
            else:
                await self.vc.move_to(self.music_queue[0][1])

            self.music_queue.pop(0)

            self.vc.play(discord.FFmpegPCMAudio(executable="ffmpeg", source=m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())

    @commands.command(name="play", aliases=["p", "playing"], help="Play the selected song from youtube")
    async def play(self, ctx, *args):
        query = " ".join(args)

        voice_channel = ctx.author.voice.channel
        if voice_channel is None:
            await ctx.send("Connect to a voice channel!")
        elif self.is_paused:
            self.vc.resume()
        else:
            song = self.search_yt(query)
            if type(song) == type(True):
                await ctx.send("Could not download the song. Incorrect format, try a different keyword")
            else:
                await ctx.send("Song added to the queue")
                self.music_queue.append([song, voice_channel])

                if self.is_playing == False:
                    await self.play_music(ctx)

    @commands.command(name="pause", help="Pauses the current song being played")
    async def pause(self, ctx, *args):
        if self.is_playing:
            self.is_playing = False
            self.is_paused = True
            self.vc.pause()
        elif self.is_paused:
            self.vc.resume()

    @commands.command(name="resume", aliases=["r"], help="Resumes playing the current song")
    async def resume(self, ctx, *args):
        if self.is_paused:
            self.is_playing = True
            self.is_paused = False
            self.vc.resume()

    @commands.command(name="skip", aliases=["s"], help="Skips the currently played song")
    async def skip(self, ctx, *args):
        if self.vc != None and self.vc:
            self.vc.stop()
            await self.play_music(ctx)

    @commands.command(name="queue", aliases=["q"], help="Displays all the songs currently in the queue")
    async def queue(self, ctx):
        retval = ""

        for i in range(0, len(self.music_queue)):
            if i > 5: break
            retval += self.music_queue[i][0]['title'] + '\n'

        if retval != "":
            await ctx.send(retval)
        else:
            await ctx.send("No music in queue.")
    
    @commands.command(name="clear", aliases=["c", "bin"], help="Stops the current song and clears the queue")
    async def clear(self, ctx, *args):
        if self.vc != None and self.is_playing:
            self.vc.stop()
        self.music_queue = []
        await ctx.send("Music queue cleared")

    @commands.command(name="leave", aliases=["l"], help="Kicks the bot from the voice channel")
    async def leave(self, ctx):
        self.is_playing = False
        self.is_paused = False
        await self.vc.disconnect()

async def setup(bot):
    await bot.add_cog(music_cog(bot))


    


    this is my music_cogs.py, this is where error is coming from

    


    was working just fine then it started to give me this error after a while.

    


    raceback (most recent call last):
  File "C:\Users\poopt\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 229, in wrapped
    ret = await coro(*args, **kwargs)
  File "c:\Users\poopt\Code\cool_bot\cogs\music_cog.py", line 77, in play
    await self.play_music(ctx)
  File "c:\Users\poopt\Code\cool_bot\cogs\music_cog.py", line 44, in play_music
    m_url=self.music_queue[0][0]['source']
KeyError: 'source'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
 line 1349, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\poopt\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 1023, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
  File "C:\Users\poopt\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 238, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: 'source'


    


  • Trying to install ffmpeg with brew and I keep getting errors related to "dav1d_bottle_manifest"

    13 décembre 2022, par Jonathan Doe

    I am trying to do some basic DSP in python and in order to play some of my audio files I need to install ffmpeg on my computer.

    


    I am running a 2019 macbook pro.

    


    When I run brew intsall ffmpeg -d

    


    I get this on my terminal output

    


    rm: /usr/local/Homebrew/.git/TMP_FETCH_FAILURES: is a directory
rm: /usr/local/Homebrew/.git/TMP_FETCH_FAILURES: is a directory
Running `brew update --auto-update`...


    


    This auto update just runs forever with no updates of any kind. I'm not sure if it is broken or stuck or what.

    


    I try to manually run :

    


     brew update -d


    


    and the update stalls forever on this section :

    


    + [[ -f /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/.git/FETCH_HEAD ]]
+ touch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/.git/FETCH_HEAD
+ [[ -z '' ]]
+ [[ 200 == \3\0\4 ]]
+ [[ -n '' ]]
+ local tmp_failure_file=/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/.git/TMP_FETCH_FAILURES
+ rm -f /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/.git/TMP_FETCH_FAILURES
+ [[ -n '' ]]
+ git fetch --tags --force -q origin refs/heads/master:refs/remotes/origin/master


    


    I am having so many problems with brew any help would be appreciated.

    


  • "Uncurve" Cinerama-like videos

    2 août 2021, par silent

    I'm pretty new to ffmpeg and I recently found interesting videos that are trying to simulate the Cinerama technology back from 1950x by curving the final video.

    


    Here is the screenshot how it looks like during the playback : https://imgur.com/undefined

    


    I was wondering if it's possible to make this kind of picture back to "normal" rectangular shape ?
Here's a small (30 seconds, 48MB) example of how it looks like : https://ufile.io/8b0139j0

    


    Thanks !