How to get a link to user’s profile picture without Repl Auth using JavaScript?
For example the link to my pfp is here.
I know that once a user is authenticated with Repl Auth, you get access to multiple pieces of information, including a link to their pfp, however I need to get the link without it.
I did see an old post for exactly this here, but I didn’t find any solutions.
import requests
from bs4 import BeautifulSoup
from os import environ
def get_profile_picture_url():
# Construct the URL of the user's Replit profile page
profile_url = f"https://replit.com/@{environ['REPL_OWNER']}"
# Send a GET request to the profile URL and retrieve the HTML content
response = requests.get(profile_url)
html_content = response.text
# Parse the HTML using BeautifulSoup
soup = BeautifulSoup(html_content, 'html.parser')
# Find the profile picture HTML element
profile_picture_element = soup.find('img', {'class': 'avatar-user'})
if profile_picture_element:
# Extract the URL from the 'src' attribute of the profile picture element
profile_picture_url = profile_picture_element['src']
return profile_picture_url
else:
return None
# Usage example
# Replace with the desired username
profile_picture_url = get_profile_picture_url()
if profile_picture_url:
print("Profile Picture URL:", profile_picture_url)
else:
print("Profile picture not found.")
eh I tried this but it never works
Don’t worry I will try and find this
For the javascript part I really don’t know as I just used the “Copy as Fetch” and I don’t use Replit’s GraphQL thing that much so I can’t explain that either. I recommend you ask @PikachuB2005 since they made that copy as fetch thing (or anybody else)