Recherche avancée

Médias (1)

Mot : - Tags -/lev manovitch

Autres articles (39)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

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

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

Sur d’autres sites (2211)

  • How To Make Discord Bot Play YouTube URL

    6 mars 2021, par ivFiz

    I'm new to this and I wonder if there's a way I can make my bot play specific YouTube URL
so when I type s1 the bot join the room and play that URL

    


     if (message.content == "s1") {
     if (!message.member.voice.channel) return message.reply("You have to be in a VoiceChannel");
     message.member.voice.channel.join().then(VoiceConnection => {
         VoiceConnection.play("https://youtu.be/~~~~").on("finish", () => 
         VoiceConnection.disconnect());
         message.reply("done");
     }).catch(e => console.log(e))
 };


    


  • Discord FFMPEG audio wont play from yt-dlp

    19 mars 2023, par user21236822

    My question is this : Why isn't my bot playing audio ?

    


    I want the bot to join, play audio from queue, then disconnect without downloading an mp3 file.

    


    I tried using youtube-dl, but I switched to the yt-dlp library after getting errors I couldn't fix.
I am running on Windows 10 locally. All my libraries are up to date.

    


    Here are my ydl_opts and FFMPEG_OPTS :

    


    ydl_opts = {
    'format': 'bestaudio/best',
    'postprocessors': [{
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'mp3',
        'preferredquality': '192',
    }],
}

FFMPEG_OPTIONS = {
    'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5',
    'options': '-vn'
} 


    


    Here is where I believe the problem is.

    


    async def play():
    print("Play Called")
    musicPlay()
    # Get message object from initial request
    message = ytLinkQue.get()
    print(f"Message object recieved: {message}")
    voiceChannel = message.author.voice.channel
    vc = await voiceChannel.connect()
    songsPlayed = 0
    
    while not ytLinkQue.empty():
        # Get current song
        currentSong = ytLinkQue.get()[0]
        print(f"Current song: {currentSong}")

        # Get song from Youtube
        with yt_dlp.YoutubeDL(ydl_opts) as ydl:
            # song = ydl.download(currentSong)
            info = ydl.extract_info(currentSong, download=False)
            song = info['formats'][0]['url']

        # Play Song
        vc.play(discord.FFmpegPCMAudio(song, **FFMPEG_OPTIONS), after=lambda e: print('Song done'))

        # Wait until the song has finished playing
        while vc.is_playing():
            print("playing rn")
            await asyncio.sleep(1)
    
    await vc.disconnect()
    musicStop()


    


    When play() is called, here is the output in terminal with my annotations as **** text **** :

    


    >python main.py&#xA;2023-02-17 15:21:09 INFO     discord.client logging in using static token&#xA;2023-02-17 15:21:10 INFO     discord.gateway Shard ID None has connected to Gateway (Session ID: 60b9fce14faa5daa4aed9eb6db01a74d).&#xA;Max que: 50&#xA;Text Channel: 828698708123451434&#xA;Testing Bot#4591 is ready.&#xA;Passing message object&#xA;**** play() funciton is called ****&#xA;Play Called&#xA;Message object recieved: <message channel="<TextChannel" position="7" nsfw="False" news="False"> type= author=<member discriminator="&#x27;0199&#x27;" bot="False" nick="&#x27;Fragnk7?&#x27;" guild="<Guild" chunked="True">> flags=<messageflags value="0">>&#xA;2023-02-17 15:21:16 INFO     discord.voice_client Connecting to voice...&#xA;2023-02-17 15:21:16 INFO     discord.voice_client Starting voice handshake... (connection attempt 1)&#xA;2023-02-17 15:21:17 INFO     discord.voice_client Voice handshake complete. Endpoint found seattle2004.discord.media&#xA;Current song: https://www.youtube.com/watch?v=vcAp4nmTZCA&#xA;[youtube] Extracting URL: https://www.youtube.com/watch?v=vcAp4nmTZCA &#xA;[youtube] vcAp4nmTZCA: Downloading webpage &#xA;[youtube] vcAp4nmTZCA: Downloading android player API JSON &#xA;**** Does not play any audio ****&#xA;Playing rn&#xA;Song done&#xA;2023-02-17 15:21:18 INFO     discord.player ffmpeg process 20700 successfully terminated with return code of 1.&#xA;2023-02-17 15:21:19 INFO     discord.voice_client The voice handshake is being terminated for Channel ID 400178308467392513 (Guild ID 261601676941721602)&#xA;2023-02-17 15:21:19 INFO     discord.voice_client Disconnecting from voice normally, close code 1000.&#xA;</messageflags></member></message>

    &#xA;

    On Discord's end, the bot successfully connects then disconnects after 2 second.

    &#xA;

    Note : I've only included code I think is relevant. Please let me know if I should add anything else to the post, otherwise, here is the github for the project. Code is in main.py.&#xA;https://github.com/LukeLeimbach/wallMomentMusic

    &#xA;

    Thank you in advance !

    &#xA;

    I've applied the advice from these posts but it still will not play audio :

    &#xA;

    -https://stackoverflow.com/questions/45770016/how-do-i-make-my-discord-bot-play-audio-from-youtube

    &#xA;

    -https://stackoverflow.com/questions/66070749/how-to-fix-discord-music-bot-that-stops-playing-before-the-song-is-actually-over?newreg=c70dd786cf5844e490045494223c0381

    &#xA;

    -https://stackoverflow.com/questions/57688808/playing-music-with-a-bot-from-youtube-without-downloading-the-file

    &#xA;

  • Discord Bot can't play audio from YouTube all of a sudden

    22 mars 2023, par Aidan Tweedy

    Last night my Discord bot stopped working out of the blue. The bot had been working perfectly for months until this point - no code changes occurred and it was running in a Docker container on my home server. Then last night, my !play <url></url> command stopped working. The bot would join the voice channel, but not actually play anything. Then it would need to be manually disconnected from the voice channel in order for it to do anything again. After the first play fails, and I try again I get this error message :

    &#xA;

     [youtube] crOZk88eCcg: Downloading webpage&#xA; [youtube] crOZk88eCcg: Downloading android player API JSON&#xA; [youtube] Extracting URL: https://www.youtube.com/watch?v=crOZk88eCcg&amp;ab_channel=0foofighter0&#xA; [youtube] crOZk88eCcg: Downloading webpage&#xA; [youtube] crOZk88eCcg: Downloading android player API JSON&#xA; [2023-03-22 00:27:59] [ERROR   ] discord.ext.commands.bot: Ignoring exception in command play&#xA; Traceback (most recent call last):&#xA;   File "/usr/local/lib/python3.10/dist-packages/discord/ext/commands/core.py", line 190, in wrapped&#xA;     ret = await coro(*args, **kwargs)&#xA;   File "/usr/src/app/./main.py", line 180, in play&#xA;     voice.play(player, after=lambda e: print(f&#x27;Player error: {e}&#x27;) if e else None)&#xA;   File "/usr/local/lib/python3.10/dist-packages/discord/voice_client.py", line 600, in play&#xA;     raise ClientException(&#x27;Not connected to voice.&#x27;)&#xA; discord.errors.ClientException: Not connected to voice.&#xA; &#xA; The above exception was the direct cause of the following exception:&#xA; &#xA; Traceback (most recent call last):&#xA;   File "/usr/local/lib/python3.10/dist-packages/discord/ext/commands/bot.py", line 1347, in invoke&#xA;     await ctx.command.invoke(ctx)&#xA;   File "/usr/local/lib/python3.10/dist-packages/discord/ext/commands/core.py", line 986, in invoke&#xA;     await injected(*ctx.args, **ctx.kwargs)  # type: ignore&#xA;   File "/usr/local/lib/python3.10/dist-packages/discord/ext/commands/core.py", line 199, in wrapped&#xA;     raise CommandInvokeError(exc) from exc&#xA; discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: Not connected to voice.&#xA; [2023-03-22 00:27:59] [INFO    ] discord.player: ffmpeg process 12 has not terminated. Waiting to terminate...&#xA; [2023-03-22 00:27:59] [INFO    ] discord.player: ffmpeg process 12 should have terminated with a return code of -9.&#xA;

    &#xA;

    My first instinct was that ffmpeg was borking somehow, since it has been difficult to get working in the past. However I'm not sure how ffmpeg could've stopped working, since the bot never went down between working and not working. That leads me to believe it could be a change on Youtube/Discord's side ?

    &#xA;

    For context, here is a snippet of my !play code :

    &#xA;

    @client.command(pass_context = True)&#xA;async def play(ctx):&#xA;    url = ctx.message.content.split("!play ",1)[1]&#xA;    voice = discord.utils.get(client.voice_clients)&#xA;    if (ctx.author.voice):&#xA;        if voice == None:&#xA;            channel = ctx.message.author.voice.channel&#xA;            voice = await channel.connect()&#xA;&#xA;        # Youtube Magic&#xA;        ydl_opts = {&#xA;        &#x27;format&#x27;: &#x27;worstaudio/worst&#x27;,&#xA;        &#x27;postprocessors&#x27;: [{&#xA;            &#x27;key&#x27;: &#x27;FFmpegExtractAudio&#x27;,&#xA;            &#x27;preferredcodec&#x27;: &#x27;mp3&#x27;,&#xA;            &#x27;preferredquality&#x27;: &#x27;192&#x27;,&#xA;        }],&#xA;        }&#xA;&#xA;        if "http" not in url:&#xA;            yt = YoutubeSearch(url, max_results=1).to_json()&#xA;            print(yt)&#xA;            yt_id = str(json.loads(yt)[&#x27;videos&#x27;][0][&#x27;id&#x27;])&#xA;            yt_channel = str(json.loads(yt)[&#x27;videos&#x27;][0][&#x27;channel&#x27;]).strip().replace(" ", "")&#xA;            url = &#x27;https://www.youtube.com/watch?v=&#x27;&#x2B;yt_id&#x2B;"&amp;ab_channel="&#x2B;yt_channel&#xA;&#xA;        with yt_dlp.YoutubeDL(ydl_opts) as ydl:&#xA;            song_info=ydl.extract_info(url, download=False)&#xA;        for file in os.listdir("./"):&#xA;            if file.endswith(".mp3"):&#xA;                os.rename(file, "song.mp3")&#xA;&#xA;        voice.stop()&#xA;&#xA;        embed_trk = discord.Embed(&#xA;                title="Now playing",&#xA;                color=ctx.author.color,&#xA;        )&#xA;        video_title = song_info.get(&#x27;title&#x27;, None)&#xA;        video_channel = song_info.get(&#x27;uploader&#x27;, None)&#xA;        embed_trk.add_field(name="Track title", value=video_title, inline=False)&#xA;        embed_trk.add_field(name="Channel", value=video_channel, inline=False)&#xA;&#xA;        await ctx.send(embed=embed_trk)&#xA;        player = await YTDLSource.from_url(url, loop=client.loop, stream=True)&#xA;        voice.play(player, after=lambda e: print(f&#x27;Player error: {e}&#x27;) if e else None)&#xA;        while voice.is_playing():&#xA;            await asyncio.sleep(1)&#xA;        &#xA;        await request_record(ctx, video_title)&#xA;&#xA;    else:&#xA;        await ctx.send("You must be in a voice channel to run this command")&#xA;

    &#xA;