Recherche avancée

Médias (0)

Mot : - Tags -/serveur

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

Autres articles (35)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • Other interesting software

    13 avril 2011, par

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website : http://videopress.com/
    License : GNU/GPL v2
    Source code : (...)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

Sur d’autres sites (6098)

  • Need Help Making Java Script Discord Music Bot

    22 octobre 2018, par Gambino

    I have tried to use this code to make a discord music bot but i am getting error telling me i need ffmpeg, but how would I implement it into this code ?

    index.js file

    const Discord = require('discord.js');
    const bot = new Discord.Client();
    const config = require("./config.json");
    const ytdl = require('ytdl-core');

    var youtube = require('./youtube.js');


    var ytAudioQueue = [];
    var dispatcher = null;

    bot.on('message', function(message) {
       var messageParts = message.content.split(' ');
       var command = messageParts[0].toLowerCase();
       var parameters = messageParts.splice(1, messageParts.length);

       switch (command) {

           case "-join" :
           message.reply("Attempting to join channel " + parameters[0]);
           JoinCommand(parameters[0], message);
           break;
       
           case "-play" :
           PlayCommand(parameters.join(" "), message);
           break;

           case "-playqueue":
           PlayQueueCommand(message);
           break;
       }
    });


       function PlayCommand(searchTerm) {
           if(bot.voiceConnections.array().length == 0) {
               var defaultVoiceChannel = bot.channels.find(val => val.type === 'voice').name;
               JoinCommand(defaultVoiceChannel);
           }
           youtube.search(searchTerm, QueueYtAudioStream);
       }

       function PlayQueueCommand(message) {
           var queueString = "";

           for(var x = 0; x < ytAudioQueue.length; x++) {
               queueString += ytAudioQueue[x].videoName + ", ";
           }
           queueString = queueString.substring(0, queueString.length - 2);
           message.reply(queueString);
       }

       function JoinCommand(ChannelName) {
           var voiceChannel = GetChannelByName(ChannelName);

           if (voiceChannel) {
               voiceChannel.join();
               console.log("Joined " + voiceChannel.name);
           }
           
           return voiceChannel;
           
       }

       /* Helper Methods */

       function GetChannelByName(name) {
           var channel = bot.channels.find(val => val.name === name);
           return channel;
       }

     

       function QueueYtAudioStream(videoId, videoName) {
           var streamUrl = youtube.watchVideoUrl + videoId;

           if (!ytAudioQueue.length) {
               ytAudioQueue.push(
                   {
                       'streamUrl' : streamUrl,
                       'videoName' : videoName
                   }
               );
               console.log('Queued audio ' + videoName);
               PlayStream(ytAudioQueue[0].streamUrl);
           }
           else {
               ytAudioQueue.push(
                   {
                       'streamUrl' : streamUrl,
                       'videoName' : videoName
                   }
               );
           }
           console.log("Queued audio " + videoName);
       }

       function PlayStream(streamUrl) {
           const streamOptions = {seek: 0, volume: 1};

           if (streamUrl) {
               const stream = ytdl(streamUrl, {filter: 'audioonly'});

               if (dispatcher == null) {
                   var voiceConnection = bot.voiceConnections.first();

                   if(voiceConnection) {
                       console.log("Now Playing " + ytAudioQueue[0].videoname);
                       dispatcher = bot.voiceConnections.first().playStream(stream, streamOptions);

                       dispatcher.on('end', () => {
                           dispatcher = null;
                           PlayNextStreamInQueue();
                       });

                       dispatcher.on('error', (err) => {
                           console.log(err);
                       });
                   }
               } else {
                   dispatcher = bot.voiceConnections.first().playStream(stream, streamOptions);
               }
               
           }
       }

       function PlayNextStreamInQueue() {
           ytAudioQueue.splice(0, 1);

           if (ytAudioQueue.length != 0) {
               console.log("now Playing " + ytAudioQueue[0].videoName);
               PlayStream(ytAudioQueue[0].streamUrl);
           }
       }


    bot.login(config.token);

    youtube.js file

    var request = require('superagent');

    const API_KEY = "My API KEY";
    const WATCH_VIDEO_URL = "https://www.youtube.com/watch?v=";

    exports.watchVideoUrl = WATCH_VIDEO_URL;

    exports.search = function search(searchKeywords, callback) {
     var requestUrl = 'https://www.googleapis.com/youtube/v3/search' + '?part=snippet&q=' + escape(searchKeywords) + '&key=' + API_KEY;

     request(requestUrl, (error, response) => {
       if (!error && response.statusCode == 200) {

         var body = response.body;
         if (body.items.length == 0) {
           console.log("I Could Not Find Anything!");
           return;
         }
         for (var item of body.items) {
           if (item.id.kind == 'youtube#video') {
             callback(item.id.videoId, item.snippet.title);
             return;
           }
         }
       } else {
         console.log("Unexpected error!");
         return;
       }
     });

     return;

    };

    Error I am getting when I try to run code :

    Joined General

    C :\Discord Bot\node_modules\discord.js\src\client\voice\pcm\FfmpegConverterEngine.

    js:80

    throw new Error(

    ^

    Error : FFMPEG was not found on your system, so audio cannot be played. Please make
    sure FFMPEG is installed and in your PATH.

  • Discord Music bot dosnt play Livestreams anymore

    11 janvier 2019, par Silvinator

    My Discord bot played YT Livestreams all the time, but it stoped working today. The only message i get (in the console) is stream. It plays normal videos, but no streams. the question is, why it stopped working. I did not change any code. Anyone got a idea ?

    client.on("message", async message => {
       var args = message.content.substring(prefix.length).split(" ");
       if (!message.content.startsWith(prefix)) return;
     var searchString = args.slice(1).join(' ');
            var url = args[1] ? args[1].replace(/<(.+)>/g, '$1') : '';
            var serverQueue = queue.get(message.guild.id);
       switch (args[0].toLowerCase()) {
         case "play":
       var voiceChannel = message.member.voiceChannel;
                    if (!voiceChannel) return message.channel.send(`Du willst mit mir Karaoke singen? Da ich eh nichts besseres zu tun habe. Du suchst aber den Voice Channel aus!`);
                    var permissions = voiceChannel.permissionsFor(message.client.user);
                    if (!permissions.has('CONNECT')) {
                            return message.channel.send('I cannot connect to your voice channel, make sure I have the proper permissions!');
                    }
                    if (!permissions.has('SPEAK')) {
                            return message.channel.send('I cannot speak in this voice channel, make sure I have the proper permissions!');
                    }
         if (url.match(/^https?:\/\/(www.youtube.com|youtube.com)\/playlist(.*)$/)) {
                            var playlist = await youtube.getPlaylist(url);
                            var videos = await playlist.getVideos();
                            for (const video of Object.values(videos)) {
                                    var video2 = await youtube.getVideoByID(video.id); // eslint-disable-line no-await-in-loop
                                    await handleVideo(video2, message, voiceChannel, true); // eslint-disable-line no-await-in-loop
                            }
                            return message.channel.send(`Ich habe wohl keine andere wahl... Ich habe **${playlist.title}** der playlist zugefügt`);
                    } else {
                            try {
                                    var video = await youtube.getVideo(url);
                            } catch (error) {
                                    try {
                                            var videos = await youtube.searchVideos(searchString, 10);
                                            var index = 0;
                                            var videoIndex = 1;
                                            var video = await youtube.getVideoByID(videos[videoIndex - 1].id);
                                    } catch (err) {
                                            console.error(err);
                                            return message.channel.send('Gibt es den Song überhaupt?');
                                    }
                            }
                            return handleVideo(video, message, voiceChannel);
                    }
    break;
         case "skip":
                    if (!message.member.voiceChannel) return message.channel.send('Du musst schon in den Voice Channel gehen, baka!');
                    if (!serverQueue) return message.channel.send('Du musst schon ein song auswählen, baka!');
                    serverQueue.connection.dispatcher.end('Skip command has been used!');
                    return undefined;
           break;
         case "stop":
                    if (!message.member.voiceChannel) return message.channel.send('Du musst schon in den Voice Channel gehen, baka!');
                    if (!serverQueue) return message.channel.send('Du musst schon einen Song auswählen, baka');
       serverQueue.connection.dispatcher.end('Stop command has been used!');
                    serverQueue.songs = [];
                    return undefined;
    break;
         case "minfo":
                    if (!serverQueue) return message.channel.send('Ich spiele immer noch nichts!');
                    return message.channel.send(`ퟎ
  • Music bot doesn't play livestreams anymore

    31 janvier 2019, par Silvinator

    My Discord bot played YT Livestreams all the time, but it stopped working today. The only message I get (in the console) is stream. It plays normal videos, but no streams.
    The question is, why it stopped working ? I did not change any code. Anyone got a idea ?

    client.on("message", async message => {
     var args = message.content.substring(prefix.length).split(" ");
     if (!message.content.startsWith(prefix)) return;
     var searchString = args.slice(1).join(' ');
     var url = args[1] ? args[1].replace(/<(.+)>/g, '$1') : '';
     var serverQueue = queue.get(message.guild.id);
     switch (args[0].toLowerCase()) {
       case "play":
         var voiceChannel = message.member.voiceChannel;
         if (!voiceChannel) return message.channel.send(`Du willst mit mir Karaoke singen? Da ich eh nichts besseres zu tun habe. Du suchst aber den Voice Channel aus!`);
         var permissions = voiceChannel.permissionsFor(message.client.user);
         if (!permissions.has('CONNECT')) {
           return message.channel.send('I cannot connect to your voice channel, make sure I have the proper permissions!');
         }
         if (!permissions.has('SPEAK')) {
           return message.channel.send('I cannot speak in this voice channel, make sure I have the proper permissions!');
         }
         if (url.match(/^https?:\/\/(www.youtube.com|youtube.com)\/playlist(.*)$/)) {
           var playlist = await youtube.getPlaylist(url);
           var videos = await playlist.getVideos();
           for (const video of Object.values(videos)) {
             var video2 = await youtube.getVideoByID(video.id); // eslint-disable-line no-await-in-loop
             await handleVideo(video2, message, voiceChannel, true); // eslint-disable-line no-await-in-loop
           }
           return message.channel.send(`Ich habe wohl keine andere wahl... Ich habe **${playlist.title}** der playlist zugefügt`);
         } else {
           try {
             var video = await youtube.getVideo(url);
           } catch (error) {
             try {
               var videos = await youtube.searchVideos(searchString, 10);
               var index = 0;
               var videoIndex = 1;
               var video = await youtube.getVideoByID(videos[videoIndex - 1].id);
             } catch (err) {
               console.error(err);
               return message.channel.send('Gibt es den Song überhaupt?');
             }
           }
           return handleVideo(video, message, voiceChannel);
         }
         break;
       case "skip":
         if (!message.member.voiceChannel) return message.channel.send('Du musst schon in den Voice Channel gehen, baka!');
         if (!serverQueue) return message.channel.send('Du musst schon ein song auswählen, baka!');
         serverQueue.connection.dispatcher.end('Skip command has been used!');
         return undefined;
         break;
       case "stop":
         if (!message.member.voiceChannel) return message.channel.send('Du musst schon in den Voice Channel gehen, baka!');
         if (!serverQueue) return message.channel.send('Du musst schon einen Song auswählen, baka');
         serverQueue.connection.dispatcher.end('Stop command has been used!');
         serverQueue.songs = [];
         return undefined;
         break;
       case "minfo":
         if (!serverQueue) return message.channel.send('Ich spiele immer noch nichts!');
         return message.channel.send(`ퟎ