Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (70)

  • 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 (...)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike 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 (...)

Sur d’autres sites (5840)

  • discord bot music with youtube dl not stuck at webpage downloading

    22 septembre 2021, par patricebailey1998

    So 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 Loganox

    The 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 F

    I 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.