Recherche avancée

Médias (91)

Autres articles (11)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Les thèmes de MediaSpip

    4 juin 2013

    3 thèmes sont proposés à l’origine par MédiaSPIP. L’utilisateur MédiaSPIP peut rajouter des thèmes selon ses besoins.
    Thèmes MediaSPIP
    3 thèmes ont été développés au départ pour MediaSPIP : * SPIPeo : thème par défaut de MédiaSPIP. Il met en avant la présentation du site et les documents média les plus récents ( le type de tri peut être modifié - titre, popularité, date) . * Arscenic : il s’agit du thème utilisé sur le site officiel du projet, constitué notamment d’un bandeau rouge en début de page. La structure (...)

Sur d’autres sites (3762)

  • Python Discord music bot stops playing a couple of minutes into any song

    9 mars 2023, par knewby

    I am trying to put together a Python Discord music bot as a fun little project. Outside of the required discord library I'm currently using the YouTube API to search for videos and parse the URL (not shown in code), yt-dlp which is a fork of yt_download that is still maintained to get the info from the YT URL, and FFMPEG to play the song obtained from yt-dlp through the bot. My play command seems to work as the 1st YT video result will start to play, but roughly 30-90 seconds into the audio, it stops playing. I get this message in the console :

    


    2023-02-23 14:54:44 IN discord.player ffmpeg process 4848 successfully terminated with return code of 0.

    


    So there is no error for me to go off of. I've included the full output from the console below...

    


    -----------------------------------
groovy-jr#6741 is up and running
-----------------------------------
2023-02-23 14:53:23 INFO     discord.voice_client Connecting to voice...
2023-02-23 14:53:23 INFO     discord.voice_client Starting voice handshake... (connection attempt 1)
2023-02-23 14:53:24 INFO     discord.voice_client Voice handshake complete. Endpoint found us-south1655.discord.media
2023-02-23 14:54:44 INFO     discord.player ffmpeg process 4848 successfully terminated with return code of 0.  <= AUDIO STOPS


    


    I'm currently developing this project on a Windows 11 machine, but I've had the issue running it on my Ubuntu machine as well. I am just hosting the bot directly from the VSCode terminal for development.

    


    I've been trying to do research on this problem, the problem is I can't find many recent information for the issue. There was another post that talked about a similar problem and had an answer suggesting the following FFMPEG options be used which I tried to no avail.

    


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


    


    I'll include the problem file below :

    


    import discord
from discord.ext import commands
from discord import FFmpegPCMAudio
import responses
import youtubeSearch as YT
import yt_dlp

async def send_message(message, user_message, is_private = False):
    try:
        response = responses.handle_response(user_message)
        await message.author.send(response) if is_private else await message.channel.send(response)
    except Exception as e:
        print(e)

def run_discord_bot():
    intents = discord.Intents.default()
    intents.message_content = True

    TOKEN = 'xxxxxx'
    client = commands.Bot(command_prefix = '-', intents=intents)

    @client.event
    async def on_ready():
        print('-----------------------------------')
        print(f'{client.user} is up and running')
        print('-----------------------------------')

    @client.command(name='play', aliases=['p'], pass_context = True)
    async def play(ctx, *, search_term:str = None):
        if ctx.author.voice:
            voice = None
            if search_term == None:
                await ctx.send('No song specified.')
                return
            if not ctx.voice_client:
                channel = ctx.message.author.voice.channel
                voice = await channel.connect()
            else:
                voice = ctx.guild.voice_client
            
            url = YT.singleSearch(search_term)
            
            YTDLP_OPTIONS = {
                'format': 'bestaudio/best',
                'extractaudio': True,
                'audioformat': 'mp3',
                'outtmpl': '%(extractor)s-%(id)s-%(title)s.%(ext)s',
                'restrictfilenames': True,
                'noplaylist': True,
                'nocheckcertificate': True,
                'ignoreerrors': False,
                'logtostderr': False,
                'quiet': True,
                'no_warnings': True,
                'default_search': 'ytsearch',
                'source_address': '0.0.0.0',
            }

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

            with yt_dlp.YoutubeDL(YTDLP_OPTIONS) as ydl:
                info = ydl.extract_info(url, download=False)
                playUrl = info['url']

            source = FFmpegPCMAudio(playUrl, options=FFMPEG_OPTIONS)
            voice.play(source)
        else:
            await ctx.send('You must be in a voice channel to play a song!')
            return

    @client.command(pass_context = True)
    async def leave(ctx):
        if ctx.voice_client:
            await ctx.guild.voice_client.disconnect()
        else:
            await ctx.send("I'm not in a voice channel!")

    @client.command(pass_context = True)
    async def pause(ctx):
        voice = discord.utils.get(client.voice_clients, guild = ctx.guild)
        if voice.is_playing():
            voice.pause()
        else:
            await ctx.send('No audio playing...')

    @client.command(pass_context = True)
    async def resume(ctx):
        voice = discord.utils.get(client.voice_clients, guild = ctx.guild)
        if voice.is_paused():
            voice.resume()
        else:
            await ctx.send('No audio paused...')

    @client.command(pass_context = True)
    async def stop(ctx):
        voice = discord.utils.get(client.voice_clients, guild = ctx.guild)
        voice.stop()

    client.run(TOKEN)


    


    I appreciate any guidance I can get !

    


  • music bot stops after playing music for 30-50 secs

    19 mars 2023, par ra1nb0w
    const { QueryType } = require("discord-player")&#xA;const player = require("../../client/player")&#xA;const Discord = require(&#x27;discord.js&#x27;)&#xA;&#xA;module.exports = {&#xA;    name: &#x27;play&#x27;,&#xA;    cooldown: 5,&#xA;    aliases: [&#x27;p&#x27;],&#xA;    description: "Plays a song",&#xA;    usage: "?p <song></song>vid-URL>",&#xA;    category: "Music",&#xA;&#xA;    async execute(client, message, args) {&#xA;        const songTitle = args.join(" ")&#xA;        const queue = await player.createQueue(message.guild);&#xA;        const nosongEmbed = new Discord.MessageEmbed()&#xA;            .setColor(&#x27;#3d35cc&#x27;)&#xA;            .setDescription(`‼️ - Please provide a song URL or song name!`)&#xA;&#xA;        if (!songTitle) return message.reply({ embeds: [nosongEmbed] })&#xA;        &#xA;&#xA;        const novcEmbed = new Discord.MessageEmbed()&#xA;            .setColor(&#x27;#3d35cc&#x27;)&#xA;            .setDescription(`‼️ - You have to be in a Voice Channel to use this command!`)&#xA;&#xA;        if (!message.member.voice.channel) return message.reply({ embeds: [novcEmbed] })&#xA;        if (!queue.connection) await queue.connect(message.member.voice.channel)&#xA;&#xA;        let url = songTitle&#xA;            &#xA;            // Search for the song using the discord-player&#xA;            const result = await player.search(url, {&#xA;                requestedBy: message.author,&#xA;                searchEngine: QueryType.AUTO&#xA;            })&#xA;&#xA;            // finish if no tracks were found&#xA;            if (result.tracks.length === 0)&#xA;                return message.reply("No results")&#xA;&#xA;            // Add the track to the queue&#xA;            const song = result.tracks[0]&#xA;            await queue.addTrack(song)&#xA;            const embed = new Discord.MessageEmbed()&#xA;                .setColor("AQUA")&#xA;                .setDescription(`**[${song.title}](${song.url})** has been added to the Queue`)&#xA;                .setThumbnail(song.thumbnail)&#xA;                .setFooter({ text: `Duration: ${song.duration}`})&#xA;            message.reply({ embeds: [embed] })&#xA;            if (!queue.playing) await queue.play()&#xA;            &#xA;&#xA;            &#xA;&#xA;        }&#xA;        &#xA;    }&#xA;&#xA;

    &#xA;

    i used the command then the song just stops playing after 30-50 seconds, it is supposed to play till the music finishes and then keep staying in the voice channel until a few mins of no music

    &#xA;

    i have reinstalled ffmpeg

    &#xA;

    using :&#xA;discord.js : 13.14.0&#xA;discord-player : 5.2.2

    &#xA;

  • 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

    &#xA;

    bot.player = new Player(bot, {&#xA;    ytdlOptions: {&#xA;        quality: &#x27;lowestaudio&#x27;,&#xA;        highWaterMark: 1 >> 25&#xA;    },&#xA;})&#xA;&#xA;const player = bot.player;&#xA;&#xA;//play command &#xA;&#xA;&#xA;bot.on(&#x27;interactionCreate&#x27;, async interaction =>{&#xA;    if(interaction.commandName === &#x27;play&#x27;) {&#xA;&#xA;        const song = interaction.options.get(&#x27;song&#x27;).value;&#xA;        const res = await player.search(song, {&#xA;            searchEngine: QueryType.SPOTIFY_SONG&#xA;        });&#xA;&#xA;&#xA;        if (!res || !res.tracks.length) return interaction.reply({ content: `No results found ${interaction.member}... try again ? ❌`, ephemeral: true });&#xA;&#xA;        const queue = await player.createQueue(interaction.guild)&#xA;&#xA;        if (!queue.connection) await queue.connect(interaction.member.voice.channel);&#xA;&#xA;&#xA;        await interaction.channel.send({ content:`Loading your ${res.playlist ? &#x27;playlist&#x27; : &#x27;track&#x27;}... &#127911;`});&#xA;&#xA;        const track = await res.tracks[0]&#xA;&#xA;        console.log(track)&#xA;        if(!track)  return interaction.channel.send({content: &#x27;No song found&#x27;});&#xA;&#xA;        queue.addTrack(track)&#xA;&#xA;        queue.play();&#xA;&#xA;    }&#xA;})&#xA;

    &#xA;

    After leaving the channel, other commands and bot work fine

    &#xA;