Recherche avancée

Médias (3)

Mot : - Tags -/spip

Autres articles (79)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (8143)

  • Discord bot stops playing music at a certain iteration

    3 mai 2023, par denisnumb

    I'm using the following code to play music in a discord voice channel :

    


    import discord
import asyncio
from yt_dlp import YoutubeDL

YDL_OPTIONS = {
    'format': 'bestaudio/best', 
}

FFMPEG_OPTIONS = {
    'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 
    'options': '-vn'
}

bot = discord.Client(intents=discord.Intents.all())

async def get_source_url(url: str) -> str:
    with YoutubeDL(YDL_OPTIONS) as ydl:
        return ydl.extract_info(url, download=False).get('url')

@bot.slash_command(name='play')
async def __play(ctx, url: str) -> None:
    source = await get_source_url(url)
    vc = await ctx.author.voice.channel.connect()
    vc.play(discord.FFmpegPCMAudio(source=source, **FFMPEG_OPTIONS))

    while vc.is_playing() or vc.is_paused():
        await asyncio.sleep(1)

    await vc.disconnect()

bot.run('TOKEN')


    


    The principle of operation is as follows :

    


      

    1. The /play command handler receives a url argument, in the form of a link to a live stream from YouTube : https://youtu.be/jfKfPfyJRdk (or any other video)

      


    2. 


    3. The link is passed to the get_source_url function, which, using the yt-dlp library, returns a direct link to the sound from the video

      


    4. 


    5. The direct link is passed via discord.FFmpegPCMAudio to the ffmpeg program, which then returns audio bytes for transmission to the discord voice channel via the vc.play method

      


    6. 


    



    


    Problem :

    


    Bot is hosted on the virtual hosting server aeza, OS - Ubuntu Server 22.04. I installed the ffmpeg version 4.4.2 with the command sudo apt install ffmpeg.

    


    On the first day everything worked fine, but the next day the bot began to steadily stop playing music at the same moment in different videos (this moment is different for each video). Restarting the bot or server did not help.

    


    Only reinstalling the operating system helps, but also only for one day.

    


    Specific problem :

    


    I checked the execution of every single line of the discord.VoiceClient.play method, including all methods called internally. It turned out that the bot hangs every time on the same iteration of the cycle of receiving and sending bytes. Namely, on the first line of the discord.FFmpegPCMAudio.read method, that is does not receive data from ffmpeg and waits indefinitely.

    



    


    Source of the problem :

    


    The problem is not with a specific ffmpeg :

    


      

    • I also installed ffmpeg on another version 5.1.2 and the problem was repeated on it.
    • 


    


    The problem is not Ubuntu Server :

    


      

    • I changed OS Ubuntu Server to Debian 11 and it's the same there
    • 


    


    The problem is not in Linux :

    


      

    • When I put the same OS on my virtual machine, everything worked fine with any version of ffmpeg.
    • 


    



    


    So the problem is on the hosting side ? I asked those. support to change the server itself and the location of the location. Changed from Sweden to Germany - the same result.

    


    If the data does not come from ffmpeg, then you need to find out what is wrong in the program itself. When calling, I pass the -loglevel debug argument, which shows the most detailed report on the program's operation - all debugging information is displayed, but there are no errors on the "hung" iteration.

    


    What could be the problem ?

    



    


    UPD 03.05.2023 : I reinstalled OS Ubuntu Server again and the bot works now. But obviously not for long. Maybe I need to clear some cache ?

    


  • Simple discord.py mp3 bot not playing music

    18 avril 2023, par Lukas Nesvarbu

    Discord bot dosent play anykind of music, neither mine nor other bots codes work he just dosent play music. idk maybe i am just stupid BUT IT DOSENT WORK WHY

    


    import discord
import time
import os
from discord.ext import commands

BOT_TOKEN = "" # put token here

intentss = discord.Intents.default()
intentss.message_content = True
intentss.voice_states = True

bot = commands.Bot(command_prefix=";;", intents = intentss)

OPUS_LIBS = ['libopus-0.x86.dll', 'libopus-0.x64.dll', 'libopus-0.dll', 'libopus.so.0', 'libopus.0.dylib']

@bot.command()
async def join(ctx):
    channelVC = ctx.author.voice.channel
    await channelVC.connect()

@bot.command()
async def leave(ctx):
    await ctx.voice_client.disconnect()

@bot.command()
async def play(ctx):
    voice = ctx.guild.voice_client
    mloc = 'C:/Users/Lukas/Desktop/Bot Bethoven/Youtube/test.mp3'
    voice.play(discord.FFmpegPCMAudio(executable = "C:/ffmpeg/bin/ffmpeg.exe", source = mloc))


bot.run(BOT_TOKEN)


    


    it just give error codes :

    


    discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: Not connected to voice.
INFO     discord.player ffmpeg process 22896 has not terminated. Waiting to terminate...
INFO     discord.player ffmpeg process 22896 should have terminated with a return code of 1.


    


    intresting thing when i put join and play in the same command it dosent show not connected to voice error, actually it dosent show anything and neither plays mp3 file

    


    i tryed reinstalling : PyNaCl, FFmpeg, Visual Code, updating python.
nothing helps. this problem started after i did 1 month break from coding bot, before that it worked fine.

    


    i'm thinking problem is something with my pc, maybe path or something dosent work(because it worked month ago and i didnt do anything to code), i tryed checking but everything seems normal,

    


  • Discord js music player bot suddenly leaves

    29 janvier 2024, par ImK

    So I made a music bot for discord js that uses discord player package. The command runs perfectly but in the middle song suddenly stops I tried searching everywhere nothing works and i think its an issue for ffmpeg but im not so sure

    


    bot.player = new Player(bot, {
    ytdlOptions: {
        quality: 'lowestaudio',
        highWaterMark: 1 >> 25
    },
})

const player = bot.player;

//play command 


bot.on('interactionCreate', async interaction =>{
    if(interaction.commandName === 'play') {

        const song = interaction.options.get('song').value;
        const res = await player.search(song, {
            searchEngine: QueryType.SPOTIFY_SONG
        });


        if (!res || !res.tracks.length) return interaction.reply({ content: `No results found ${interaction.member}... try again ? ❌`, ephemeral: true });

        const queue = await player.createQueue(interaction.guild)

        if (!queue.connection) await queue.connect(interaction.member.voice.channel);


        await interaction.channel.send({ content:`Loading your ${res.playlist ? 'playlist' : 'track'}... 🎧`});

        const track = await res.tracks[0]

        console.log(track)
        if(!track)  return interaction.channel.send({content: 'No song found'});

        queue.addTrack(track)

        queue.play();

    }
})


    


    After leaving the channel, other commands and bot work fine