qingxu98 commited on
Commit
e788445
·
1 Parent(s): da6e788
docker_as_a_service/docker_as_a_service.py CHANGED
@@ -51,17 +51,14 @@ async def stream_generator(request_obj):
51
  # Get list of existing files before download
52
  existing_file_before_download = []
53
 
54
- if request_obj.endpoint == "down_bilibili":
55
- video_id = request_obj.client_command
56
- cmd = [
57
- '/root/.dotnet/tools/BBDown',
58
- video_id,
59
- '--use-app-api',
60
- '--work-dir',
61
- f'{os.path.abspath(temp_dir)}'
62
- ]
63
- else:
64
- assert False, "Invalid endpoint"
65
 
66
 
67
  cmd = ' '.join(cmd)
@@ -145,7 +142,6 @@ async def stream_response(file: UploadFile = File(...)):
145
  with io.BytesIO(content) as f:
146
  request_obj = pickle.load(f)
147
  # process the request_obj
148
- request_obj.endpoint = "down_bilibili"
149
  return StreamingResponse(stream_generator(request_obj), media_type="application/octet-stream")
150
 
151
  @app.post("/search")
 
51
  # Get list of existing files before download
52
  existing_file_before_download = []
53
 
54
+ video_id = request_obj.client_command
55
+ cmd = [
56
+ '/root/.dotnet/tools/BBDown',
57
+ video_id,
58
+ '--use-app-api',
59
+ '--work-dir',
60
+ f'{os.path.abspath(temp_dir)}'
61
+ ]
 
 
 
62
 
63
 
64
  cmd = ' '.join(cmd)
 
142
  with io.BytesIO(content) as f:
143
  request_obj = pickle.load(f)
144
  # process the request_obj
 
145
  return StreamingResponse(stream_generator(request_obj), media_type="application/octet-stream")
146
 
147
  @app.post("/search")