flowese / IdeogramWrapper

IdeogramWrapper Is a Python package that allows you to generate images from Ideogram's API using textual prompts. This package is based on reverse engineering of Ideogram's API (https://ideogram.ai/) and is not officially endorsed by Ideogram
MIT License
67 stars 7 forks source link

An error occurred: 403 Client Error: Forbidden for url: https://ideogram.ai/api/images/sample #2

Open OlegRuban-ai opened 1 year ago

OlegRuban-ai commented 1 year ago

Hello! Until yesterday everything worked. But since yesterday I started getting the error: “An error occurred: 403 Client Error: Forbidden for url: https://ideogram.ai/api/images/sample”. All cookies were checked, updated, and the user-agent was also indicated to be current, but still an error. Can you tell me what the problem is?

flowese commented 1 year ago

Hi!

Thank you for reporting this issue. Upon investigation, it appears that the ideogram.ai server has implemented additional security measures via Cloudflare, which is causing the 403 Forbidden error you are encountering.

I am currently the sole maintainer of this project and my time is quite limited. However, I encourage anyone with the required skill set to try and implement a bypass for Cloudflare's security measures.

As a temporary solution, we might consider using Selenium to automate the browsing process and potentially bypass Cloudflare's restrictions. Selenium could initiate a browser session, wait for the page to load, and then retrieve any necessary data. It's a heavier approach compared to a simple HTTP request, but it could serve as a temporary fix until a more efficient method is found.

Any contributions to improve the code and implement this feature would be greatly appreciated.

Thank you for your understanding and patience.

OlegRuban-ai commented 1 year ago

Okay, I'll try, thanks

OlegRuban-ai commented 1 year ago

Hello! Unfortunately, replacing cookies did not help and using Selenium did not help. I forwarded my user-agent and also took all the cookies except session_cookie. As an alternative, Selenium also used undetected_chromedriver, but without success. In all cases, cloudflare blocks access.

Can you also tell me where to find the channel_id and user_id parameters that are used? Because they act as a constant in different variations, which I have come across, but where they were taken from is unclear.

I would appreciate your help if you have time.