jpjp9292 commited on
Commit
d1ff0c4
·
verified ·
1 Parent(s): 766b6d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -21
app.py CHANGED
@@ -31,24 +31,6 @@ def download_video(url, progress_bar, status_text):
31
  'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0'
32
  ]
33
 
34
- # ydl_opts = {
35
- # 'format': 'best',
36
- # 'outtmpl': str(output_dir / '%(title)s.%(ext)s'),
37
- # 'quiet': True,
38
- # 'no_warnings': True,
39
- # # 쿠키 파일 설정
40
- # 'cookiefile': 'youtube.com_cookies.txt',
41
- # 'user_agent': random.choice(user_agents),
42
- # 'referer': 'https://www.youtube.com/',
43
- # 'http_chunk_size': random.randint(10000000, 15000000),
44
- # 'retries': 3,
45
- # 'sleep_interval': 1,
46
- # 'max_sleep_interval': 5,
47
- # 'headers': {
48
- # 'Accept-Language': 'en-US,en;q=0.9',
49
- # 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
50
- # }
51
- # }
52
  ydl_opts = {
53
  'format': 'best',
54
  'outtmpl': str(output_dir / '%(title)s.%(ext)s'),
@@ -61,14 +43,12 @@ def download_video(url, progress_bar, status_text):
61
  'retries': 1,
62
  'sleep_interval': 3,
63
  'max_sleep_interval': 8,
64
- 'proxy': 'http://your_proxy_address:port', # Optional: Set up if proxy is available
65
  'headers': {
66
  'Accept-Language': 'en-US,en;q=0.9',
67
  'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
68
  },
69
  }
70
 
71
-
72
  def progress_hook(d):
73
  if d['status'] == 'downloading':
74
  try:
@@ -156,4 +136,4 @@ if download_button:
156
  # 초기화 로직
157
  if reset_button:
158
  st.session_state.video_url = ""
159
- st.rerun()
 
31
  'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0'
32
  ]
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  ydl_opts = {
35
  'format': 'best',
36
  'outtmpl': str(output_dir / '%(title)s.%(ext)s'),
 
43
  'retries': 1,
44
  'sleep_interval': 3,
45
  'max_sleep_interval': 8,
 
46
  'headers': {
47
  'Accept-Language': 'en-US,en;q=0.9',
48
  'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
49
  },
50
  }
51
 
 
52
  def progress_hook(d):
53
  if d['status'] == 'downloading':
54
  try:
 
136
  # 초기화 로직
137
  if reset_button:
138
  st.session_state.video_url = ""
139
+ st.rerun()