
Recherche avancée
Médias (1)
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (76)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
Le profil des utilisateurs
12 avril 2011, parChaque 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 (...)
Sur d’autres sites (4806)
-
Revision 27de4fe922 : Using has_second_ref function to simplify the code. Updating implementation of
20 août 2013, par Dmitry KovalevChanged Paths :
Modify /vp9/common/vp9_pred_common.c
Using has_second_ref function to simplify the code.Updating implementation of vp9_get_pred_context_single_ref_p2 using
has_second_ref function to make code easier to read.Change-Id : I5ba642712f59861a48aab974e73aa01640d086fe
-
Youtube Dlp returns with error code of 400 [closed]
10 mars 2024, par nikita goncharovI 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>


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


import youtube_dl


or


import yt_dlp as youtube_dl


youtube_dl.utils.bug_reports_message = lambda: ''


ytdl_format_options = {
 'format': 'bestaudio/best',
 'outtmpl': '%(extractor)s-%(id)s-%(title)s.%(ext)s',
 'restrictfilenames': True,
 'noplaylist': True,
 'nocheckcertificate': True,
 'ignoreerrors': False,
 'logtostderr': False,
 'quiet': True,
 'no_warnings': True,
 'default_search': 'auto',
 'source_address': '0.0.0.0', # bind to ipv4 since ipv6 addresses cause issues sometimes
}

ffmpeg_options = {
 'options': '-vn',
}

ytdl = youtube_dl.YoutubeDL(ytdl_format_options)


class YTDLSource(discord.PCMVolumeTransformer):
 def __init__(self, source, *, data, volume=0.5):
 super().__init__(source, volume)

 self.data = data

 self.title = data.get('title')
 self.url = data.get('url')
 self.duration = data.get('duration')
 self.image = data.get("thumbnails")[0]["url"]
 @classmethod
 async def from_url(cls, url, *, loop=None, stream=False):
 loop = loop or asyncio.get_event_loop()
 data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=not stream))
 #print(data)

 if 'entries' in data:
 # take first item from a playlist
 data = data['entries'][0]
 #print(data["thumbnails"][0]["url"])
 #print(data["duration"])
 filename = data['url'] if stream else ytdl.prepare_filename(data)
 return cls(discord.FFmpegPCMAudio(filename, **ffmpeg_options), data=data)



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


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'Player error: {e}') if e else None) 



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


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


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


-
Revision 124385 : mise en forme code
28 avril 2020, par Maïeul Rouquette — Logmise en forme code