Ethscriptions commited on
Commit
e760cda
·
1 Parent(s): 099be0a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -4
app.py CHANGED
@@ -9,16 +9,25 @@ st.title('磁力链接 BT 下载器')
9
  magnet_link = st.text_input('请输入磁力链接:')
10
 
11
  if magnet_link:
12
- # 创建一个会话并配置设置
13
  ses = lt.session()
 
 
14
  settings = {
15
- 'connections_limit': 500, # 增加连接数限制
16
- 'download_rate_limit': 0, # 不限制下载速度
17
- 'upload_rate_limit': 0, # 不限制上传速度
 
 
 
 
 
 
18
  # ... 其他设置
19
  }
20
  ses.apply_settings(settings)
21
 
 
22
  h = lt.add_magnet_uri(ses, magnet_link, {'save_path': './downloads'})
23
  st.write('开始下载...')
24
 
 
9
  magnet_link = st.text_input('请输入磁力链接:')
10
 
11
  if magnet_link:
12
+ # 创建一个会话并配置更多的设置以优化下载速度
13
  ses = lt.session()
14
+
15
+ # 更具体的优化设置
16
  settings = {
17
+ 'connections_limit': 500, # 最大连接数
18
+ 'download_rate_limit': 0, # 下载速率限制 (0 表示无限制)
19
+ 'upload_rate_limit': 0, # 上传速率限制 (0 表示无限制)
20
+ 'active_downloads': 10, # 同时进行的活跃下载数
21
+ 'active_limit': 20, # 允许的活跃 torrent 数
22
+ 'active_seeds': 10, # 同时进行的活跃做种数
23
+ 'alert_mask': 0, # 控制 libtorrent 产生哪些警告信息
24
+ 'file_pool_size': 512, # 文件池大小限制
25
+ 'utp_dynamic_sock_buf': True, # 使用动态套接字缓冲区
26
  # ... 其他设置
27
  }
28
  ses.apply_settings(settings)
29
 
30
+ # 添加磁力链接以开始下载
31
  h = lt.add_magnet_uri(ses, magnet_link, {'save_path': './downloads'})
32
  st.write('开始下载...')
33