Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (102)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains 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 ;

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (10937)

  • 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;

  • I got that error when i try to play music with my bot on discord

    20 septembre 2020, par TheKillerBoss 27

    (node:10076) UnhandledPromiseRejectionWarning : TypeError : Cannot read property 'id' of undefined&#xA;at play (C :\Users\USER\Desktop\Giochi e Programmi\Foto video ecc\Proggetti\Discord-bot\Akagi-chan\Akagi_chan.js:49:51)&#xA;at C :\Users\USER\Desktop\Giochi e Programmi\Foto video ecc\Proggetti\Discord-bot\Akagi-chan\Akagi_chan.js:89:17
    &#xA;at processTicksAndRejections (internal/process/task_queues.js:97:5)&#xA;(node:10076) UnhandledPromiseRejectionWarning : Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id : 1)&#xA;(node:10076) [DEP0018] DeprecationWarning : Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

    &#xA;

    const Discord = require(&#x27;discord.js&#x27;);&#xA;const bot = new Discord.Client();&#xA;&#xA;const ytdl = require("ytdl-core");&#xA;&#xA;const token = &#x27;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\&#x27;&#xA;&#xA;var versione = &#x27;1.0.1&#x27;;&#xA;var autore = &#x27;TheKillerBoss&#x27;;&#xA;var servers = {};&#xA;&#xA;const PREFIX = &#x27;!&#x27;;&#xA;&#xA;bot.on(&#x27;ready&#x27;, () =>{&#xA;    console.log(&#x27;Online!&#x27;);&#xA;    bot.user.setActivity(&#x27;Kawaii!&#x27;, {type: "PLAYING"});&#xA;})&#xA;&#xA;bot.on(&#x27;message&#x27;, message=>{&#xA;&#xA;    let args = message.content.substring(PREFIX.length).split(" ");&#xA;&#xA;    switch(args[0])&#xA;    {&#xA;        case &#x27;help&#x27;:&#xA;            message.channel.send(&#x27;ping --> pong!&#x27;)&#xA;            message.channel.send(&#x27;twitch --> canale twitch&#x27;)&#xA;            message.channel.send(&#x27;twitter --> pagina twitter&#x27;)&#xA;            break;&#xA;        case &#x27;ping&#x27;:&#xA;            message.channel.send(&#x27;pong!&#x27;)&#xA;            break;&#xA;        case &#x27;twitch&#x27;:&#xA;            message.channel.send(&#x27;Segui TheKilleBoss su Twitch! https://twitch.tv/thekillerboss_27&#x27;)&#xA;            break;&#xA;        case &#x27;twitter&#x27;:&#xA;            message.channel.send(&#x27;Segui TheKilleBoss su Twitter https://twitter.com/TheKillerBoss27&#x27;)&#xA;            break;&#xA;        case &#x27;versione&#x27;:&#xA;            message.channel.send(&#x27;Versione: &#x27; &#x2B; versione)&#xA;            break;&#xA;        case &#x27;autore&#x27;:&#xA;            message.channel.send(&#x27;Autore: &#x27; &#x2B; autore)&#xA;            break;&#xA;        case &#x27;play&#x27;:&#xA;            function play(connection, message)&#xA;            {&#xA;                var server = servers(message.guid.id);&#xA;&#xA;                server.dispatcher = connection.play(ytdl(server.queue[0], {filter: "audioonly"}));&#xA;&#xA;                server.queue.shift();&#xA;&#xA;                server.dispatcher.on("end", function()&#xA;                {&#xA;                    if(server.queue[0])&#xA;                    {&#xA;                        play(connection, message);&#xA;                    }&#xA;                    else&#xA;                    {&#xA;                        connection.disconnect();&#xA;                    }&#xA;                });&#xA;            &#xA;             }&#xA;            if(!args[1])&#xA;            {&#xA;                message.channel.send("Devi inserire un link!");&#xA;                return;&#xA;            }&#xA;&#xA;            if(!message.member.voice.channel)&#xA;            {&#xA;                message.channel.send("Devi essere in un canale vocale!");&#xA;                return;&#xA;            }&#xA;&#xA;            if (!servers[message.guild.id]) servers[message.guild.id] = {&#xA;                queue: []&#xA;            }&#xA;&#xA;            var server = servers[message.guild.id];&#xA;&#xA;            server.queue.push(args[1]);&#xA;&#xA;    if(!message.member.voice.connection)message.member.voice.channel.join().then(function(connection){&#xA;            play(connection, message);&#xA;        })&#xA;&#xA;    &#xA;        break;&#xA;    &#xA;}&#xA;})&#xA;&#xA;&#xA;bot.login(token);&#xA;

    &#xA;

    so the bot enters the voice channel but does not start the music and it give me that error.&#xA;I removed the token for privacy.

    &#xA;

  • Why does mplayer not play my stream ?

    17 juillet 2016, par SirWindfield

    I wanted to use mplayer (a command line tool) to play a SoundCloud url that I fetched with there official API. The url looks like this

    https://cf-media.sndcdn.com/qop35iYKlHhs.128.mp3?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiKjovL2NmLW1lZGlhLnNuZGNkbi5jb20vcW9wMzVpWUtsSGhzLjEyOC5tcDMiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE0Njg3NTM4NjB9fX1dfQ__&amp;Signature=OZ4IawmjdU6hEN8KB8e~t3QTy4lBFVBbIDg-a6tuPkb65e0mPskkCFFASkTWbyy5lsaT9IrURan6y70sZhLXPbng1IfkTsGdX1dO938NwVYnKs-BS7IL4TiVFxTBXoKJgmCmUD0qmmGmYqm3YdGZQrP~Sj~mw9~fmtwdHQu0rhl3O-dKsgk497JAR6pMorQs7BSs0XIosV1Mmv2DMD6iifquCWV9Ezq4ekneQ1gfSjVmzjjnKvsxjPpgmU~5DTdewwzlNClVxdzHSQONWM7c0YMGlBcVz97NviaeZOQSCAW8QZS59WULXJBJ9OmEPctWtpe3O0mo-GYjwEkbVGYl9A__&amp;Key-Pair-Id=APKAJAGZ7VMH2PFPW6UQ

    I use the command "mplayer ’url’" to play it but I always get the output :

    libavformat version 57.25.100 (internal)
    https protocol not found, recompile FFmpeg with openssl, gnutls,
    or securetransport enabled.

    Looking which protocols have been installed tells me that I have https input and output support (ffmpeg -protocols) :

    ffmpeg version 3.1.1 Copyright (c) 2000-2016 the FFmpeg developers
     built with Apple LLVM version 7.3.0 (clang-703.0.31)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/3.1.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libfaac --enable-ffplay --enable-libspeex --enable-openssl --enable-libopus --disable-lzma --enable-nonfree --enable-vda
     libavutil      55. 28.100 / 55. 28.100
     libavcodec     57. 48.101 / 57. 48.101
     libavformat    57. 41.100 / 57. 41.100
     libavdevice    57.  0.101 / 57.  0.101
     libavfilter     6. 47.100 /  6. 47.100
     libavresample   3.  0.  0 /  3.  0.  0
     libswscale      4.  1.100 /  4.  1.100
     libswresample   2.  1.100 /  2.  1.100
     libpostproc    54.  0.100 / 54.  0.100
    Supported file protocols:
    Input:
     async
     cache
     concat
     crypto
     data
     file
     ftp
     gopher
     hls
     http
     httpproxy
     https
     mmsh
     mmst
     pipe
     rtp
     srtp
     subfile
     tcp
     tls
     udp
     udplite
     unix
     rtmp
     rtmpe
     rtmps
     rtmpt
     rtmpte
    Output:
     crypto
     file
     ftp
     gopher
     http
     httpproxy
     https
     icecast
     md5
     pipe
     rtp
     srtp
     tcp
     tls
     udp
     udplite
     unix
     rtmp
     rtmpe
     rtmps
     rtmpt
     rtmpte