Recherche avancée

Médias (91)

Autres articles (81)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

Sur d’autres sites (11067)

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

  • discord.py music bot can't play next song

    6 décembre 2020, par bork

    I'm making a discord music bot using ffmpeg and youtube-dl. I have a premade playlist of urls that would play the list of songs once a user chooses it.
    &#xA;this is my code for playing the audio

    &#xA;

    ydl_opts = {&#xA;            &#x27;format&#x27;: &#x27;bestaudio&#x27;, &#xA;            &#x27;noplaylist&#x27;:&#x27;True&#x27;,&#xA;            &#x27;youtube_include_dash_manifest&#x27;: False&#xA;            }&#xA;FFMPEG_OPTIONS = {&#xA;            &#x27;before_options&#x27;: &#x27;-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5&#x27;,&#xA;            &#x27;options&#x27;: &#x27;-vn&#x27;&#xA;            }&#xA;&#xA;songs = url[playlist]&#xA;dur_min = 0&#xA;pre_dur_sec = 0&#xA;with YoutubeDL(ydl_opts) as ydl:&#xA;    for i in songs:&#xA;        info = ydl.extract_info(i, download = False)&#xA;        dur = info[&#x27;duration&#x27;]&#xA;        playlist_songs.append(info)&#xA;&#xA;playlist_songs_copy = playlist_songs.copy()&#xA;for i in playlist_songs_copy:&#xA;    info = playlist_songs.pop(0)&#xA;    URL = info[&#x27;formats&#x27;][0][&#x27;url&#x27;]&#xA;    player = FFmpegPCMAudio(URL, **FFMPEG_OPTIONS)&#xA;    q.append(player)&#xA;    q_playlist.append(playlist)&#xA;&#xA;if not voice.is_playing():&#xA;    source = q.pop(0)  &#xA;    playlist = q_playlist.pop(0)&#xA;    dur_min = duration_min.pop(0)&#xA;    dur_sec = duration_sec.pop(0)  &#xA;    voice.play(source, after = lambda e: play_next(ctx, source))      &#xA;    voice.is_playing()&#xA;    await ctx.send(f&#x27;```nim\n*Now Playing:*\nplaylist {playlist}: {name[playlist]}\n\n{content[playlist]}\n\ntotal duration: {dur_min}:{dur_sec}```&#x27;)&#xA;

    &#xA;

    and this is my code for playing the next song

    &#xA;

    def play_next(ctx, source):&#xA;    voice = get(client.voice_clients, guild = ctx.guild)&#xA;    if len(q) >= 1:&#xA;        try:&#xA;            del combine_q[0]&#xA;            source = q.pop(0)&#xA;            playlist = q_playlist.pop(0)&#xA;            dur_min = duration_min.pop(0)&#xA;            dur_sec = duration_sec.pop(0)&#xA;&#xA;        except:&#xA;            pass&#xA;&#xA;        voice.play(source, after = lambda e: play_next(ctx, source))&#xA;        try:&#xA;            asyncio.run_coroutine_threadsafe(ctx.send(f&#x27;```nim\n*Now Playing:*\nplaylist {playlist}: {name[playlist]}\n\n{content[playlist]}\n\ntotal duration: {dur_min}:{dur_sec}```&#x27;), client.loop)&#xA;        &#xA;        except:&#xA;            asyncio.run_coroutine_threadsafe(ctx.send(&#x27;```nim\nPlaying the next song...```&#x27;), client.loop)&#xA;        &#xA;    else:&#xA;        time.sleep(30) &#xA;        if not voice.is_playing():&#xA;            asyncio.run_coroutine_threadsafe(voice.disconnect(), client.loop)&#xA;            asyncio.run_coroutine_threadsafe(ctx.send("```nim\nNo more songs in queue.```"),client.loop)&#xA;            voice.is_paused()&#xA;

    &#xA;

    Up till today, it's been working fine. But I was using the bot just now and instead of playing the song and sending the message "Playing the next song..." as usual, it just stopped and spammed the message for about 30 times before it disconnected. When I checked the logs, it showed&#xA;socket.send() raised exception&#xA;, which was also spammed in the terminal. When I tried making the bot reconnect, it joined my voice channel but didn't respond to any commands and would keep making the discord "connecting" noise. It wouldn't even leave with my .leave command unless I completely turned it off via the script.

    &#xA;

    The same connecting problem would continue even after I reran the script and would only stop after I restarted my VS Code which is really odd...

    &#xA;

    After some testing I found out that as of now, the bot is only able to play two songs before breaking. I really need help as this just happened randomly and I'm unable to find anything online about the problem.

    &#xA;

  • Webm video playing video & audio in Movies & TV app but will only play video in windows media player and html ?

    24 décembre 2019, par Kate LeVering

    I have created a webm video file with transparency with ffmpeg out of a series of png files. Then I add the audio track again in ffmpeg (I have tried both the opus and vorbis codecs). When I play it in the Movies & TV app it plays just fine (audio and video). In windows media player only the video plays. In html (inside a video tag) the video will play if it is set to ’muted’ but if it is not muted it doesn’t play.

    I am not sure what is going on. Does anyone have any insights. Do I need to run the audio from a seperate file ?

    Thanks, Kate