Recherche avancée

Médias (91)

Autres articles (89)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • 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

Sur d’autres sites (6814)

  • Revision 98228 : Nettoyage du code du coup

    7 juin 2016, par kent1@… — Log

    Nettoyage du code du coup

  • Revision 124385 : mise en forme code

    28 avril 2020, par Maïeul Rouquette — Log

    mise en forme code

  • Youtube Dlp returns with error code of 400 [closed]

    10 mars 2024, par nikita goncharov

    I have a python discord bot that can play music and uses discord.py https://discordpy.readthedocs.io/en/stable/. To play get the music I use yt_dlp or youtube_dl. But when requesting a video it returns with a 400 error code.

    


    This is the error with yt_dlp :

    


    WARNING: [youtube] YouTube said: ERROR - Precondition check failed.

    


    WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (1/3)...

    


    WARNING: [youtube] YouTube said: ERROR - Precondition check failed.

    


    WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (2/3)...

    


    WARNING: [youtube] YouTube said: ERROR - Precondition check failed.

    


    WARNING: [youtube] HTTP Error 400: Bad Request. Retrying (3/3)...

    


    WARNING: [youtube] YouTube said: ERROR - Precondition check failed.

    


    WARNING: [youtube] Unable to download API page: HTTP Error 400: Bad Request (caused by <httperror>)</httperror>

    &#xA;

    I will leave some of the code that I use for my bot... The youtube setup settings :

    &#xA;

    import youtube_dl

    &#xA;

    or

    &#xA;

    import yt_dlp as youtube_dl

    &#xA;

    youtube_dl.utils.bug_reports_message = lambda: &#x27;&#x27;&#xA;&#xA;&#xA;ytdl_format_options = {&#xA;    &#x27;format&#x27;: &#x27;bestaudio/best&#x27;,&#xA;    &#x27;outtmpl&#x27;: &#x27;%(extractor)s-%(id)s-%(title)s.%(ext)s&#x27;,&#xA;    &#x27;restrictfilenames&#x27;: True,&#xA;    &#x27;noplaylist&#x27;: True,&#xA;    &#x27;nocheckcertificate&#x27;: True,&#xA;    &#x27;ignoreerrors&#x27;: False,&#xA;    &#x27;logtostderr&#x27;: False,&#xA;    &#x27;quiet&#x27;: True,&#xA;    &#x27;no_warnings&#x27;: True,&#xA;    &#x27;default_search&#x27;: &#x27;auto&#x27;,&#xA;    &#x27;source_address&#x27;: &#x27;0.0.0.0&#x27;,  # bind to ipv4 since ipv6 addresses cause issues sometimes&#xA;}&#xA;&#xA;ffmpeg_options = {&#xA;    &#x27;options&#x27;: &#x27;-vn&#x27;,&#xA;}&#xA;&#xA;ytdl = youtube_dl.YoutubeDL(ytdl_format_options)&#xA;&#xA;&#xA;class YTDLSource(discord.PCMVolumeTransformer):&#xA;    def __init__(self, source, *, data, volume=0.5):&#xA;        super().__init__(source, volume)&#xA;&#xA;        self.data = data&#xA;&#xA;        self.title = data.get(&#x27;title&#x27;)&#xA;        self.url = data.get(&#x27;url&#x27;)&#xA;        self.duration = data.get(&#x27;duration&#x27;)&#xA;        self.image = data.get("thumbnails")[0]["url"]&#xA;    @classmethod&#xA;    async def from_url(cls, url, *, loop=None, stream=False):&#xA;        loop = loop or asyncio.get_event_loop()&#xA;        data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=not stream))&#xA;        #print(data)&#xA;&#xA;        if &#x27;entries&#x27; in data:&#xA;            # take first item from a playlist&#xA;            data = data[&#x27;entries&#x27;][0]&#xA;        #print(data["thumbnails"][0]["url"])&#xA;        #print(data["duration"])&#xA;        filename = data[&#x27;url&#x27;] if stream else ytdl.prepare_filename(data)&#xA;        return cls(discord.FFmpegPCMAudio(filename, **ffmpeg_options), data=data)&#xA;

    &#xA;

    Approximately the command to run the audio (from my bot) :

    &#xA;

    sessionChanel = message.author.voice.channel await sessionChannel.connect() url = matched.group(1) player = await YTDLSource.from_url(url, loop=client.loop, stream=True) sessionChannel.guild.voice_client.play(player, after=lambda e: print(                                        f&#x27;Player error: {e}&#x27;) if e else None) &#xA;

    &#xA;

    I searched for posts with the same error and they where either old or didn't solve my problem.

    &#xA;

    I tried importing instead of yt_dlp, I tried importing youtube_dl. But when I make the request it does not answer, no exception and no warning it just does not answer, as if the funcion is empty

    &#xA;

    I will link my other post that I asked. It might be usefull : Error : Unable to extract uploader id - Youtube, Discord.py

    &#xA;