Mbonea commited on
Commit
65e5abb
1 Parent(s): 37775fa

removed unsilence

Browse files
Files changed (1) hide show
  1. App/Worker.py +20 -11
App/Worker.py CHANGED
@@ -12,6 +12,7 @@ import json
12
  import os
13
  from pydantic import BaseModel
14
 
 
15
  class YouTubeUploadTask(BaseModel):
16
  filename: str
17
  title: str = "Default Title"
@@ -22,7 +23,6 @@ class YouTubeUploadTask(BaseModel):
22
  thumbnail: str = None
23
 
24
 
25
-
26
  celery = Celery()
27
  celery.config_from_object(celery_config)
28
  # celery.conf.update(
@@ -45,6 +45,7 @@ def create_json_file(assets: List[Assets], asset_dir: str):
45
  with open(os.path.join(asset_dir, filename), "w") as f:
46
  f.write(json_string)
47
 
 
48
  @celery.task(name="Constants")
49
  def create_constants_json_file(constants: Constants, asset_dir: str):
50
  filename = "Constants.json"
@@ -103,17 +104,23 @@ def upload_video_to_youtube(task_data: dict):
103
 
104
  # Build the command
105
  command = [
106
- '/srv/youtube/youtubeuploader', # Adjust the path as needed
107
- '-filename', task.filename,
108
- '-title', task.title,
109
- '-description', task.description,
110
- '-categoryId', task.category_id,
111
- '-privacy', task.privacy,
112
- '-tags', task.tags
 
 
 
 
 
 
113
  ]
114
 
115
  if task.thumbnail:
116
- command.extend(['-thumbnail', task.thumbnail])
117
 
118
  # Execute the command
119
  result = run(command, capture_output=True, text=True)
@@ -133,7 +140,9 @@ def download_assets(links: List[LinkInfo], temp_dir: str):
133
  @celery.task(name="RenderFile")
134
  def render_video(directory: str, output_directory: str):
135
  os.chdir(directory)
136
- os.system(f"npm run build --enable-multiprocess-on-linux --output {output_directory}")
 
 
137
  print("complete")
138
 
139
 
@@ -177,7 +186,7 @@ def celery_task(video_task: EditorRequest):
177
  create_json_file.si(video_task.assets, assets_dir),
178
  download_assets.si(video_task.links, temp_dir) if video_task.links else None,
179
  render_video.si(temp_dir, output_dir),
180
- unsilence.si(temp_dir),
181
  cleanup_temp_directory.si(temp_dir, output_dir),
182
  ).apply_async(
183
  # link_error=handle_error
 
12
  import os
13
  from pydantic import BaseModel
14
 
15
+
16
  class YouTubeUploadTask(BaseModel):
17
  filename: str
18
  title: str = "Default Title"
 
23
  thumbnail: str = None
24
 
25
 
 
26
  celery = Celery()
27
  celery.config_from_object(celery_config)
28
  # celery.conf.update(
 
45
  with open(os.path.join(asset_dir, filename), "w") as f:
46
  f.write(json_string)
47
 
48
+
49
  @celery.task(name="Constants")
50
  def create_constants_json_file(constants: Constants, asset_dir: str):
51
  filename = "Constants.json"
 
104
 
105
  # Build the command
106
  command = [
107
+ "/srv/youtube/youtubeuploader", # Adjust the path as needed
108
+ "-filename",
109
+ task.filename,
110
+ "-title",
111
+ task.title,
112
+ "-description",
113
+ task.description,
114
+ "-categoryId",
115
+ task.category_id,
116
+ "-privacy",
117
+ task.privacy,
118
+ "-tags",
119
+ task.tags,
120
  ]
121
 
122
  if task.thumbnail:
123
+ command.extend(["-thumbnail", task.thumbnail])
124
 
125
  # Execute the command
126
  result = run(command, capture_output=True, text=True)
 
140
  @celery.task(name="RenderFile")
141
  def render_video(directory: str, output_directory: str):
142
  os.chdir(directory)
143
+ os.system(
144
+ f"npm run build --enable-multiprocess-on-linux --output {output_directory}"
145
+ )
146
  print("complete")
147
 
148
 
 
186
  create_json_file.si(video_task.assets, assets_dir),
187
  download_assets.si(video_task.links, temp_dir) if video_task.links else None,
188
  render_video.si(temp_dir, output_dir),
189
+ # unsilence.si(temp_dir),
190
  cleanup_temp_directory.si(temp_dir, output_dir),
191
  ).apply_async(
192
  # link_error=handle_error