Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,8 @@ from wordlist_generator import generate_wordlist # A mock-up function for your
|
|
| 7 |
from dotenv import load_dotenv
|
| 8 |
import os
|
| 9 |
|
| 10 |
-
|
|
|
|
| 11 |
access_token = os.getenv("HUGGINGFACE_ACCESS_TOKEN")
|
| 12 |
|
| 13 |
# Page configuration
|
|
@@ -42,17 +43,20 @@ include_numbers = st.sidebar.checkbox("Include Numbers", value=True)
|
|
| 42 |
st.header("Generated Wordlist Preview")
|
| 43 |
|
| 44 |
# Call to a mock-up function for wordlist generation (you will replace this with your actual logic)
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
# Display the first 20 items in the wordlist
|
| 54 |
st.write(f"Preview of {wordlist_size} words:")
|
| 55 |
-
st.
|
| 56 |
|
| 57 |
# Download link for the full wordlist
|
| 58 |
st.markdown("### Download Full Wordlist")
|
|
@@ -104,6 +108,3 @@ st.markdown("---")
|
|
| 104 |
st.markdown(
|
| 105 |
"Made with ❤️ by Canstralian. For more information on ReconNinja, visit our [GitHub](https://github.com/Canstralian)."
|
| 106 |
)
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
|
|
|
| 7 |
from dotenv import load_dotenv
|
| 8 |
import os
|
| 9 |
|
| 10 |
+
# Load environment variables from .env file
|
| 11 |
+
load_dotenv()
|
| 12 |
access_token = os.getenv("HUGGINGFACE_ACCESS_TOKEN")
|
| 13 |
|
| 14 |
# Page configuration
|
|
|
|
| 43 |
st.header("Generated Wordlist Preview")
|
| 44 |
|
| 45 |
# Call to a mock-up function for wordlist generation (you will replace this with your actual logic)
|
| 46 |
+
try:
|
| 47 |
+
wordlist = generate_wordlist(
|
| 48 |
+
size=wordlist_size,
|
| 49 |
+
min_length=min_length,
|
| 50 |
+
max_length=max_length,
|
| 51 |
+
special_chars=include_special_chars,
|
| 52 |
+
numbers=include_numbers
|
| 53 |
+
)
|
| 54 |
+
except Exception as e:
|
| 55 |
+
st.error(f"Error generating wordlist: {e}")
|
| 56 |
|
| 57 |
# Display the first 20 items in the wordlist
|
| 58 |
st.write(f"Preview of {wordlist_size} words:")
|
| 59 |
+
st.dataframe(pd.DataFrame(wordlist[:20], columns=["Generated Words"])) # Display as a table for better interaction
|
| 60 |
|
| 61 |
# Download link for the full wordlist
|
| 62 |
st.markdown("### Download Full Wordlist")
|
|
|
|
| 108 |
st.markdown(
|
| 109 |
"Made with ❤️ by Canstralian. For more information on ReconNinja, visit our [GitHub](https://github.com/Canstralian)."
|
| 110 |
)
|
|
|
|
|
|
|
|
|