
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (12)
-
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community. -
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
Les notifications de la ferme
1er décembre 2010, parAfin d’assurer une gestion correcte de la ferme, il est nécessaire de notifier plusieurs choses lors d’actions spécifiques à la fois à l’utilisateur mais également à l’ensemble des administrateurs de la ferme.
Les notifications de changement de statut
Lors d’un changement de statut d’une instance, l’ensemble des administrateurs de la ferme doivent être notifiés de cette modification ainsi que l’utilisateur administrateur de l’instance.
À la demande d’un canal
Passage au statut "publie"
Passage au (...)
Sur d’autres sites (4911)
-
Matomo NAMED 2023 Hi-Tech Awards finalist
1er août 2023, par Lance — Press Releases -
Matomo maker InnoCraft named 2023 Hi-Tech Awards finalist
20 avril 2023, par Erin — Press Releases -
2023-04-18 18:25:05 INFO discord.player ffmpeg process ##### successfully terminated with return code of 0
19 avril 2023, par I_am_thingI am making a discord music bot with discord.py and ctx, it uses Spotify


I am using FFmpeg for my music feature. This is my !play code


client_id = ''
client_secret = ''
client_credentials_manager = SpotifyClientCredentials(client_id=client_id, client_secret=client_secret)
sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager)

bot.volume = 0.5 # initial volume of the bot (can be changed)

@bot.command()
async def play(ctx, *, track_query):
 # check if the query is a valid Spotify link
 if 'open.spotify.com/track/' in track_query:
 track_id = track_query.split('/')[-1] # extract the track ID from the link
 else:
 # search for tracks with the given name
 track_results = sp.search(q=track_query, type='track', limit=1)
 if len(track_results['tracks']['items']) == 0:
 await ctx.send(f'Sorry, I could not find any track with the name "{track_query}".')
 return
 track_id = track_results['tracks']['items'][0]['id'] # get the track ID for the first search result
 track_info = sp.track(track_id) # get the track information for the given ID
 track_name = track_info['name']
 track_artist = track_info['artists'][0]['name']
 track_duration = time.strftime('%M:%S', time.gmtime(track_info['duration_ms']//1000))
 track_preview_url = track_info['preview_url'] # get the preview URL for the track
 if track_preview_url is None:
 await ctx.send(f'Sorry, the track "{track_name}" by {track_artist} cannot be played.')
 return
 voice_channel = ctx.author.voice.channel
 if voice_channel is None:
 await ctx.send('Please join a voice channel first.')
 return
 voice_client = await voice_channel.connect()
 audio_source = discord.FFmpegPCMAudio(track_preview_url, options="-b:a 128k -bufsize 512k")
 voice_client.play(audio_source, after=lambda e: print('Player error: %s' % e) if e else None)
 voice_client.source = discord.PCMVolumeTransformer(voice_client.source)
 voice_client.source.volume = bot.volume

 # format the embed message
 embed = discord.Embed(title=track_name, description=track_artist, color=0xff8c00)
 embed.add_field(name='Duration', value=track_duration, inline=True)
 embed.set_thumbnail(url=track_info['album']['images'][0]['url'])
 embed.set_footer(text='This music is from https://www.spotify.com/')
 await ctx.send(embed=embed)

 while voice_client.is_playing():
 await asyncio.sleep(1)
 await voice_client.disconnect()



I joined the unofficial ffmpeg discord server no one could find a fix I searched for ages and I couldn't fix it