torrent-downloader-react 1.0.17__tar.gz → 1.0.19__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (16) hide show
  1. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.19}/PKG-INFO +1 -1
  2. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.19}/setup.py +1 -1
  3. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.19}/torrent_downloader/server.py +51 -0
  4. torrent-downloader-react-1.0.19/torrent_downloader/static/assets/index-COG6Byoc.js +49 -0
  5. torrent-downloader-react-1.0.17/torrent_downloader/static/assets/index-DVy8AvwL.css → torrent-downloader-react-1.0.19/torrent_downloader/static/assets/index-CdUAChFP.css +1 -1
  6. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.19}/torrent_downloader/static/index.html +2 -2
  7. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.19}/torrent_downloader_react.egg-info/PKG-INFO +1 -1
  8. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.19}/torrent_downloader_react.egg-info/SOURCES.txt +2 -2
  9. torrent-downloader-react-1.0.17/torrent_downloader/static/assets/index-BWN4x5dM.js +0 -49
  10. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.19}/setup.cfg +0 -0
  11. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.19}/torrent_downloader/__init__.py +0 -0
  12. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.19}/torrent_downloader/static/vite.svg +0 -0
  13. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.19}/torrent_downloader_react.egg-info/dependency_links.txt +0 -0
  14. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.19}/torrent_downloader_react.egg-info/entry_points.txt +0 -0
  15. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.19}/torrent_downloader_react.egg-info/requires.txt +0 -0
  16. {torrent-downloader-react-1.0.17 → torrent-downloader-react-1.0.19}/torrent_downloader_react.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: torrent-downloader-react
3
- Version: 1.0.17
3
+ Version: 1.0.19
4
4
  Summary: A modern, user-friendly torrent downloader application
5
5
  Home-page: https://github.com/yourusername/torrent-downloader
6
6
  Author: Your Name
@@ -7,7 +7,7 @@ with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "README.md"),
7
7
 
8
8
  setup(
9
9
  name="torrent-downloader-react",
10
- version="1.0.17",
10
+ version="1.0.19",
11
11
  packages=find_packages(),
12
12
  install_requires=[
13
13
  "fastapi>=0.109.0",
@@ -75,6 +75,17 @@ DOWNLOAD_PATH = get_downloads_dir()
75
75
  session = lt.session()
76
76
  settings = session.get_settings()
77
77
  settings['listen_interfaces'] = '0.0.0.0:6881'
78
+ settings['active_downloads'] = -1 # No limit
79
+ settings['active_seeds'] = -1 # No limit
80
+ settings['active_limit'] = -1 # No limit
81
+ settings['auto_manage_interval'] = 1 # Check every second
82
+ settings['active_tracker_limit'] = -1 # No limit
83
+ settings['enable_outgoing_utp'] = True
84
+ settings['enable_incoming_utp'] = True
85
+ settings['announce_to_all_tiers'] = True
86
+ settings['announce_to_all_trackers'] = True
87
+ settings['aio_threads'] = 8 # Number of async I/O threads
88
+ settings['checking_mem_usage'] = 128 # Memory usage for checking (in MB)
78
89
  session.apply_settings(settings)
79
90
 
80
91
  # Store active torrents
@@ -88,6 +99,7 @@ class TorrentInfo(BaseModel):
88
99
  name: str
89
100
  progress: float
90
101
  download_speed: float
102
+ upload_speed: float
91
103
  state: str
92
104
  total_size: int
93
105
  downloaded: int
@@ -131,12 +143,15 @@ async def list_torrents() -> List[TorrentInfo]:
131
143
  state_str = "finished"
132
144
  elif status.state == lt.torrent_status.checking_files:
133
145
  state_str = "checking"
146
+ elif status.state == lt.torrent_status.paused:
147
+ state_str = "paused"
134
148
 
135
149
  info = TorrentInfo(
136
150
  id=torrent_id,
137
151
  name=handle.name(),
138
152
  progress=status.progress * 100,
139
153
  download_speed=status.download_rate / 1024, # Convert to KB/s
154
+ upload_speed=status.upload_rate / 1024, # Convert to KB/s
140
155
  state=state_str,
141
156
  total_size=status.total_wanted,
142
157
  downloaded=status.total_wanted_done
@@ -167,6 +182,42 @@ async def open_downloads():
167
182
  raise HTTPException(status_code=500, detail="Failed to open downloads folder")
168
183
  return {"message": "Downloads folder opened successfully"}
169
184
 
185
+ @app.post("/api/torrent/{torrent_id}/pause")
186
+ async def pause_torrent(torrent_id: str):
187
+ """Pause a specific torrent."""
188
+ if torrent_id not in active_torrents:
189
+ raise HTTPException(status_code=404, detail="Torrent not found")
190
+
191
+ handle = active_torrents[torrent_id]
192
+ handle.pause()
193
+ # Force an immediate pause
194
+ handle.flush_cache()
195
+ return {"message": "Torrent paused successfully"}
196
+
197
+ @app.post("/api/torrent/{torrent_id}/resume")
198
+ async def resume_torrent(torrent_id: str):
199
+ """Resume a specific torrent."""
200
+ if torrent_id not in active_torrents:
201
+ raise HTTPException(status_code=404, detail="Torrent not found")
202
+
203
+ handle = active_torrents[torrent_id]
204
+ handle.resume()
205
+ return {"message": "Torrent resumed successfully"}
206
+
207
+ @app.post("/api/torrent/pause-all")
208
+ async def pause_all_torrents():
209
+ """Pause all active torrents."""
210
+ for handle in active_torrents.values():
211
+ handle.pause()
212
+ return {"message": "All torrents paused successfully"}
213
+
214
+ @app.post("/api/torrent/resume-all")
215
+ async def resume_all_torrents():
216
+ """Resume all active torrents."""
217
+ for handle in active_torrents.values():
218
+ handle.resume()
219
+ return {"message": "All torrents resumed successfully"}
220
+
170
221
  def main():
171
222
  """Entry point for the application."""
172
223
  import uvicorn