Reputation: 44
I'm creating a music bot and when the user use the command play
the bot print an embed with the title and other infos
but when the embed print the desc the title of song is _
.
how can i resolve?
Screenshot:
async with ctx.typing():
try:
source = await YTDLSource.create_source(ctx, search, loop=self.bot.loop)
except YTDLError as e:
await ctx.send('Errore: {}'.format(str(e)))
else:
song = Song(source)
await ctx.voice_state.songs.put(song)
ctx.source = source
ctx.requester = source.requester
print(source)
print(source.requester)
print(source.title)
embed = (discord.Embed(title='Aggiunto alla coda',
description='```css\n{0.source.title}\n```'.format(ctx),
color=discord.Color.orange())
.add_field(name='Durata', value=ctx.source.duration)
.add_field(name='Richiesta da', value=ctx.requester.mention)
.set_thumbnail(url=ctx.source.thumbnail))
await ctx.send(embed=embed)
Maybe is wrong something here?
def __init__(self, ctx: commands.Context, source: discord.FFmpegPCMAudio, *, data: dict, volume: float = 0.5):
self.title = data.get('title')
Upvotes: 1
Views: 1401
Reputation:
'_'
is the value when youtube-dl cannot determine a title.
If this happened close to July 2019 and with YouTube videos (as opposed to one of the other 1000+ supported sites ), the most likely explanation is that your version of youtube-dl is outdated; YouTube changed the format of their video titles on July 30, 2019.
Visit https://yt-dl.org/update to learn how to update youtube-dl. Most likely, it's as simple as running youtube-dl -U
.
To get more information about problems like this, it is a good idea to show the warnings emitted by youtube-dl on stderr, at least for developers.
Upvotes: 2