Recherche avancée

Médias (1)

Mot : - Tags -/wave

Autres articles (112)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

  • Que fait exactement ce script ?

    18 janvier 2011, par

    Ce script est écrit en bash. Il est donc facilement utilisable sur n’importe quel serveur.
    Il n’est compatible qu’avec une liste de distributions précises (voir Liste des distributions compatibles).
    Installation de dépendances de MediaSPIP
    Son rôle principal est d’installer l’ensemble des dépendances logicielles nécessaires coté serveur à savoir :
    Les outils de base pour pouvoir installer le reste des dépendances Les outils de développements : build-essential (via APT depuis les dépôts officiels) ; (...)

Sur d’autres sites (10366)

  • Anomalie #3523 : Gestion des plugins avec spip 3.0.20

    5 août 2015, par Gilles VINCENT

    en ajoutant la directive

    opcache.validate_timestamps=0

    à ma config php, comme conseillé dans http://wiki.mikejung.biz/PHP_OPcache pour un serveur en production, la page de gestion des plugins refonctionne à nouveau correctement. De plus, la valeur

    opcache.revalidate_freq=60

    (valeur par défaut fournie lors de l’install) est vraiment longue.
    Si je commente cette ligne dans le fichier de config, le phpinfo() indique une valeur plus raisonnable de 2 seulement.
    Je pense que le chargement méga long venait de cette constante.

    La différence de comportement avec la config "pour développement" entre une 3.0.19 et une 3.0.20 reste encore surprenante.
    Si j’ai le temps, je creuserai dans une semaine à mon retour de vacance, car tout le monde ne peut as jouer avec ces paramètres du serveur... :/

  • ytdl python "KeyError : formats"

    7 juillet 2022, par Mondumkreisung

    Im trying to make a discord music bot for personal use, since groovy and rythm got shut down.
It's working okay-ish I guess, but im having a problem with ytdl.
typing "-play" and an url is working just like intended, but i cant type "-play 'song name'".
Typing "-play example" gives me this :

    


    [download] Downloading playlist: example
[youtube:search] query "example": Downloading page 1
[youtube:search] playlist example: Downloading 1 videos
[download] Downloading video 1 of 1
[youtube] CLXt3yh2g0s: Downloading webpage
Ignoring exception in command play:
[download] Finished downloading playlist: example
Traceback (most recent call last):
  File "C:\Users\Dennis\PycharmProjects\groovy's true successor\venv\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "C:\Users\Dennis\PycharmProjects\groovy's true successor\voice.py", line 53, in play
    url2 = info['formats'][0]['url']
KeyError: 'formats'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Dennis\PycharmProjects\groovy's true successor\venv\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\Dennis\PycharmProjects\groovy's true successor\venv\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\Dennis\PycharmProjects\groovy's true successor\venv\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: KeyError: 'formats'


    


    im fairly new to coding, so im sorry if somethings weird to understand.

    


    okay, so : typing -play with an url works fine, but typing -play with the song name doesnt. its only searching for the first word, downloads the first searchresult and then "crashes".

    


    so "-play Rick Astley - Never Gonna Give You Up" for example only searches for "Rick" and then it says something about KeyError : 'formats'
Here is my code :

    


    @client.command()
async def play(ctx, url):
    channel = ctx.author.voice.channel
    voice = discord.utils.get(client.voice_clients, guild=ctx.guild)
    if voice and voice.is_connected():
        pass
    else:
        await channel.connect()

    ffmpeg_opts = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
    ydl_opts = {'format': "bestaudio/best", 'default_search': 'auto'}
    vc = ctx.voice_client

    with youtube_dl.YoutubeDL(ydl_opts) as ydl:
        info = ydl.extract_info(url, download=False)
        url2 = info['formats'][0]['url']
        source = await discord.FFmpegOpusAudio.from_probe(url2, **ffmpeg_opts)
        vc.play(source)


    


  • Mangled output when printing strings from FFProbe STDERR

    9 février 2018, par spikespaz

    I’m trying to make a simple function to wrap around FFProbe, and most of the data can be retrieved correctly.

    The problem is when actually printing the strings to the command line using both Windows Command Prompt and Git Bash for Windows, the output appears mangled and out of order.

    Some songs (specifically the file Imagine Dragons - Hit Parade_ Best of the Dance Music Charts\80 - Beazz - Lime (Extended Mix).flac) are missing metadata. I don’t know why, but the dictionary the function below returns is empty.

    FFProbe outputs its results to stderr which can be piped to subprocess.PIPE, decoded, and parsed. I chose regex for the parsing bit.

    This is a slimmed down version of my code below, for the output take a look at the Github gist.

    #! /usr/bin/env python3
    # -*- coding: utf-8 -*-

    import os

    from glob import glob
    from re import findall, MULTILINE
    from subprocess import Popen, PIPE


    def glob_from(path, ext):
       """Return glob from a directory."""
       working_dir = os.getcwd()
       os.chdir(path)

       file_paths = glob("**/*." + ext)

       os.chdir(working_dir)

       return file_paths


    def media_metadata(file_path):
       """Use FFPROBE to get information about a media file."""
       stderr = Popen(("ffprobe", file_path), shell=True, stderr=PIPE).communicate()[1].decode()

       metadata = {}

       for match in findall(r"(\w+)\s+:\s(.+)$", stderr, MULTILINE):
           metadata[match[0].lower()] = match[1]

       return metadata


    if __name__ == "__main__":
       base = "C:/Users/spike/Music/Deezloader"

       for file in glob_from(base, "flac"):
           meta = media_metadata(os.path.join(base, file))
           title_length = meta.get("title", file) + " - " + meta.get("length", "000")

           print(title_length)

    Output Gist
    Output Raw

    I don’t understand why the output (the strings can be retrieved from the regex pattern effectively, however the output is strangely formatted when printing) appears disordered only when printing to the console using python’s print function. It doesn’t matter how I build the string to print, concatenation, comma-delimited arguments, whatever.

    I end up with the length of the song first, and the song name second but without space between the two. The dash is hanging off the end for some reason. Based on the print statement in the code before, the format should be Title - 000 ({title} - {length}) but the output looks more like 000Title -. Why ?