more fixes

~more fixes towards urls
This commit is contained in:
Roy 2023-07-27 16:37:37 -07:00 committed by GitHub
parent 3c4ebaac62
commit 470a741987
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2961,6 +2961,7 @@ print(sys.path) # Add this line to print the value of sys.path
import vdf # Updated import
import binascii
import re
from urllib.parse import quote
# Print the path to the file where the vdf module was loaded from
@ -3111,6 +3112,9 @@ for custom_website in custom_websites:
# Remove any leading or trailing spaces from the custom website URL
custom_website = custom_website.strip()
# Encode the URL to replace special characters with their percent-encoded equivalents
custom_website = quote(custom_website, safe=':/')
# Remove the 'http://' or 'https://' prefix and the 'www.' prefix, if present
clean_website = custom_website.replace('http://', '').replace('https://', '').replace('www.', '')