
Advanced search
Other articles (70)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 September 2013, byCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo; l’ajout d’une bannière l’ajout d’une image de fond;
-
Ecrire une actualité
21 June 2013, byPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
Publier sur MédiaSpip
13 June 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
On other websites (11427)
-
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: ffmpeg was not found
22 July 2022, by MSTI made a music bot on Replit but, when running my code I get this error:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: ffmpeg was not found.


Can someone help me fix this?


main.py


import discord
from discord.ext import commands
import music

cogs = [music]

client = commands.Bot(command_prefix='!', intents = discord.Intents.all())

for i in range(len(cogs)):
 cogs[i].setup(client)


client.run("token")



music.py


import discord
from discord.ext import commands
import youtube_dl
import ffmpeg

class music(commands.Cog):
 def __init__(self,client):
 self.client = client

 @commands.command(name="join")
 async def join(self,ctx):
 if ctx.author.voice is None:
 await ctx.send("You are not in a Voice Channel!")
 voice_channel = ctx.author.voice.channel
 if ctx.voice_client is None:
 await voice_channel.connect()
 else:
 await ctx.voice_client.move_to(voice_channel)

 @commands.command(name="disconnect")
 async def disconnect(self,ctx):
 await ctx.voice_client.disconnect()

 @commands.command(name="play")
 async def play(self,ctx,url):
 ctx.voice_client.stop()
 FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
 YDL_OPTIONS = {'format':"bestaudio"}
 vc = ctx.voice_client

 with youtube_dl.YoutubeDL(YDL_OPTIONS) as ydl:
 info = ydl.extract_info(url, download=False)
 url2 = info['formats'][0]['url']
 source = await discord.FFmpegOpusAudio.from_probe(url2,**FFMPEG_OPTIONS)
 vc.play(source)


 @commands.command(name="pause")
 async def pause(self,ctx):
 await ctx.voice_client.pause()
 await ctx.send("Paused Playing Music!")

 @commands.command(name="resume")
 async def resume(self,ctx):
 await ctx.voice_client.resume()
 await ctx.send("Resumed Playing Music!")

def setup(client):
 client.add_cog(music(client))



So, The bot is able to join the Voice Channel but when I ask it to play a song, it gives this error:


[youtube] Pkh8UtuejGw: Downloading webpage
[youtube] Pkh8UtuejGw: Downloading player afeb58ff
Ignoring exception in command play:
Traceback (most recent call last):
 File "/home/runner/DiscordMusicBotTest/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
 ret = await coro(*args, **kwargs)
 File "/home/runner/DiscordMusicBotTest/music.py", line 34, in play
 source = await discord.FFmpegOpusAudio.from_probe(url2,**FFMPEG_OPTIONS)
 File "/home/runner/DiscordMusicBotTest/venv/lib/python3.8/site-packages/discord/player.py", line 387, in from_probe
 return cls(source, bitrate=bitrate, codec=codec, **kwargs)
 File "/home/runner/DiscordMusicBotTest/venv/lib/python3.8/site-packages/discord/player.py", line 324, in __init__
 super().__init__(source, executable=executable, args=args, **subprocess_kwargs)
 File "/home/runner/DiscordMusicBotTest/venv/lib/python3.8/site-packages/discord/player.py", line 138, in __init__
 self._process = self._spawn_process(args, **kwargs)
 File "/home/runner/DiscordMusicBotTest/venv/lib/python3.8/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 "/home/runner/DiscordMusicBotTest/venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
 await ctx.command.invoke(ctx)
 File "/home/runner/DiscordMusicBotTest/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
 await injected(*ctx.args, **ctx.kwargs)
 File "/home/runner/DiscordMusicBotTest/venv/lib/python3.8/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.



-
exec.Command not formating input correctly?
20 May 2016, by nadermxI’m having a bizzar issue. I have a ffmpeg I run as a subprocess
ffmpeg = exec.Command("nice", "-n", "10",
"ffmpeg",
"-http_proxy", RandomProxyAddress(),
"-i", fmt.Sprintf(`%s`, vi.GetUrl()),
"-acodec", "libmp3lame",
"-metadata", fmt.Sprintf(`title=%s`, vi.GetTitle()),
"-b:a", fmt.Sprintf("%s", vi.GetAudioQuality()),
"-threads", "0",
"-f", "mp3",
"-")But when I run this command I get
Server returned 403 Forbidden (access denied)
but when I run the command outside of go it functions correctly.
ffmpeg -http_proxy http://user:user@123.123.123.123:29842 -i 'https://r5---sn-uqx2-aphl.googlevideo.com/videoplayback?fexp=9405981%2C9414672%2C9416126%2C9416891%2C9422342%2C9422596%2C9423965%2C9425077%2C9428398%2C9431012%2C9432564%2C9433096%2C9433946%2C9434085%2C9435697%2C9435736%2C9435876%2C9437285%2C9437344&clen=3716608&itag=140&ipbits=0&upn=QpGXy0IIxmU&key=yt6&expire=1463728239&id=o-AIlDlUBTmu9UXu0yMp77VXR502YekQi98e6JpvbSzjo0&ms=au&gcr=pe&mv=m&source=youtube&mm=31&mn=sn-uqx2-aphl&pl=24&requiressl=yes&ip=190.234.105.134&mime=audio%2Fmp4&mt=1463706418&sparams=clen%2Cdur%2Cgcr%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&lmt=1458211566542818&gir=yes&keepalive=yes&sver=3&dur=233.964&initcwndbps=563750&signature=53A8732F8841FC6AC6D6737B35B4EF6FC000F2F0.59E11FB2D3DF96F4C00CE8D84C28D3A546E04F78&ratebypass=yes' -acodec 'libmp3lame' -metadata 'title=This awesome song' -b:a '128k' -threads '0' -f 'mp3' test.mp3
Does it have something to do with my string formatting or quotations in the exec.Command?
Edit:
fmt.Print output
nice-n10ffmpeg-http_proxyhttp://user:user@1.1.1.1:29842-ihttps://r17---sn-q4f7snes.googlevideo.com/videoplayback?pl=21&source=youtube&sparams=clen%2Cdur%2Cgir%2Cid%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cnh%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&upn=mwBuBq7HijI&keepalive=yes&nh=IgpwcjAzLmRmdzA2KgkxMjcuMC4wLjE&expire=1462445495&id=o-ADXLtGoWBQDEKqNcD9aFNT4IFc8EZ8gu_TwZfCshkmjs&lmt=1453349484731934&ip=142.91.200.197&sver=3&dur=264.382&mv=u&mt=1462423294&ms=au&mn=sn-q4f7snes&signature=6DD5ED6A89A2FB8A30DD7EBAA87333EDDFF1D832.B5D0C233EA672891006D2993A745E7224F29BF02&mm=31&itag=140&gir=yes&clen=4199716&mime=audio%2Fmp4&ipbits=0&requiressl=yes&key=yt6&fexp=9416126%2C9416891%2C9422596%2C9428398%2C9431012%2C9433096%2C9433946&ratebypass=yes-acodeclibmp3lame-ss0-metadatatitle=Khong Duong no sugar Music Video-b:a128k-threads0-fmp3-&{/usr/bin/nice [nice -n 10 ffmpeg -http_proxy http://user:user@1.1.1.1:29842 -i https://r17---sn-q4f7snes.googlevideo.com/videoplayback?pl=21&source=youtube&sparams=clen%2Cdur%2Cgir%2Cid%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cnh%2Cpl%2Crequiressl%2Csource%2Cupn%2Cexpire&upn=mwBuBq7HijI&keepalive=yes&nh=IgpwcjAzLmRmdzA2KgkxMjcuMC4wLjE&expire=1462445495&id=o-ADXLtGoWBQDEKqNcD9aFNT4IFc8EZ8gu_TwZfCshkmjs&lmt=1453349484731934&ip=142.91.200.197&sver=3&dur=264.382&mv=u&mt=1462423294&ms=au&mn=sn-q4f7snes&signature=6DD5ED6A89A2FB8A30DD7EBAA87333EDDFF1D832.B5D0C233EA672891006D2993A745E7224F29BF02&mm=31&itag=140&gir=yes&clen=4199716&mime=audio%2Fmp4&ipbits=0&requiressl=yes&key=yt6&fexp=9416126%2C9416891%2C9422596%2C9428398%2C9431012%2C9433096%2C9433946&ratebypass=yes -acodec libmp3lame -metadata title=Khong Duong no sugar Music Video -b:a 128k -threads 0 -f mp3 -] [] <nil> <nil> <nil> [] <nil> <nil> <nil> <nil> false [] [] [] [] <nil>}
</nil></nil></nil></nil></nil></nil></nil></nil> -
Back on the Salty Track
12 June 2011, by Multimedia Mike — GeneralAfter I posted about my initial encounter and frustration with Google’s Native Client (NaCl) SDK and took a deep breath, I realized that I achieved an important proof of concept— I successfully played music using the NaCl SDK audio output interface. Then I started taking a closer read through the (C-based set of) header files and realized I might be able to make a go of it after all. I had much better luck this time and managed to create a proper Native Client interface that allows for controlling playback, presenting metadata, and toggling individual voices (a fascinating tool for studying classic game music).
I haven’t bothered to post the actual plugin because, really, what’s the point? I started with NaCl SDK 0.3 which requires Chrome 12, which means terribly limited reach, even among Chrome users. At least, that was true when I restarted this little project. Chrome 12 was formally released this past week. Chrome development really does move at breakneck pace.
Anyway, here is a static screenshot of what the plugin currently looks like:
Not pretty, but it does the job.
Dev Journal
Various notes based on this outing:- Portability: I tested my plugin using Chrome 12 on 64-bit Windows, Mac, and Linux. Mac and Linux both work; Windows does not.
- Build System: SDK 0.3 is still lacking in its ability to compile .cpp files (instead of .cc files); necessary because libgme is C++ using .cpp files. This requires some build system modification.
- Getting the interfaces: This is where I got tripped up the first time around. get_browser_interface() from their example actually refers to a parameter passed in through the PPP_InitializeModule() function. The SDK’s template generator renames this to get_browser().
- Debugging: I feel unstoppable once I have a printf() mechanism available to me during development. To that end, console.log() from JavaScript outputs to Chrome’s built-in JavaScript console log while putting printf() statements in the actual NaCl plugin causes the messages to show up in /.xsession-errors on Linux/X.
- Size Matters: The binaries generated with the NaCl 0.3 SDK are ridiculously huge. The basic "Hello World" example in C compiles to binaries that are 6.7 MB and 7.8 MB for the 32- and 64-bit builds, respectively. This made me apprehensive to build a full version of SaltyGME that contains all the bells and whistles offered by the library. However, all of the GME code compiled into the binary adds very little size. Curiously, the C++ version of "Hello World" only ranges from 1.8-2.0 MB for 32- and 64-bit. Is there some kind of C tax happening here? Note that running ’strip’ on the resulting .nexe files (they’re ELF files, after all) brings the sizes down into the C++ range, but at the cost of causing them to not work (more specifically, not even load).
- No Messaging: The NaCl SDK is supposed to have a messaging interface which allows the NaCl plugin to send asynchronous messages up to the hosting page. When I try to instantiate it, I get a NULL. I’m stuck with the alternative of polling from the JavaScript side to, e.g., determine when a song has finished loading via the network.
That’s all I can think of for now. I may work on this a little more (I’d like to at least see some audio visualization). Maybe Google will enable NaCl per default sometime around Chrome 21 and this program will be ready for prime time by then.
See Also: