
Recherche avancée
Médias (91)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
-
avec chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
sans chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
config chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
Autres articles (11)
-
Supporting all media types
13 avril 2011, parUnlike 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, parDans 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 20133 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)
-
Discord slash command music bot stops playing unexpectedly
29 juillet 2023, par ShelbyThis is a bot I am using to play music and it worked just fine for a while until it didn't. Simply loaded the bot and played for about a minute and quits. From what I see it destroys the entire queue of songs, no matter how many are there. And after that it won't respond to any command and it needs to be reloaded. I don't get any error in the terminal and all the other commands seem to work just fine. Also, this happens to whatever query I use, whether it's 'search', 'url' or 'playlist'.


const { SlashCommandBuilder } = require("@discordjs/builders")
const { EmbedBuilder } = require("discord.js")
const { QueryType } = require("discord-player")

module.exports = {
 data: new SlashCommandBuilder()
 .setName("play")
 .setDescription("Asculta muzica")
 .addSubcommand((subcommand)=>
 subcommand
 .setName("song")
 .setDescription("Incarca o singura melodie printr-un url")
 .addStringOption((option) => option.setName("url").setDescription("url-ul melodiei").setRequired(true)))
 .addSubcommand((subcommand) =>
 subcommand
 .setName("playlist")
 .setDescription("Incarca un playlist printr-un url")
 .addStringOption((option) => option.setName("url").setDescription("url-ul playlist-ului").setRequired(true)))
 .addSubcommand((subcommand) =>
 subcommand
 .setName("search")
 .setDescription("Cauta o melodie pe baza cuvintelor-cheie")
 .addStringOption((option) => 
 option.setName("cautare").setDescription("cauta dupa titlu si autor").setRequired(true))),
 
 run: async ({ client, interaction }) => {
 if (!interaction.member.voice.channel)
 return interaction.editReply("Trebuie sa fii pe un voice channel pentru a folosi aceasta comanda!")

 const queue = await client.player.createQueue(interaction.guild)
 if (!queue.connection) await queue.connect(interaction.member.voice.channel)

 let embed = new EmbedBuilder()

 if (interaction.options.getSubcommand() === "song"){
 let url = interaction.options.getString("url")
 const result = await client.player.search(url, {
 requestedBy: interaction.user,
 searchEngine: QueryType.YOUTUBE_VIDEO
 })

 if (result.tracks.length === 0)
 return interaction.editReply("Niciun rezultat")

 const song = result.tracks[0]
 await queue.addTrack(song)
 embed
 .setColor(0xF07459)
 .setDescription(`**[${song.title}](${song.url})** a fost adaugata`)
 .setThumbnail(song.thumbnail)
 .setFooter({ text: `Durata: ${song.duration}`})

 } else if (interaction.options.getSubcommand() === "playlist"){
 let url = interaction.options.getString("url")
 const result = await client.player.search(url, {
 requestedBy: interaction.user,
 searchEngine: QueryType.YOUTUBE_PLAYLIST
 })

 if (result.tracks.length === 0)
 return interaction.editReply("Niciun rezultat")

 const playlist = result.playlist
 await queue.addTracks(result.tracks)
 embed
 .setColor(0xF07459)
 .setDescription(`**${result.tracks.length} melodii din [${playlist.title}](${playlist.url})** au fost adaugate`)

 } else if (interaction.options.getSubcommand() === "search"){
 let url = interaction.options.getString("cautare")
 const result = await client.player.search(url, {
 requestedBy: interaction.user,
 searchEngine: QueryType.AUTO
 })

 if (result.tracks.length === 0)
 return interaction.editReply("Niciun rezultat")

 const song = result.tracks[0]
 await queue.addTrack(song)
 embed
 .setColor(0xF07459)
 .setDescription(`**[${song.title}](${song.url})** a fost adaugata`)
 .setThumbnail(song.thumbnail)
 .setFooter({ text: `Durata: ${song.duration}`})
 }
 if (!queue.playing) await queue.play()
 await interaction.editReply({
 embeds: [embed]
 })
 
 }
}



This is the code for the [play] command. No change was done since it worked perfectly.


After some research I found out that there might be a problem with the ffmpeg or the ytdl. I tried updating or reinstalling them, but the problem still remains. I would like to know if I'll need to rework the bot to find an alternative to these two.


-
Problem settingup a play command for my discord bot (music) ['Error : FFmpeg/avconv not found !']
28 août 2023, par TitanFrexIm new to programing a discord bot, im more to the web developing enviroment, im trying to create by myself a play command song (only with one link) to try if the first join is working and actually play the song.


(Discord.js v14)


Unfortunately i was having a problem with FFMPEG.
This my actual module for the play.js command, where all the problem is happening.


const { joinVoiceChannel, createAudioPlayer, createAudioResource } = require('@discordjs/voice');
const ytdl = require('ytdl-core');

module.exports = {
 devOnly: true,
 name: 'play',
 description: 'Start to play a song!',
 // options: Object[],

 /**
 *
 * @param {Client} client
 * @param {Interaction} interaction
 */
 callback: async (client, interaction) => {
 const voiceChannel = interaction.member.voice.channel;

 if (!voiceChannel) {
 return interaction.reply('You must be in a voice channel to use this command.');
 }

 const connection = joinVoiceChannel({
 channelId: voiceChannel.id,
 guildId: interaction.guild.id,
 adapterCreator: interaction.guild.voiceAdapterCreator,
 });

 const stream = ytdl('URL_HERE', { filter: 'audioonly' });
 const resource = createAudioResource(stream);

 const player = createAudioPlayer();
 connection.subscribe(player);
 player.play(resource);

 interaction.reply({
 content: `Playing Song`,
 // ephemeral: true,
 });
 }
}



The first error i was receving was 'Error : FFmpeg/avconv not found !', i tried to install it with some guides online. after couple of tries i get it right and the command 'ffmpeg -version' returns.


After that i tought it was workikng, but when i started my project, i receved the same error,. I tried to look up for a solution and i tried to get the process.env.PATH to see but i dont understand if its right or not.


After i removed the console.log(process.env.PATH), i get no errors in the terminal, but it will stil not play the song.


-
Discord music bot doesn't play songs
9 octobre 2023, par Gam3rsCZI have made myself a discord bot that also plays music(it's only for my server so strings with messages are in Czech, but code is in English).
Bot worked a while ago but now it stopped, and I don't know where the problem is


I'm getting these errors : HTTP error 403 Forbidden Server returned 403 Forbidden (access denied) and
C :\Users\Me\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\player.py:711 : RuntimeWarning : coroutine 'music_cog.play_next' was never awaited
self.after(error)
RuntimeWarning : Enable tracemalloc to get the object allocation traceback
[2023-10-09 16:23:47] [INFO ] discord.player : ffmpeg process 17496 successfully terminated with return code of 1.
INFO : ffmpeg process 17496 successfully terminated with return code of 1.


My code is :


import discord
from discord.ext import commands
from yt_dlp import YoutubeDL

class music_cog(commands.Cog):
 def __init__(self, bot):
 self.bot = bot

 self.is_playing = False
 self.is_paused = False
 self.current = ""

 self.music_queue = []
 self.YDL_OPTIONS = {"format": "m4a/bestaudio/best", "noplaylist": "True"}
 self.FFMPEG_OPTIONS = {"before_options": "-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5", "options": "-vn"}

 self.vc = None

 def search_yt(self, item):
 with YoutubeDL(self.YDL_OPTIONS) as ydl:
 try:
 info = ydl.extract_info("ytsearch:%s" % item, download=False)["entries"][0]
 except Exception:
 return False
 info = ydl.sanitize_info(info)
 url = info['url']
 title = info['title']
 return {'title': title, 'source': url}

 async def play_next(self):
 if len(self.music_queue) > 0:
 self.is_playing = True
 self.current = self.music_queue[0][0]["title"]
 m_url = self.music_queue[0][0]["source"]

 self.music_queue.pop(0)

 await self.vc.play(discord.FFmpegPCMAudio(m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())
 else:
 self.is_playing = False

 async def play_music(self, ctx):
 try:
 if len(self.music_queue) > 0:
 self.is_playing = True
 m_url = self.music_queue[0][0]["source"]

 if self.vc == None or not self.vc.is_connected():
 self.vc = await self.music_queue[0][1].connect()

 if self.vc == None:
 await ctx.send("Nepodařilo se připojit do hlasového kanálu.")
 return
 else:
 await self.vc.move_to(self.music_queue[0][1])

 self.current = self.music_queue[0][0]["title"]
 self.music_queue.pop(0)

 self.vc.play(discord.FFmpegPCMAudio(m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())
 else:
 self.is_playing = False

 except:
 print("Something went wrong")
 await ctx.send(content="Něco se pokazilo")

 @commands.command(name="play", help="Plays selected song from YouTube")
 async def play(self, ctx, *args):
 query = " ".join(args)

 voice_channel = ctx.author.voice.channel
 if voice_channel is None:
 await ctx.send("Připojte se do hlasového kanálu!")
 elif self.is_paused:
 self.vc.resume()
 else:
 song = self.search_yt(query)
 if type(song) == type(True):
 await ctx.send("Písničku se nepodařilo stáhnout. Špatný formát, možná jste se pokusili zadat playlist nebo livestream.")
 else:
 await ctx.send("Písnička přidána do řady.")
 self.music_queue.append([song, voice_channel])

 if self.is_playing == False:
 await self.play_music(ctx)
 self.is_playing = True

 @commands.command(name="pause", aliases=["p"], help="Pauses the BOT")
 async def pause(self, ctx, *args):
 if self.is_playing:
 self.is_playing = False
 self.is_paused = True
 self.vc.pause()
 await ctx.send(content="Písnička byla pozastavena.")
 
 elif self.is_paused:
 self.is_playing = True
 self.is_paused = False
 self.vc.resume()
 await ctx.send(content="Písnička byla obnovena.")

 @commands.command(name="resume", aliases=["r"], help="Resumes playing")
 async def resume(self, ctx, *args):
 if self.is_paused:
 self.is_paused = False
 self.is_playing = True
 self.vc.resume()
 await ctx.send(content="Písnička byla obnovena.")

 @commands.command(name="skip", aliases=["s"], help="Skips current song")
 async def skip(self, ctx, *args):
 if self.vc != None and self.vc:
 self.vc.stop()
 await self.play_next()
 await ctx.send(content="Písnička byla přeskočena.")

 @commands.command(name="queue", aliases=["q"], help="Displays song queue")
 async def queue(self, ctx, songs=5):
 retval = ""

 for i in range(0, len(self.music_queue)):
 if i > songs: break
 retval += " " + self.music_queue[i][0]["title"] + "\n"

 if retval != "":
 retval += "```"
 await ctx.send(content=("```Aktuální fronta:\n" + retval))
 else:
 await ctx.send("Řada je prázdná.")

 @commands.command(name="clear", help="Clears the queue")
 async def clear(self, ctx):
 if self.vc != None and self.is_playing:
 self.vc.stop()
 self.music_queue = []
 await ctx.send("Řada byla vymazána.")

 @commands.command(name="leave", aliases=["dc", "disconnect"], help="Disconnects the BOT")
 async def leave(self, ctx):
 self.is_playing = False
 self.is_paused = False

 if self.vc != None:
 return await self.vc.disconnect(), await ctx.send(content="BOT byl odpojen.")

 else:
 return await ctx.send("BOT není nikde připojen.")
 
 @commands.command(name="current", help="Displays the current song")
 async def current(self, ctx):
 current = self.current
 retval = f"```Právě hraje:\n {current}```"
 if current != "":
 await ctx.send(retval)
 else:
 await ctx.send("Aktuálně nic nehraje.")



I already tried everything I can think of(which isn't a lot because I suck at programming), and also tried searching for some solution on the internet, but nothing worked.