Recherche avancée

Médias (91)

Autres articles (92)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • 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 (...)

Sur d’autres sites (9327)

  • KeyError :

    26 juin 2022, par Leon Warta

    So i get the "KeyError: " error, in my code for a music bot (Discord). it says the problems lays in this part : url2 = info['format'][0]['url']

    


    this is the code ;

    


    @client.command()
async def play(ctx, url):
    ctx.voice_client.stop()
    FFPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
    YDL_OPTIONS = {'format': 'bestaudio', 'default-search': "ytdlsearch"}
    vc = ctx.voice_client

    with youtube_dl.YoutubeDL(YDL_OPTIONS) as ydl:
        info = ydl.extract_info(url, download=False)
        url2 = info['format'][0]['url']
        source = await discord.FFmpegOpusAudio.from_probe(url2, **FFPEG_OPTIONS)

        vc.play(source)


    


    edit ; im new to coding so if you explain, just use easy words.
edit ; thnx to Infinity ! you're a legend ! I was struggling with this code for 2 days, bc i missed one "s" in my code.....

    


  • DiscordJS error : FFmpeg/avconv not found ! showing up after installing it

    16 mai 2020, par DataDece

    I've been installed the FFmpeg extension using npm, and git also, and this following error still shows itself...

    



    Successfully connected.
Error: FFmpeg/avconv not found!
    at Function.getInfo (D:\bot\node_modules\prism-media\src\core\FFmpeg.js:130:11)
    at Function.create (D:\bot\node_modules\prism-media\src\core\FFmpeg.js:143:38)
    at new FFmpeg (D:\bot\node_modules\prism-media\src\core\FFmpeg.js:44:27)    at AudioPlayer.playUnknown (D:\bot\node_modules\discord.js\src\client\voice\player\BasePlayer.js:47:20)
    at VoiceConnection.play (D:\bot\node_modules\discord.js\src\client\voice\util\PlayInterface.js:71:28)
    at D:\bot\index.js:36:47


    



    I don't know what to do also...
I'll be happy for help ;)

    


  • why ffmpeg process successfully terminated with return code of 1 without play anything

    24 juillet 2023, par Exc

    `I tried replacing youtube_dl with yt_dlp and replaced some of the code, the code worked fine but when using the command, the bot doesn't play music but immediately ffmpeg process 15076 successfully terminated with return code of 1

    


    Is there a problem with my code or the ffmpg option or ytdlp option that doesn't support the yt_dlp library ?`

    


     self.YTDL_OPTIONS = {
        'format': 'bestaudio/best',
        'outtmpl': 'F:/DISCORD BOT/Ex/music/%(extractor)s-%(id)s-%(title)s.%(ext)s',
        'restrictfilenames': True,
        'retry_max': 'auto',
        'noplaylist': True,
        'nocheckcertificate': True,
        'ignoreerrors': True,
        'logtostderr': False,
        'quiet': True,
        'no_warnings': True,
        'default_search': 'auto',
        'source_address': '0.0.0.0',
        'postprocessors': [{
            'key': 'FFmpegExtractAudio',
            'preferredcodec': 'mp3',
            'preferredquality': '192',
        }],
        'youtube_api_key': 'api'
    }
self.FFMPEG_OPTIONS = {
         'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5',
         'options': '-vn',
         'executable':r'F:\DISCORD BOT\Ex\ffmpeg\bin\ffmpeg.exe'
         }

    
    @commands.hybrid_command(
        name="play",
        aliases=["p"],
        usage="",
        description="KARAUKENAN.",
         
    )
    @app_commands.describe(
        judul_lagu="link ato judul lagunya"
    )
    async def play(self, ctx, judul_lagu:str):
        await ctx.defer()
        voice_channel = ctx.author.voice
        if not voice_channel or not voice_channel.channel:
            await ctx.send("Join voice channel dulu gblk!")
            return

        voice_channel = voice_channel.channel
        song = self.search_song(judul_lagu)
        if not song:
            await ctx.send("Lagnya tdk ditemukan, coba keword lain.")
            return

        if not self.bot.voice_clients:
            voice_client = await voice_channel.connect()
        else:
            voice_client = self.bot.voice_clients[0]
            if voice_client.channel != voice_channel:
                await voice_client.move_to(voice_channel)

        self.music_queue.append([song, voice_client])
        if not self.is_playing:
            await self.play_music(ctx)
    
    async def play_music(self, ctx):
        self.is_playing = True
        while len(self.music_queue) > 0:
            song = self.music_queue[0][0]
            voice_client = self.music_queue[0][1]
            await ctx.send(f"Playing {song['title']}")

            voice_client.play(discord.FFmpegPCMAudio(song['source'], **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())
            voice_client.is_playing()

            while voice_client.is_playing():
                await asyncio.sleep(1)

            self.music_queue.pop(0)
            self.is_playing = False

        await ctx.send("Queue is empty.")
        voice_client.stop()

    def play_next(self):
        if len(self.music_queue) > 0:
            self.is_playing = False

    def search_song(self, judul_lagu):
        ydl = yt_dlp.YoutubeDL(self.YTDL_OPTIONS)
        with ydl:
            try:
                info = ydl.extract_info(f"ytsearch:{judul_lagu}", download=False)['entries'][0]
                return {'source': info['formats'][0]['url'], 'title': info['title']}
            except Exception:
                return None




    


    when i use /play the bot sucess serch song but immediately terminate does not play any music

    


    2023-04-10 13:06:45 INFO     discord.voice_client Connecting to voice...
2023-04-10 13:06:45 INFO     discord.voice_client Starting voice handshake... (connection attempt 1)
2023-04-10 13:06:46 INFO     discord.voice_client Voice handshake complete. Endpoint found singapore11075.discord.media
2023-04-10 13:06:50 INFO     discord.player ffmpeg process 15076 successfully terminated with return code of 1.


    


    this image whe i use /play