-
-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"New version of g4f" and "BlackBox.ai" message #2326
Comments
I have the same problem, it is the best AI and it has never given me problems until today. |
whats you discord @Mishel-Tg |
lexica.dev/docs |
I got a premium subscription in Blackbox AI (4 invitations to the email). However, I can't figure out how and where to get the API key. |
How can I remove that message? |
Thank you! This fixed the issue of the api constantly not returning the full messaging and cutting off when using blackbox through the interference api! Basically I had to open up blackbox.py (normally located in your python site-packages g4f folder) and add this line: within the payload_api_chat headers function, right below "userSelectedModel". Again thank you! EDIT: Ah actually for some reason I'm still getting that message despite putting it in the payload api section... |
this id generated dynamic function uuidv4() {
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, e => (Number(e) ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> Number(e) / 4).toString(16))
} |
Very interesting! How would you integrate this with the blackbox.py script? |
I made fix using nodejs to find key in js using headless browser async function getKey() {
const browser = await puppeteer.launch({
headless: true,
args: ["--no-sandbox"],
});
const page = await browser.newPage();
const regexp = /,w="([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})"/;
let k = "";
page.on("response", async (response) => {
if (response.request().resourceType() === "script") {
try {
let j = await response.text();
if (j.match(regexp) !== null) {
k = j.match(regexp)[1];
}
} catch {}
}
});
await page.goto("https://www.blackbox.ai");
await browser.close();
return k;
} |
That's very nice! I tried integrating it into blackbox.py but I wasn't working for me heh...still thanks for sharing! I think it's working...thanks again! |
Hey everyone! 👋 I wanted to share a useful Python script I've been working with. It's designed to extract the Validated Key from Blackbox.ai's JavaScript files. While this functionality is already integrated into the To run the script:
import requests
import re
def get_key_from_js():
base_url = "https://www.blackbox.ai"
response = requests.get(base_url)
if response.status_code != 200:
print("Failed to load the page.")
return None
# Get the HTML of the page
js_files = re.findall(r'static/chunks/\d{4}-[a-fA-F0-9]+\.js', response.text)
# Pattern to match UUID format in JavaScript files
key_pattern = re.compile(r'w="([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})"')
for js_file in js_files:
js_url = f"{base_url}/_next/{js_file}"
js_response = requests.get(js_url)
if js_response.status_code == 200:
# Find all JavaScript file links
match = key_pattern.search(js_response.text)
if match:
return {"key": match.group(1), "source": js_url}
print("Key not found")
return None
result = get_key_from_js()
if result:
print("Validated Key:", result["key"])
print("Source file:", result["source"])
else:
print("Key not found") Example output:
This script navigates through Blackbox.ai's JavaScript files to find and extract the key. It's a neat example of web scraping and pattern matching in Python. Feel free to use or modify this code for your needs. If you have any questions or suggestions for improvements, don't hesitate to ask. Happy coding! 🐍✨ |
I am very glad that my script will be useful |
Python version: 3.11.1
The text was updated successfully, but these errors were encountered: