Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (63)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • 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 (11256)

  • Hosting music bot on heroku

    2 mars 2021, par itsmaxplayz

    I have made a discord bot on discord.py rewrite which plays music in a voice channel. The code is as follows :

    


    def search(query):

    with ytdl:
        try:
            requests.get(query)
        except:
            info = ytdl.extract_info(f"ytsearch:{query}", download=False)['entries'][0]
        else:
            info = ytdl.extract_info(query, download=False)
    return info, info['formats'][0]['url']

ydl_opts = {
    'format': 'bestaudio/best',
    'quiet': True,
    'postprocessors': [{
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'mp3',
        'preferredquality': '192',
    }],

}

ytdl = youtube_dl.YoutubeDL(ydl_opts)

FFMPEG_OPTS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}

@client.command(aliases=['p'])
async def play(ctx, *, url):
    channel = ctx.message.author.voice.channel
    voice = get(client.voice_clients, guild=ctx.guild)
    if voice and voice.is_connected():
        pass
    else:
        voice = await channel.connect()
        await ctx.send(f'Successfully joined `{channel}`')

    if voice.is_playing():
        await ctx.send('Already playing a song. Try using -q or -queue to queue a song 
    :thumbsup:')
    else:
        await ctx.send(f'Searching for: `{url}` :mag_right:')
        video, source = search(url)
        voice.play(FFmpegPCMAudio(source, **FFMPEG_OPTS))
        voice.is_playing()
        await ctx.send(f'Playing: :notes: `{video["title"]}` - Now!')


    


    It works locally but when I upload the code to heroku (I use github to push the code to heroku), the bot does not come online.
These are the libraries that I imported in the code :

    


    import discord
import json
import random
import youtube_dl
import requests
import os
from discord.ext import commands
from discord.utils import get
from discord import FFmpegPCMAudio
import ctypes
import ctypes.util


    


    I have installed the ffmpeg buildpacks as I saw in another post on this website but the bot doesn't come online.

    


    Contents of my requirement file :

    


    discord.py,
discord.py[voice],
ffmpeg,
PyNaCl,
youtube_dl,
requests,
discord.py[FFmpegPCMAudio],
colorlog.

    


  • How to get best audio quality on music bot using discord.py ?

    9 mai 2021, par user28606

    I've built a discord music bot in discord.py but for some reason, it doesn't play music in as high quality as Fredboat or Rythm(so I don't think voice chat's bitrate is the problem). I've tried a couple of things online.

    


    The only thing that improved quality a little bit was downloading the song before playing it. But the quality was still far from anything like Fredboat's. It's also very impractical since downloading a 1h song takes a while and is space consuming.

    


    I'm interested in how to fix this and the explanation for why this is happening.

    


    This is the code we're currently using for the music bot :

    


    from discord import FFmpegPCMAudio
import discord
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from apscheduler.triggers.cron import CronTrigger
from discord.ext import commands, tasks
from youtubesearchpython import VideosSearch

class cmd_music(commands.Cog, name="music_commands"):

    def __init__(self, bot):
        self.bot = bot
        self.music_queue = []
        self.scheduler = AsyncIOScheduler()
        self.scheduler.add_job(self.check_queue, CronTrigger(second="0,5,10,15,20,25,30,35,40,45,50,55"))
        self.scheduler.start()
    
    async def play_raw(self, voice_client):
        if not self.music_queue:
            return

        YDL_OPTIONS = {'format': 'bestaudio', 'noplaylist':'True'}
        FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
        if not voice_client.is_playing():
            with YoutubeDL(YDL_OPTIONS) as ydl:
                info = ydl.extract_info(self.music_queue.pop(0), download=False)
            URL = info['formats'][0]['url']
            voice_client.play(FFmpegPCMAudio(URL, **FFMPEG_OPTIONS))
            voice_client.is_playing()

    async def check_queue(self):
        if not self.bot.voice_clients: return
        
        client = self.bot.voice_clients[0]
        if not client.is_playing():
            if self.music_queue:
                await self.play_raw(client)
           
        
    @commands.command(brief="join")
    async def join(self, ctx):
        await ctx.author.voice.channel.connect()

    @commands.command(brief="leave")
    async def leave(self, ctx):
        await ctx.voice_client.disconnect()
        self.music_queue = []

    @commands.command(brief="play")
    async def play(self, ctx, *name):
        url = VideosSearch(" ".join(name[:]), 1).result().get("result")[0].get("link")
        self.music_queue.append(url)
        await ctx.send("Now playing: " + url)

    @commands.command(brief="skip")
    async def skip(self, ctx):
        await ctx.send("Skipped current song")
        ctx.voice_client.stop()
        if self.music_queue:
            await self.play_raw(ctx.voice_client)``` 


    


  • ctx.voice_client.play not playing music — Discord.py

    15 février 2021, par SYCK playz

    Here I am trying to make a music bot. Currently my bot connects to the voice channel but doesn't play anything. ctx.voice_client.play does nothing, nor does it produce any errors.

    


    These have been my attempted trials, yet none work. What is the problem ?

    


    ctx.voice_client.play(source=discord.FFmpegPCMAudio('song0.mp3'))


    


    ctx.voice_client.play(source=discord.FFmpegPCMAudio('song0.mp3', executable='path/to/ffmpeg.exe'))


    


    ctx.voice_client.play(source=discord.FFmpegPCMAudio('song0.mp3', executable='path/to/ffmpeg.exe', before_options = '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', options = '-vn'))


    


    ffmpeg_options = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
ctx.voice_client.play(source=discord.FFmpegPCMAudio('song0.mp3', executable='path/to/ffmpeg.exe', **ffmpeg_options))