
Recherche avancée
Médias (3)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (26)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Other interesting software
13 avril 2011, parWe 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 : (...)
Sur d’autres sites (4823)
-
How do I add a cool down to a command for a discord music bot [closed]
22 mars 2021, par sherbit fishI'm making a music bot in discord and I need to add a cool down into this command so that people don't spam it and crash the bot. What should I do to fix this problem ?


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

client.on('message', async message => {
 if (message.member.voice.channel) {
 const connection = await message.member.voice.channel.join();
 console.log(`sound was just played`);
connection.play(ytdl('https://www.youtube.com/watch?v=jRxSRyrTANY',{ highWaterMark: 50 },{ quality: 'highestaudio' },{ type: 'opus' }));
setTimeout(() => {
 connection.disconnect();
}, 12000); 
 }
});



-
My music doesn't play correctly and other problems - Discord.py
24 mars 2021, par DiaconoSo, I'm triying to let my bot play songs directly from the url (without downloading them like the song.mp3 method) but I'm having a hard time. The bot plays only 1 song and when I try to play another song it doesn't play it.
I'm also getting 2 errors :
video_link
is not defined andself
is not defined.
Also when I try to play live music like "lofi hip hop radio - beats to relax/study to" nothing happens.
Can you help me please ???

This is my code


import asyncio
import discord
from discord.ext import commands, tasks
import requests
import json
from random import choice
from discord.utils import get
from discord import FFmpegPCMAudio
import youtube_dl
bot = commands.Bot(command_prefix="!")



ytdl_format_options = {
 'format': 'bestaudio/best',
 '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': 'auto',
 'source_address': '0.0.0.0' # bind to ipv4 since ipv6 addresses cause issues sometimes
}

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

ytdl = youtube_dl.YoutubeDL(ytdl_format_options)

class YTDLSource(discord.PCMVolumeTransformer):
 def __init__(self, source, *, data, volume=0.5):
 super().__init__(source, volume)

 self.data = data

 self.title = data.get('title')
 self.url = data.get('url')

 @classmethod
 async def from_url(cls, url, *, loop=None, stream=False):
 loop = loop or asyncio.get_event_loop()
 data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download= not stream))

 if 'entries' in data:
 data = data['entries'][0]

 filename = data['url'] if stream else ytdl.prepare_filename(data)
 return cls(discord.FFmpegPCMAudio(filename, **ffmpeg_options), data=data)


@bot.command()
async def play(ctx, url):
 voice = await ctx.author.voice.channel.connect()
 player = await YTDLSource.from_url(url, loop=client.loop)
 ctx.voice_client.play(player, after=lambda e: print('Player error: %s' % e) if e else None)
 ydl_opts = {'format': 'bestaudio'}
 FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
 with youtube_dl.YoutubeDL(ydl_opts) as ydl:
 info = ydl.extract_info(video_link, download=False)
 URL = info['formats'][0]['url']
 voice = get(self.bot.voice_clients, guild=ctx.guild)
 voice.play(discord.FFmpegPCMAudio(URL, **FFMPEG_OPTIONS))



-
My code accidently deleted my 'song.mp3' file in Discord.py music bot
2 avril 2021, par AlkariaI was coding my discord bot and i was trying to make the bot not try to connect twice. Like, if it's already connected any user sends another ' !play' command, i don't want it to error. But that's not my problem. I or my code accidently deleted my 'song.mp3' file. How do i get it back. I closed the pycharm so i can't do 'CRTL + Z'.


@client.command()


async def play(ctx, url : str) :


song_there = os.path.isfile("song.mp3")
try:
 if song_there:
 os.remove("song.mp3")
except PermissionError:
 await ctx.send("Şimdi Çalan şarkının bitmesini bekleyin. Yada '!stop' komutunu kullanın.")
 return
# connects the voice channel
connected = ctx.author.voice
audio = discord.FFmpegPCMAudio("song.mp3")

voiceChannel = discord.utils.get(ctx.guild.voice_channels, name='music')
if not discord.client.VoiceClient == None: # None being the default value if the bot isnt in a channel (which is why the is_connected() is returning errors)
 await voiceChannel.connect()
 await ctx.send(f"Joined **{voiceChannel}**")
 discord.client.VoiceClient.play()
else:
 await ctx.send("I'm already connected!")



audio = discord.FFmpegPCMAudio("song.mp3")

# Dowloads the video from the link given

ydl_opts = {
 'format': 'bestaudio/best',
 'postprocessors': [{
 'key': 'FFmpegExtractAudio',
 'preferredcodec': 'mp3',
 'preferredquality': '192',
 }],
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
 ydl.download([url])
for file in os.listdir("./"):
 if file.endswith(".mp3"):
 os.rename(file, "song.mp3")