mobenta commited on
Commit
cf4670d
·
verified ·
1 Parent(s): 072569c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -3
app.py CHANGED
@@ -1,13 +1,26 @@
 
 
1
  import random
2
- import logging
3
- import yt_dlp
4
  import time
 
 
 
 
 
5
  import gradio as gr
 
 
 
 
 
6
 
7
  # Configure logging for debugging purposes
8
  logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
9
 
10
- # Define the list of proxies provided by you
 
 
 
11
  PROXIES = [
12
  '43.134.229.98:3128', '35.220.254.137:8080', '31.129.253.30:40223', '41.204.53.17:80', '193.233.84.88:1080',
13
  '4.158.61.222:8080', '66.29.154.105:3128', '160.86.242.23:8080', '20.26.249.29:8080', '85.210.84.189:8080',
 
1
+ import subprocess
2
+ import sys
3
  import random
 
 
4
  import time
5
+ import os # <-- Added import for os module to handle file checks
6
+
7
+ # Ensure compatible versions of httpx and httpcore are installed
8
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "httpx==0.18.2", "httpcore==0.13.6"])
9
+
10
  import gradio as gr
11
+ import requests
12
+ import re
13
+ import yt_dlp
14
+ import logging
15
+ from fake_useragent import UserAgent
16
 
17
  # Configure logging for debugging purposes
18
  logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
19
 
20
+ # Set up User-Agent rotation
21
+ ua = UserAgent()
22
+
23
+ # Define the list of proxies provided
24
  PROXIES = [
25
  '43.134.229.98:3128', '35.220.254.137:8080', '31.129.253.30:40223', '41.204.53.17:80', '193.233.84.88:1080',
26
  '4.158.61.222:8080', '66.29.154.105:3128', '160.86.242.23:8080', '20.26.249.29:8080', '85.210.84.189:8080',