lexicalspace commited on
Commit
cabe089
·
verified ·
1 Parent(s): 4f41007

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py CHANGED
@@ -1,4 +1,19 @@
1
  import streamlit as st
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  import yt_dlp
3
  import os
4
  import time
@@ -8,6 +23,8 @@ import re
8
  from bs4 import BeautifulSoup
9
  import markdown
10
 
 
 
11
  # --- PAGE CONFIG ---
12
  st.set_page_config(
13
  page_title="Lexical Tools",
 
1
  import streamlit as st
2
+ import socket
3
+
4
+ # --- NETWORK FIX: FORCE IPv4 (Must be at the top) ---
5
+ # This forces the app to use standard internet (IPv4) instead of IPv6
6
+ # which fixes the "[Errno -5] No address associated with hostname" error.
7
+ try:
8
+ _old_getaddrinfo = socket.getaddrinfo
9
+ def _new_getaddrinfo(*args, **kwargs):
10
+ responses = _old_getaddrinfo(*args, **kwargs)
11
+ return [r for r in responses if r[0] == socket.AF_INET]
12
+ socket.getaddrinfo = _new_getaddrinfo
13
+ except:
14
+ pass
15
+ # ----------------------------------------------------
16
+
17
  import yt_dlp
18
  import os
19
  import time
 
23
  from bs4 import BeautifulSoup
24
  import markdown
25
 
26
+ # ... rest of your code ...
27
+
28
  # --- PAGE CONFIG ---
29
  st.set_page_config(
30
  page_title="Lexical Tools",