
Recherche avancée
Autres articles (80)
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 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, parMediaSPIP 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 (...) -
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
Sur d’autres sites (9155)
-
discord bot music with youtube dl not stuck at webpage downloading
22 septembre 2021, par patricebailey1998So I'm trying to make a music bot which just joins,plays,stops and resume music. However my bot can join and leave a voice channel fine, however when i do my /play command it get stuck on
[youtube] oCveByMXd_0: Downloading webpage
(this is output in vscode) and then does nothing after. I put some print statement (which you can see in the code below and it prints 1 and 2 but NOT 3). Anyone had this issue ?

MUSIC BOT FILE


import discord
from discord.ext import commands
import youtube_dl

class music(commands.Cog):
 def __init__(self, bot):
 self.bot = bot
 
 @commands.command()
 async def join(self, ctx):
 if(ctx.author.voice is None):
 await ctx.reply("*You're not in a voice channel.*")
 voiceChannel = ctx.author.voice.channel
 if(ctx.voice_client is None): # if bot is not in voice channel
 await voiceChannel.connect()
 else: # bot is in voice channel move it to new one
 await ctx.voice_client.move_to(voiceChannel)

 @commands.command()
 async def leave(self, ctx):
 await ctx.voice_client.disconnect()
 
 @commands.command()
 async def play(self,ctx, url:str = None):
 if(url == None):
 await ctx.reply("*Check your arguments!*\n```/play VIDEO_URL```")
 else:
 ctx.voice_client.stop() # stop current song
 
 # FFMPEG handle streaming in discord, and has some standard options we need to include
 FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
 YTDL_OPTIONS = {"format":"bestaudio"}
 vc = ctx.voice_client
 
 # Create stream to play audio and then stream directly into vc
 with youtube_dl.YoutubeDL(YTDL_OPTIONS) as ydl:
 info = ydl.extract_info(url, download=False)
 print("1")
 url2 = info["formats"][0]["url"]
 print("2")
 source = await discord.FFmpegOpusAudio.from_probe(url2,FFMPEG_OPTIONS)
 print("3")
 vc.play(source) # play the audio
 await ctx.send(f"*Playing {info['title']} -* ퟎ
-
Music bot returning errors at core.py and bot.py
13 septembre 2021, par LoganoxThe code for the music bot I'm trying to write in python keeps returning an error with the following code :


@bot.command(name='play_song', help='To play song')
async def play(ctx,url):
 
 #if not ctx.message.author.name=="Rohan Krishna" :
 # await ctx.send('NOT AUTHORISED!')
 # return
 if 1==1:#try :
 server = ctx.message.guild
 voice_channel = server.voice_client
 print("try 1 was a success")
 
 async with ctx.typing():
 filename = await YTDLSource.from_url(url, loop=bot.loop)
 #voice_channel.play(discord.FFmpegPCMAudio(executable="ffmpeg.exe", source=filename)) #ISSUE HERE
 print("try 2 was a success")
 voice = get(ctx.bot.voice_clients, guild=ctx.guild)
 
 #voice.play(discord.FFmpegPCMAudio('test.mp3'), after=your_check)
 #voice.source = discord.PCMVolumeTransformer(voice.source)
 #voice.source.volume = 0.5
 await ctx.send('**Now playing:** {}'.format(filename))
 if 1==0:#except:
 await ctx.send("The bot is not connected to a voice channel.")
 print("try 3 was unfortunately a success")



It normally has a try/except function but I replaced it with if true and false statements to force it to run instead of breaking to determine the exact line of it breaking. The issue supposedly lies in


voice_channel.play(discord.FFmpegPCMAudio(executable="ffmpeg.exe", source=filename)) #ISSUE HERE



The error I get returned is :


Traceback (most recent call last):
 File "C:\Users\heyin\anaconda3\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
 ret = await coro(*args, **kwargs)
 File "app2.py", line 75, in play
 voice.play(discord.FFmpegPCMAudio('test.mp3'), after=your_check)
 File "C:\Users\heyin\anaconda3\lib\site-packages\discord\player.py", line 225, in __init__
 super().__init__(source, executable=executable, args=args, **subprocess_kwargs)
 File "C:\Users\heyin\anaconda3\lib\site-packages\discord\player.py", line 138, in __init__
 self._process = self._spawn_process(args, **kwargs)
 File "C:\Users\heyin\anaconda3\lib\site-packages\discord\player.py", line 147, in _spawn_process
 raise ClientException(executable + ' was not found.') from None
discord.errors.ClientException: ffmpeg was not found.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
 File "C:\Users\heyin\anaconda3\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
 await ctx.command.invoke(ctx)
 File "C:\Users\heyin\anaconda3\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
 await injected(*ctx.args, **ctx.kwargs)
 File "C:\Users\heyin\anaconda3\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
 raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: ffmpeg was not found.



I added the print statements to determine which lines were working so those can obviously be ignored. It seems to be working fine except for this, other commands in the bot are working appropriately.


-
Music Bot with replit
7 août 2021, par T FI am currently using replit for my bot. I have installed all the necessary packages and ffmpeg for replit. When I start the bot from my PC everything works, but when I start the bot with replit, the bot joins my channel, says it is playing music and leaves the channel immediately. What could be the reason/fix for this ?


(No error happens)


Edit :


I don't get any errors and the code works. I tested it with the host on my PC. In replit I installed discordjs / opus, opus and ytdl-core. Then I downloaded the ffmpeg-4.4-i686-static from ffmpeg and uploaded the ffmpeg file into replit. Last I typed chmod +777 ./ffmpeg in the shell console. The code works. The problem is with replit. When I start the bot from my PC everything works and the bot plays music. Then when I paste the code into replit and start the bot, the bot briefly joins my channel and then leaves it again. There are no errors or anything else.