#๐Ÿ”’ error sending image in embed getting error

29 messages ยท Page 1 of 1 (latest)

ornate fog
#

im trying to send a image from a cloudflare server but i keep getting an error

In embeds.0.image.url: Not a well formed URL.
``` this is the url im trying to send ```image = f"https://clan.cloudflare.steamstatic.com/images/42849803/{description['localized_title_image'][0]}"```
faint mortarBOT
#

@ornate fog

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

ornate fog
#

but i can get the image but not sned it in a embed

nova ledge
#

whatever description['localized_title_image'][0] is, it's not a valid url path

#

the rest of the url looks fine, so the problem must be in description['localized_title_image'][0], which you have conveniently omitted from your post

ornate fog
#

but when i print out image = f"https://clan.cloudflare.steamstatic.com/images/42849803/{description['localized_title_image'][0]}

#

it gives me a link and when i click it

#

it opens the image i want

nova ledge
#

then you'll need to share some more code with some more details

#

i.e. a traceback

ornate fog
#

ok

#

ill send the code

#
image = f"https://clan.cloudflare.steamstatic.com/images/42849803/{description['localized_title_image'][0]}"
embed = discord.Embed(title=data[0], description=data[3],
                              color=discord.Colour.orange(), )
        embed.add_field(name=f"Posted: {data[1]}", value=f"[The-Finals-News-And-Patches]({data[2]})")
        embed.set_thumbnail(
            url='https://cdn2.steamgriddb.com/logo_thumb/3dcf08bb1312cd37914637289ba97421.png')

embed.set_image(url=image)
#

this si the code

#

and i get this error

#
  File "C:\Users\pinhe\pythonProject23\.venv\Lib\site-packages\discord\ext\tasks\__init__.py", line 264, in _loop
    raise exc
  File "C:\Users\pinhe\pythonProject23\.venv\Lib\site-packages\discord\ext\tasks\__init__.py", line 239, in _loop
    await self.coro(*args, **kwargs)
  File "C:\Users\pinhe\pythonProject23\discordbot.py", line 68, in check_for_patch
    await target_channel.send(embed=embed)
  File "C:\Users\pinhe\pythonProject23\.venv\Lib\site-packages\discord\abc.py", line 1561, in send
    data = await state.http.send_message(channel.id, params=params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\pinhe\pythonProject23\.venv\Lib\site-packages\discord\http.py", line 745, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embeds.0.image.url: Not a well formed URL.```
nova ledge
ornate fog
#

im printing it by saying print(image) but what gives me the error is this part embed.set_image(url=image)

ornate fog
#

any ideas on how i can fix this?

pure vigil
#

Im from phone so i cant copy

ornate fog
#

ok ill try

pure vigil
#

Try what

#

Send url

ornate fog
#

send what url?

#

the image url is https://clan.cloudflare.steamstatic.com/images/42849803/8b759d154c74a9e07277d74113ecd989fbc65ee0.jpg

faint mortarBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.