
Recherche avancée
Autres articles (111)
-
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 (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (10036)
-
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


-
Multiple download trim videos ffmpeg + youtube-dl [duplicate]
4 décembre 2020, par sl4gI'm tryng to make a bash script to download and trim videos from URLs in a
.txt
file, usingffmpeg
andyoutube-dl
. From the Internet I found this https://askubuntu.com/questions/970629/how-to-download-a-portion-of-a-video-with-youtube-dl-or-something-else and this How can I batch/sequentially download m3u8 files using ffmpeg ? and based on that I made this :

#!/bin/bash

#only download the half of urls

HoldList="/home/user/desktop/dir1/code/bash/web.txt"

index=0
while read line ; do
 ffmpeg -ss 00:50:30 -to 00:51:00 -i "$(youtube-dl -f best --get-url $line)" -c:v copy -c:a copy output-${index}.mp4
 ((index=index+1))
done < "$HoldList"



This code only downloads half of the videos. Download one, ignore the next, then repeat...


How can I make not skip every other URL from the file ?


I'm a newbie in Bash script (and in this site), and English is not my first language.


-
RTSP to RTMP using FFMPEG on Raspberry Pi to YouTube Livestream ends prematurely (and sometimes doesn't start)
12 mars 2021, par user203875I have been running a program from my raspberry pi 4 that converts a RTSP network camera feed to RTMP for YouTube. The stream used to run non-stop every day. I didn't have to do anything. I have a program in place that would restart if the feed died.


Nothing has changed with that program in 2 years. About a month ago, the feed stopped working. I just started into trying to figure out why. Maybe someone has some ideas on what is going on ?


In order for me to start the feed, I must also start a studio.youtube.com browser session showing the feed information. If that web page is up and running, the live stream will start. While I can't say for certain that it NEVER starts without this session running, it seems that way.


Usually the stream lasts for an hour or two. Rarely more than four hours.


When I start up a studio.youtube.com session after the stream dies the "Dimiss" or "Edit in Studio" message is on the page. I have to hit "dismiss" before I can start up the stream again.


Is there a solution to this ?


Again, my program didn't change, so I'm at a loss for what I can do to fix this.