Hi,
some Dall-e URLs do not work properly. The part “%2B” in the Dall-e URL generates the following problem:
When I want to upload the URL to Instagram with “requests.post(url)”, then Instagram thinks this part of the URL is a “+” sign, converts and replaces it, and the upload to Instagram fails.
Any proposal how to solve this? I am searching in the web since several days now, but everything I tried so far does not work.
The behavior is likely in the URL percent encoding part of the instagram code library that you are using. You’d have to find how to pass the URL without alteration, and if such is supported by the API backend and is still understood by the instagram fetcher.
In principle that’s a good idea. Sending the pic from local to Insta directly does not work unfortunately. I would first need to upload it to a web server and then send it from there.
Is there a developer in OpenAI responsible for the creation of the URL I can contact? It would be great to just avoid “%2B” in the URL that is generated.
from urllib.parse import quote
import requests
url = 'https://your_dall_e_url_with_%2B'
encoded_url = quote(url, safe='')
# safe='' ensures that all characters are encoded
# Now use encoded_url for your post request
requests.post(encoded_url)
or maybe
url = 'https://your_dall_e_url_with_%2B'
url = url.replace('%2B', '%252B') # URL encode the '+' character only
# Now use the new URL for your post request
requests.post(url)