Recherche avancée

Médias (0)

Mot : - Tags -/tags

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (65)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

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

Sur d’autres sites (12219)

  • Discord.js music bot : TypeError : this.inputMedia.pipe is not a function

    7 août 2019, par Ivs

    I’m writing a music Discord bot using Discord.js. The bot uses ytdl-core, node-opus, and I have installed ffmpeg on my OS (Ubuntu 19.04). When I try to make the bot join a voice channel and start playing a YouTube URL, it throws the following error :

    TypeError: this.inputMedia.pipe is not a function
       at FfmpegProcess.connectStream (/home/ivan/.../node_modules/discord.js/node_modules/prism-media/src/transcoders/ffmpeg/FfmpegProcess.js:73:21)
       at new FfmpegProcess (/home/ivan/.../node_modules/discord.js/node_modules/prism-media/src/transcoders/ffmpeg/FfmpegProcess.js:28:14)
       at FfmpegTranscoder.transcode (/home/ivan/.../node_modules/discord.js/node_modules/prism-media/src/transcoders/ffmpeg/Ffmpeg.js:34:18)
       at MediaTranscoder.transcode (/home/ivan/.../node_modules/discord.js/node_modules/prism-media/src/transcoders/MediaTranscoder.js:27:31)
       at Prism.transcode (/home/ivan/.../node_modules/discord.js/node_modules/prism-media/src/Prism.js:13:28)
       at AudioPlayer.playUnknownStream (/home/ivan/.../node_modules/discord.js/src/client/voice/player/AudioPlayer.js:97:35)
       at VoiceConnection.playStream (/home/ivan/.../node_modules/discord.js/src/client/voice/VoiceConnection.js:478:24)
       at voiceChannel.join.then.connection (/home/ivan/.../commands/play.js:32:47)
       at process._tickCallback (internal/process/next_tick.js:68:7)

    Here is my code :

    const ytdl = require("ytdl-core");

    exports.run = (client, message, args, config) => {
       return new Promise((resolve, reject) => {
           if (args.length !== 1) {
               message.channel.send("Play command takes 1 YouTube link.");
               reject("Wrong number of arguments");
               return;
           }
           const voiceChannel = message.member.voiceChannel;
           if(!voiceChannel) {
               message.channel.send("You need to connect to a voice channel first");
               reject("Not connected to voice channel");
               return;
           }
           const perms = voiceChannel.permissionsFor(message.client.user);
           if (!perms.has("CONNECT")) {
               message.channel.send("You need to add the 'connect' permission for this bot");
               reject("NO CONNECT PERMISSION");
               return;
           }
           if (!perms.has("SPEAK")) {
               message.channel.send("You need to add the 'speak' permission for this bot");
               reject("NO SPEAK PERMISSION");
               return;
           }
           const streamOptions = { seek: 0, volume: 1, passes: 2 };
           voiceChannel.join()
               .then(connection => {
                   const stream = ytdl(args[0], {filter: 'audioonly'});
                   const dispatcher = connection.playStream(ytdl, streamOptions);
                   dispatcher.on("end", reason => {
                       console.log("reason: " + reason);
                       voiceChannel.leave();
                   })
                   dispatcher.on("error", err => {
                       console.log(err);
                   })
               })
           .catch(err => console.log(err));
       });    
    }

    I have tried reinstalling ffmpeg, node and npm, discord.js and node-opus. I have the newest version of Discord.js installed, and ffmpeg version 4.1.3-0ubuntu1. Anyone have any suggestions ?

    Thanks.

  • Discord.py music bot doesn't play next song in queue

    10 mai 2019, par Lewis H

    This is my code for the bot I’m trying to create, it plays the music fine.

    ytdl_options = {
       'format': 'bestaudio/best',
       'restrictfilenames': True,
       'noplaylist': True,
       'nocheckcertificate': True,
       'quiet':True,
       'ignoreerrors': False,
       'logtostderr': False,
       'no_warnings': True,
       'default_search': 'auto',
       'source_address': '0.0.0.0' # using ipv4 since ipv6 addresses causes issues sometimes
       }


           # ffmpeg options
    ffmpeg_options= {
       'options': '-vn'
       }



    @bot.command()
    async def play(ctx, url:str = None):
       queue = {}

       channel = ctx.author.voice.channel    
       if ctx.voice_client is not None:  
           await ctx.voice_client.move_to(channel)
       elif ctx.author.voice and ctx.author.voice.channel:      
           await channel.connect()

       if not url:
           await ctx.send("Try adding a URL. e.g. !play https://youtube.com/watch?v=XXXXXXXXX")

       if ctx.voice_client is not None:
           vc = ctx.voice_client #vc = voice client, retrieving it
           ytdl = youtube_dl.YoutubeDL(ytdl_options)


           loop = asyncio.get_event_loop()
           data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url))

           if 'entries' in data:
               data = data['entries'][0]
           svr_id = ctx.guild.id
           if svr_id in queue:
               queue[svr_id].append(data)

           else:
               queue[svr_id] = [data]
           await ctx.send(data.get('title') + " added to queue")

           source = ytdl.prepare_filename(queue[svr_id][0])
           def pop_queue():
               if queue[svr_id] != []:
                   queue[svr_id].pop(0)
                   data = queue[svr_id][0]
               else:
                   vc.stop()

           if not vc.is_playing():
               vc.play(discord.FFmpegPCMAudio(source, **ffmpeg_options), after=lambda: pop_queue())

    The next song downloads and queues it fine, but once the first song finishes, it doesn’t play the next one. I can’t figure out how to make it play after the first song has commenced. I have the after= set to remove the top item of the queue, but how do I get it to play again ? Thanks

  • My own music bot randomly stops when playing a song, no errors, just like the song has ended

    18 avril 2019, par Stasio

    I made a discord music bot but there is one problem :
    When i play something it works perfectly for a moment but then sometimes music ends in the middle of the song just like the song has ended.
    When there are some songs in queue and this bug happens the bot starts playing another song from the queue. Im using ffmpeg, ytdl-core, simple-youtube-api,
    opusscript. What do u guys think about it ? I don’t think that this problem is caused by my code cuz this error happens randomly, sometimes 3 songs in a row are played normaly and sometimes it crashes in the middle of the 1 song, so he starts playing the next song in queue.

    const arg = msg.content.split(' ');
    const searchString = arg.slice(1).join(' ');
    const url = arg[1] ? arg[1].replace(/<(.+)>/g, '$1') : '';
    const serverQueue = queue.get(msg.guild.id);

    let command = msg.content.toLowerCase().split(' ')[0];
    command = command.slice(PREFIX.length)

    if (command === 'play' || command === 'p') {
    msg.delete()
    const voiceChannel = msg.member.voiceChannel;
    let emoji = msg.guild.emojis.find(x => x.name === "2Head")
       if (!voiceChannel) return msg.channel.send('Nie jesteś nawet na kanale głosowym zjebie ' + emoji);
       const permissions = voiceChannel.permissionsFor(msg.client.user);
       if (!permissions.has('CONNECT')) {
           return msg.channel.send('Nie mam permisji zeby sie polaczyc ;/');
       }
       if (!permissions.has('SPEAK')) {
           return msg.channel.send('Nie moge mowic odmutujcie mnie : )');
       }

       if (url.match(/^https?:\/\/(www.youtube.com|youtube.com)\/playlist(.*)$/)) {
           const playlist = await youtube.getPlaylist(url);
           const videos = await playlist.getVideos();
           for (const video of Object.values(videos)) {
               const video2 = await youtube.getVideoByID(video.id);
               await handleVideo(video2, msg, voiceChannel, true);
           }
           return msg.channel.send(`✅ Playlist: **${playlist.title}** has been added to the queue!`);
       } else {
           try {
               var video = await youtube.getVideo(url);
           } catch (error) {
               try {
                   var videos = await youtube.searchVideos(searchString, 1);
                   var video = await youtube.getVideoByID(videos[0].id);
               } catch (err) {
         console.error(err);
         let emoji = msg.guild.emojis.find(x => x.name === "autism")
                   return msg.channel.send('Nie ma takiego filmu na całym youtubie ' + emoji );
               }
           }
           return handleVideo(video, msg, voiceChannel);
       }
    }