-
Notifications
You must be signed in to change notification settings - Fork 33
/
tasks.py
26 lines (18 loc) · 846 Bytes
/
tasks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from celery.utils.log import get_task_logger
from celery import Celery
import smol_podcaster
logger = get_task_logger(__name__)
app = Celery('tasks')
app.config_from_object('celeryconfig')
@app.task
def run_smol_podcaster(url, name, speakers, transcript_only, generate_extra):
logger.info(f"Running smol_podcaster for {name}")
results = smol_podcaster.main(url, name, speakers, transcript_only, generate_extra)
logger.info(f"Results for {name}: {results}")
return "The path was: " + results
@app.task
def run_video_chapters(chapters, audio_name, video_name):
logger.info(f"Updating video chapters for {audio_name}")
results = smol_podcaster.update_video_chapters(chapters, audio_name, video_name)
logger.info(f"Updated video chapters for {audio_name}: {results}")
return "The path was: " + results