Recherche avancée

Médias (1)

Mot : - Tags -/remix

Autres articles (89)

  • Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur

    8 février 2011, par

    La visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
    Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
    Configuration de la boite multimédia
    Dès (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (8901)

  • Discord.py - Streaming Youtube Live into Voice

    4 juin 2021, par SUPER MECH M500

    I'm back on the stacks, was banned from asking questions because they were terrible apparently, but I need help on something I've done a lot of research on but cannot find my answer ;

    


    I need to be able to stream a youtube live stream's audio into a VC for radio music using discord.py Rewrite. I've been looking at Youtube_DL- and/or FFMpeg-related internet posts and all were either outdated (discord.py==0.16.x) or involved downloading youtube videos (can't do that with ongoing streams).

    


    And I've also tried to look through the discord.py v0.16.12 voice_client.py create_ytdl_player. But to no avail, I could not find any solutions.

    


    This is my current situation in my code. It is a background task in one of my cogs.

    


        @loop(seconds=5)
    async def check_voice(self):
        try:
            channel = await self.bot.fetch_channel(819346920082112532)
        except NotFound:
            print("[IR] `韎
  • after restarting the page in the browser, the player stops loading

    28 juillet 2024, par Uximy

    I have a problem which is that when I start icecast server on ubuntu and not only on ubuntu but also on windows regardless of the operating system, when I first go to the radio station in icecast2 http://localhost:8000/radio the music plays but after restarting the page in the browser, the player stops loading, I tried the solution with nocache in the browser in the address bar, nothing helps, I looked at many users configs, they did not encounter such problems, I will leave my config below, I also wrote a code on nodejs I will also leave it below, the problem plays the same that if I go to a direct icecast link, what I will do through the node js code + ffmpeg, also about the logs, nothing outputs even a hint of any error that is related to this problem

    


    Config IceCast :

    


    <icecast>&#xA;    <location>Earth</location>&#xA;    <admin>icemaster@localhost</admin>&#xA;    <hostname>localhost</hostname>&#xA;&#xA;    <limits>&#xA;        <clients>100</clients>&#xA;        <sources>10</sources>&#xA;        524288&#xA;        60&#xA;        30&#xA;        10&#xA;        1&#xA;        65536&#xA;    </limits>&#xA;&#xA;    <authentication>&#xA;        hackme&#xA;        hackme&#xA;        admin&#xA;        hackme&#xA;    </authentication>&#xA;&#xA;    &#xA;        <port>8000</port>&#xA;        0.0.0.0&#xA;    &#xA;    &#xA;    &#xA;        <port>8443</port>&#xA;        0.0.0.0&#xA;        <ssl>1</ssl>&#xA;    &#xA;&#xA;    &#xA;        <header value="*"></header>&#xA;        <header value="Origin, X-Requested-With, Content-Type, Accept"></header>&#xA;        <header value="GET, POST, OPTIONS"></header>&#xA;        <header value="no-cache, no-store, must-revalidate"></header>&#xA;        <header value="no-cache"></header>&#xA;        <header value="0"></header>&#xA;    &#xA;&#xA;    &#xA;    <mount type="normal">&#xA;        /radio&#xA;        <password>mypassword</password>&#xA;        <public>1</public>&#xA;        100&#xA;        Anime Vibes&#xA;        Anime Vibes&#xA;        <genre>various</genre>&#xA;        audio/ogg&#xA;        65536&#xA;        &#xA;        &#xA;            <header value="*"></header>&#xA;            <header value="Origin, X-Requested-With, Content-Type, Accept"></header>&#xA;            <header value="GET, POST, OPTIONS"></header>&#xA;            <header value="no-cache, no-store, must-revalidate"></header>&#xA;            <header value="no-cache"></header>&#xA;            <header value="0"></header>&#xA;        &#xA;    </mount>&#xA;&#xA;    <fileserve>1</fileserve>&#xA;&#xA;    <paths>&#xA;        <logdir>/var/log/icecast2</logdir>&#xA;        <webroot>/etc/icecast2/web</webroot>&#xA;        <adminroot>/etc/icecast2/admin</adminroot>&#xA;       &#xA;        <alias source="/" destination="/status.xsl"></alias>&#xA;        &#xA;        /etc/icecast2/cert/icecast.pem&#xA;        &#xA;    </paths>&#xA;&#xA;    <logging>&#xA;        <accesslog>access.log</accesslog>&#xA;        <errorlog>error.log</errorlog>&#xA;        <playlistlog>playlist.log</playlistlog>&#xA;        <loglevel>1</loglevel> &#xA;        <logsize>10000</logsize> &#xA;        <logarchive>1</logarchive>&#xA;    </logging>&#xA;</icecast>&#xA;

    &#xA;

    Code Node.js :

    &#xA;

    const express = require(&#x27;express&#x27;);&#xA;const { spawn } = require(&#x27;child_process&#x27;);&#xA;const path = require(&#x27;path&#x27;);&#xA;const fs = require(&#x27;fs&#x27;);&#xA;const https = require(&#x27;https&#x27;);&#xA;const app = express();&#xA;const port = 3000;&#xA;&#xA;const privateKey = fs.readFileSync(&#x27;./cert/privateKey.key&#x27;, &#x27;utf8&#x27;);&#xA;const certificate = fs.readFileSync(&#x27;./cert/certificate.crt&#x27;, &#x27;utf8&#x27;);&#xA;&#xA;const credentials = {&#xA;    key: privateKey,&#xA;    cert: certificate&#xA;};&#xA;&#xA;app.use(express.static(path.join(__dirname)));&#xA;&#xA;// Check if playlist file exists&#xA;const playlistPath = path.join(__dirname, &#x27;playlist.txt&#x27;);&#xA;if (!fs.existsSync(playlistPath)) {&#xA;    console.error(&#x27;Playlist file does not exist&#x27;);&#xA;    process.exit(1);&#xA;}&#xA;&#xA;console.log(`Playlist path: ${playlistPath}`);&#xA;&#xA;// Start FFmpeg process to create continuous stream from playlist&#xA;const ffmpegProcess = spawn(&#x27;ffmpeg&#x27;, [&#xA;    &#x27;-re&#x27;,&#xA;    &#x27;-f&#x27;, &#x27;concat&#x27;,&#xA;    &#x27;-safe&#x27;, &#x27;0&#x27;,&#xA;    &#x27;-protocol_whitelist&#x27;, &#x27;file,http,https,tcp,tls&#x27;,&#xA;    &#x27;-i&#x27;, playlistPath,&#xA;    &#x27;-c:a&#x27;, &#x27;libvorbis&#x27;,&#xA;    &#x27;-f&#x27;, &#x27;ogg&#x27;,&#xA;    &#x27;-tls&#x27;, &#x27;1&#x27;,&#xA;    &#x27;icecast://source:mypassword@localhost:8443/radio&#x27;&#xA;]);&#xA;&#xA;ffmpegProcess.stdout.on(&#x27;data&#x27;, (data) => {&#xA;    console.log(`FFmpeg stdout: ${data}`);&#xA;});&#xA;&#xA;ffmpegProcess.stderr.on(&#x27;data&#x27;, (data) => {&#xA;    console.error(`FFmpeg stderr: ${data}`);&#xA;});&#xA;&#xA;ffmpegProcess.on(&#x27;close&#x27;, (code) => {&#xA;    console.log(`FFmpeg process exited with code ${code}`);&#xA;});&#xA;&#xA;app.get(&#x27;/radio&#x27;, (req, res) => {&#xA;    res.setHeader(&#x27;Content-Type&#x27;, &#x27;audio/ogg&#x27;);&#xA;    res.setHeader(&#x27;Transfer-Encoding&#x27;, &#x27;chunked&#x27;);&#xA;&#xA;    const requestOptions = {&#xA;        hostname: &#x27;localhost&#x27;,&#xA;        port: 8443,&#xA;        path: &#x27;/radio&#x27;,&#xA;        method: &#x27;GET&#x27;,&#xA;        headers: {&#xA;            &#x27;Accept&#x27;: &#x27;audio/ogg&#x27;&#xA;        },&#xA;        rejectUnauthorized: false&#xA;    };&#xA;&#xA;    const request = https.request(requestOptions, (response) => {&#xA;        response.pipe(res);&#xA;&#xA;        response.on(&#x27;end&#x27;, () => {&#xA;            res.end();&#xA;        });&#xA;    });&#xA;&#xA;    request.on(&#x27;error&#x27;, (err) => {&#xA;        console.error(`Request error: ${err.message}`);&#xA;        res.status(500).send(&#x27;Internal Server Error&#x27;);&#xA;    });&#xA;&#xA;    request.end();&#xA;});&#xA;https.globalAgent.options.ca = [certificate];&#xA;// Create HTTPS server&#xA;const httpsServer = https.createServer(credentials, app);&#xA;&#xA;httpsServer.listen(port, () => {&#xA;    console.log(`Server is running at https://localhost:${port}`);&#xA;});&#xA;

    &#xA;

    I hope for your help and any advice, thanks in advance

    &#xA;

  • Command raised an exception : NameError : name 'player' is not defined

    20 mars 2023, par baartys

    I finally got myself a hosting for my project, but got into an error and I don't know how to resolve it.&#xA;I ran command !play to start streaming in vc, but I got this error :

    &#xA;

    2023-03-19 18:36:04 INFO     discord.client logging in using static token&#xA;2023-03-19 18:36:04 INFO     discord.gateway Shard ID None has connected to Gateway (Session ID: f983009c9f2881b87ee119278692efc9).&#xA;Eurobeat Radio is running!&#xA;2023-03-19 18:36:10 ERROR    discord.ext.commands.bot Ignoring exception in command play&#xA;Traceback (most recent call last):&#xA;  File "/home/container/.local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 229, in wrapped&#xA;    ret = await coro(*args, **kwargs)&#xA;  File "/home/container/radio.py", line 44, in play&#xA;    player.play(FFmpegPCMAudio(&#x27;http://stream.eurobeat.xyz&#x27;))&#xA;NameError: name &#x27;player&#x27; is not defined&#xA;The above exception was the direct cause of the following exception:&#xA;Traceback (most recent call last):&#xA;  File "/home/container/.local/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 1350, in invoke&#xA;    await ctx.command.invoke(ctx)&#xA;  File "/home/container/.local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 1023, in invoke&#xA;    await injected(*ctx.args, **ctx.kwargs)  # type: ignore&#xA;  File "/home/container/.local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 238, in wrapped&#xA;    raise CommandInvokeError(exc) from exc&#xA;discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name &#x27;player&#x27; is not defined&#xA;

    &#xA;

    I tried running it on my pc and that was without error, but once it was on the hosting it ran in to the error up the page.

    &#xA;

    Here is the code :

    &#xA;

    import discord&#xA;import urllib.request, json &#xA;from discord import FFmpegPCMAudio&#xA;from discord.ext import commands&#xA;from discord.ext import tasks&#xA;client= commands.Bot(command_prefix="er!", intents=discord.Intents.all(), help_command=None)&#xA;&#xA;@tasks.loop(seconds=10.0)&#xA;async def my_background_task():&#xA;    """Will loop every 60 seconds and change the bots presence"""&#xA;    with urllib.request.urlopen(&#x27;https://api.laut.fm/station/eurobeat/current_song&#x27;) as url:&#xA;        data = json.load(url)&#xA;        global namestatus&#xA;        global artiststatus&#xA;        namestatus = data[&#x27;title&#x27;]&#xA;        artiststatus = data[&#x27;artist&#x27;][&#x27;name&#x27;]&#xA;    await client.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="Eurobeat FM"))&#xA;    await client.change_presence(activity=discord.Game(name="Para para dancing ~"))&#xA;    await client.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name=f"{namestatus} by {artiststatus}"))&#xA;&#xA;&#xA;@client.event&#xA;async def on_ready():&#xA;    print(&#x27;Eurobeat Radio is running!&#x27;)&#xA;    await client.wait_until_ready()&#xA;    my_background_task.start()&#xA;&#xA;&#xA;@client.event&#xA;async def on_voice_state_update(member, prev, cur):&#xA;    if client.user in prev.channel.members and len([m for m in prev.channel.members if not m.bot]) == 0:&#xA;        channel = discord.utils.get(client.voice_clients, channel=prev.channel)&#xA;        await channel.disconnect()&#xA;&#xA;@client.command(aliases=[&#x27;p&#x27;, &#x27;pla&#x27;, &#x27;join&#x27;, &#x27;j&#x27;])&#xA;async def play(ctx, url: str = &#x27;http://stream.eurobeat.xyz&#x27;): &#xA;    channel = ctx.message.author.voice.channel&#xA;    global player&#xA;    try:&#xA;        player = await channel.connect()&#xA;    except:&#xA;        pass&#xA;    player.play(FFmpegPCMAudio(&#x27;http://stream.eurobeat.xyz&#x27;))&#xA;    embedVar = discord.Embed(title="Started Playing!", color=discord.Color.random())&#xA;    await ctx.send(embed=embedVar)&#xA;

    &#xA;

    Would be very grateful for your help !

    &#xA;