
Recherche avancée
Autres articles (47)
-
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (8006)
-
Anomalie #4295 (Nouveau) : Bug sur Boucle DATA et fusion sur un #ARRAY
21 février 2019Bonjour,
J’ai fait une boucle complexe pour lister par année, et mois les articles et les brèves d’un site : https://zone.spip.org/trac/spip-zone/changeset/113991
Dans mon jeu de test, elle génère ce tableau :
- <span class="CodeRay"><span class="predefined">Array</span>
- (
- [<span class="integer">0</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2016</span>
- [month] => <span class="integer">12</span>
- [lemois] => décembre
- [<span class="predefined">date</span>] => <span class="integer">2016</span>-<span class="integer">12</span>-<span class="integer">18</span> <span class="integer">23</span>:<span class="integer">05</span>:<span class="integer">51</span>
- [url] => <span class="constant">Test</span>-modele-exergue.html
- [descriptif] =>
- [titre] => <span class="constant">Test</span> modèle exergue
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">1</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2016</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2016</span>-<span class="integer">10</span>-<span class="integer">27</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">00</span>
- [url] => <span class="constant">Derniers</span>-articles.html
- [descriptif] =>
- [titre] => <span class="constant">Derniers</span> articles
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">2</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2016</span>
- [month] => <span class="integer">09</span>
- [lemois] => septembre
- [<span class="predefined">date</span>] => <span class="integer">2016</span>-<span class="integer">09</span>-<span class="integer">06</span> <span class="integer">20</span>:<span class="integer">20</span>:<span class="integer">42</span>
- [url] => <span class="constant">Test</span>-<span class="constant">Form</span>-<span class="constant">IP</span>.html
- [descriptif] =>
- <span class="constant">Tentez</span> de gagner par tirage au <span class="predefined">sort</span> le remboursement de votre achat [<span class="integer">1</span>]
- [titre] => <span class="constant">Test</span> <span class="constant">Form</span> <span class="constant">IP</span>
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">3</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2016</span>
- [month] => <span class="integer">07</span>
- [lemois] => juillet
- [<span class="predefined">date</span>] => <span class="integer">2016</span>-<span class="integer">07</span>-<span class="integer">29</span> <span class="integer">14</span>:<span class="integer">45</span>:<span class="integer">00</span>
- [url] => <span class="constant">Article</span>-avec-logo.html
- [descriptif] =>
- [titre] => <span class="constant">Article</span> avec logo
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">4</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2016</span>
- [month] => <span class="integer">05</span>
- [lemois] => mai
- [<span class="predefined">date</span>] => <span class="integer">2016</span>-<span class="integer">05</span>-<span class="integer">22</span> <span class="integer">17</span>:<span class="integer">29</span>:<span class="integer">43</span>
- [url] => <span class="constant">Long</span>.html
- [descriptif] =>
- [titre] => <span class="constant">Long</span>
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">5</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2016</span>
- [month] => <span class="integer">05</span>
- [lemois] => mai
- [<span class="predefined">date</span>] => <span class="integer">2016</span>-<span class="integer">05</span>-<span class="integer">22</span> <span class="integer">17</span>:<span class="integer">03</span>:<span class="integer">50</span>
- [url] => <span class="constant">Repetition</span>-avec-debut-dans-le-passe.html
- [descriptif] =>
- [titre] => <span class="constant">Répétition</span> avec début dans le passé
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">6</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2016</span>
- [month] => <span class="integer">05</span>
- [lemois] => mai
- [<span class="predefined">date</span>] => <span class="integer">2016</span>-<span class="integer">05</span>-<span class="integer">02</span> <span class="integer">07</span>:<span class="integer">42</span>:<span class="integer">45</span>
- [url] => <span class="constant">Test</span>-previsualisation-etendue.html
- [descriptif] =>
- <span class="constant">Je</span> suis un testeur
- [titre] => <span class="constant">Test</span> prévisualisation étendue
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">7</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2016</span>
- [month] => <span class="integer">04</span>
- [lemois] => avril
- [<span class="predefined">date</span>] => <span class="integer">2016</span>-<span class="integer">04</span>-<span class="integer">01</span> <span class="integer">04</span>:<span class="integer">10</span>:<span class="integer">12</span>
- [url] => <span class="constant">Test</span>-forme-colorees.html
- [descriptif] =>
- <span class="constant">Test</span> qui va bien
- [titre] => <span class="constant">Test</span> forme colorées
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">8</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">12</span>
- [lemois] => décembre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">12</span>-<span class="integer">06</span> <span class="integer">15</span>:<span class="integer">00</span>:<span class="integer">00</span>
- [url] => <span class="constant">Test</span>-article-sur-embargo.html
- [descriptif] =>
- [titre] => <span class="constant">Test</span> article sur embargo
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">9</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">11</span>
- [lemois] => novembre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">11</span>-<span class="integer">24</span> <span class="integer">09</span>:<span class="integer">48</span>:<span class="integer">01</span>
- [url] => <span class="constant">Intentions</span>-de-prieres.html
- [descriptif] =>
- <span class="constant">Test</span> des <span class="constant">IP</span>
- [titre] => <span class="constant">Intentions</span> de prières
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">10</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">26</span> <span class="integer">23</span>:<span class="integer">06</span>:<span class="integer">31</span>
- [url] => <span class="constant">Test</span>-<span class="constant">Newsletter</span>.html
- [descriptif] =>
- <span class="constant">Un</span> autre descriptif
- [titre] => <span class="constant">Test</span> <span class="constant">Newsletter</span>
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">11</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">03</span>
- [url] => <span class="constant">Historique</span>-des-versions-de-<span class="constant">SPIP</span>.html
- [descriptif] =>
- [titre] => <span class="constant">Historique</span> des versions de <span class="constant">SPIP</span>
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">12</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">03</span>
- [url] => <span class="constant">Evenement</span>-exceptionnel.html
- [descriptif] =>
- [titre] => Événement exceptionnel
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">13</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">03</span>
- [url] => <span class="constant">Installation</span>-du-site.html
- [descriptif] =>
- [titre] => <span class="constant">Installation</span> du site
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">14</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">03</span>
- [url] => <span class="constant">Demonstration</span>-<span class="constant">Agenda</span>.html
- [descriptif] =>
- [titre] => <span class="constant">Démonstration</span> <span class="constant">Agenda</span>
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">15</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">03</span>
- [url] => <span class="constant">Titre</span>-de-la-rubrique.html
- [descriptif] =>
- [titre] => <span class="constant">Titre</span> de la rubrique
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">16</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">03</span>
- [url] => <span class="constant">Logo</span>-de-survol.html
- [descriptif] =>
- [titre] => <span class="constant">Logo</span> de survol
- <span class="constant">Nouveauté</span>
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">17</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">02</span>
- [url] => <span class="constant">Altera</span>-sententia-est.html
- [descriptif] =>
- [titre] => <span class="constant">Altera</span> sententia est
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">18</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">02</span>
- [url] => <span class="constant">Quis</span>-enim.html
- [descriptif] =>
- [titre] => <span class="constant">Quis</span> enim
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">19</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">02</span>
- [url] => <span class="constant">Oportunum</span>-est.html
- [descriptif] =>
- [titre] => <span class="constant">Oportunum</span> est
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">20</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">02</span>
- [url] => <span class="constant">Rogatus</span>-ad-ultimum.html
- [descriptif] =>
- [titre] => <span class="constant">Rogatus</span> ad ultimum
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">21</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">02</span>
- [url] => <span class="constant">Urbibus</span>-decorata.html
- [descriptif] =>
- [titre] => <span class="constant">Urbibus</span> decorata
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">22</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">02</span>
- [url] => <span class="constant">Les</span>-derniers-articles-modifies.html
- [descriptif] =>
- [titre] => <span class="constant">Les</span> derniers articles modifiés
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">23</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">02</span>
- [url] => <span class="constant">Image</span>-logo.html
- [descriptif] =>
- [titre] => <span class="constant">Image</span> = logo
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">24</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">02</span>
- [url] => <span class="constant">Articles</span>-avec-le-<span class="constant">Mot</span>-clef-<span class="constant">ALaUne</span>.html
- [descriptif] =>
- <span class="constant">Ceci</span> est une bulle d’aide !
- [titre] => <span class="constant">Articles</span> avec le <span class="constant">Mot</span> clef : « <span class="constant">ALaUne</span> »
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">25</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">02</span>
- [url] => <span class="constant">Un</span>-sourire-peut-changer-une-vie.html
- [descriptif] =>
- [titre] => <span class="constant">Un</span> sourire peut changer une vie
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">26</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">02</span>
- [url] => <span class="constant">Le</span>-nombre-d-article-affiche-est-administrable.html
- [descriptif] =>
- [titre] => <span class="constant">Le</span> nombre d’article affiché est administrable
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">27</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">02</span>
- [url] => <span class="constant">Iamque</span>-non-umbratis.html
- [descriptif] =>
- [titre] => <span class="constant">Iamque</span> non umbratis (pdq2n)
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">28</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">01</span>
- [url] => <span class="constant">Mensarum</span>-enim.html
- [descriptif] =>
- [titre] => <span class="constant">Mensarum</span> enim
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">29</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">01</span>
- [url] => <span class="constant">Ideo</span>-urbs-venerabilis.html
- [descriptif] =>
- [titre] => <span class="constant">Ideo</span> urbs venerabilis
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">30</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2015</span>
- [month] => <span class="integer">10</span>
- [lemois] => octobre
- [<span class="predefined">date</span>] => <span class="integer">2015</span>-<span class="integer">10</span>-<span class="integer">22</span> <span class="integer">11</span>:<span class="integer">33</span>:<span class="integer">01</span>
- [url] => <span class="constant">Et</span>-prima-post-<span class="constant">Osdroenam</span>-quam.html
- [descriptif] =>
- [titre] => <span class="constant">Et</span> prima post <span class="constant">Osdroenam</span> quam
- [<span class="keyword">class</span>] =>
- )
- [<span class="integer">31</span>] => <span class="predefined">Array</span>
- (
- [year] => <span class="integer">2019</span>
- [month] => <span class="integer">02</span>
- [lemois] => février
- [<span class="predefined">date</span>] => <span class="integer">2019</span>-<span class="integer">02</span>-<span class="integer">21</span> <span class="integer">12</span>:<span class="integer">46</span>:<span class="integer">24</span>
- [url] => +<span class="constant">Test</span>-d-une-breve+.html
- [descriptif] =>
- [titre] => <span class="constant">Test</span> d’une brève
- [<span class="keyword">class</span>] => iconbreves
- )
- )
- </span>
Mais le résultat n’affiche rien à partir de l’année 2015.
Si je modifie les boucles pour ne générer dans l’array que l’année 2015, celle-ci est affichée correctement.
Si j’enlève des critères fusion lemois, l’année 2015 est parcourue.Testé en SPIP 3.2.3 SVN [24229]
-
Python - why do I get this ffprobe error ?
4 juillet 2022, par gasper101I am on mac and am working on a project in which my program shoud convert a .mp3 file into a .wav file and than get text from that file (basic speech recognition). For converting a .mp3 file into a .wav file I am using ffmpeg library. I have installed both ffmpeg and ffprobe libraryies using pip and than using homebrew so I have them installed in a folder.


This is my code :


import speech_recognition
from pydub import AudioSegment
from os import path


#get text from original voice file------------------------------------------------- 

sound = AudioSegment.from_mp3("/path/to/file.mp3")
sound.export("/output/path/file.wav", format="wav")

file_audio = speech_recognition.AudioFile('/output/path/file.wav')

r = speech_recognition.Recognizer()
with file_audio as source:
 audio_text = r.record(source)

word = r.recognize_google(audio_text)



And this is the error i get :
FileNotFoundError : [Errno 2] No such file or directory : 'ffprobe'


Full error :
Warning (from warnings module) :
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pydub/utils.py", line 170
warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
RuntimeWarning : Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work


Warning (from warnings module) :
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pydub/utils.py", line 198
warn("Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning)


RuntimeWarning : Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work
Traceback (most recent call last) :
File "/Users/marcus/Downloads/pronaunciation_checker/pronaunciation_check.py", line 12, in 
sound = AudioSegment.from_mp3("/Users/marcus/Desktop/think.mp3")
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pydub/audio_segment.py", line 796, in from_mp3
return cls.from_file(file, 'mp3', parameters=parameters)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pydub/audio_segment.py", line 728, in from_file
info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pydub/utils.py", line 274, in mediainfo_json
res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError : [Errno 2] No such file or directory : 'ffprobe'


-
ytdl python "KeyError : formats"
7 juillet 2022, par MondumkreisungIm 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)