#๐ can someone help
106 messages ยท Page 1 of 1 (latest)
@opaque flare
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.
im getting the error
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "<stdin>", line 4, in main
File "<stdin>", line 3, in check_code
NameError: name 'requests' is not defined
import string
import random
import time
# Configure your Discord webhook URL here
WEBHOOK_URL = 'DISCORD WEEBHOOK HERE'
def generate_random_string(length=16):
characters = string.ascii_letters + string.digits
random_string = ''.join(random.choice(characters) for _ in range(length))
return random_string
def check_code(code):
url = f"https://discordapp.com/api/v9/entitlements/gift-codes/{code}?with_application=false&with_subscription_plan=true"
response = requests.get(url)
return response
def send_to_discord(webhook_url, code):
data = {
"content": f"Valid code found: {code}"
}
response = requests.post(webhook_url, json=data)
return response
def main():
while True:
code = generate_random_string()
response = check_code(code)
if response.status_code == 200:
send_to_discord(WEBHOOK_URL, code)
time.sleep(1) # To prevent spamming the server, adjust the sleep time as needed
if __name__ == "__main__":
main()
That error means the requests library isn't installed. Did you install it?
no how do i install it
Not sure what you did, but you should already have pip installed.
Just do python3 -m pip install "requests"
it says invalid syntax
You run that in a system shell, not a Python shell. Show a screenshot of what you ran.
Use py instead of python3 then. Do you have Python installed?
yes
Ya, so use py instead.
worked
Yay
Oh, don't run code like that. That will be a mess.
The >>> indicates that you're in a REPL, which is meant to run single lines of code at a time.
Not whole programs.
Yep
alr
Then python your_script.py to run it.
wdym
After you put the code into a text file, you need to give it to Python to run it.
I can't really join a call right now.
Have you created a text file and put the code in? Start there.
Where did you save the file?
Ok, then, open the terminal back up, and use cd to navigate to the Downloads directory.
And used cd?
cd means "change directory". It's the terminal equivilent to double clicking a directory.
You need to give it the path to move to.
In this case, cd Downloads.
ok now what
Then cd "New Folder"
now what
Whoops, cd "New folder".
Now py "New Text Document.py"
That's it. That runs the code.
I'm not sure what you mean. Your code ran/is running.
Does it just show a blank terminal now under the command you ran?
Ya, so your code is running.
I have no idea what your code is meant to be doing, so idk.
its meant to generate nitro
I don't know what that means.
That's not a thing
how is it not
it is
it can generate
like
it generates random 16 number alpha numeric values
and theres a small chance
it works
Oh, it's trying to brute force gift codes?
yes
!rule 5
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
:warning: The owner of this post is no longer in the server.
๐
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.