Skip to content

Commit

Permalink
fix: [crawler] fix api create_task
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Jan 9, 2024
1 parent a14c048 commit bd2ca4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/lib/crawlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1788,14 +1788,16 @@ def api_add_crawler_capture(data, user_id):
return {'error': 'Invalid task_uuid', 'task_uuid': task_uuid}, 400
capture_uuid = data.get('capture_uuid')
if not capture_uuid:
return {'error': 'Invalid capture_uuid', 'task_uuid': capture_uuid}, 400
return {'error': 'Invalid capture_uuid', 'capture_uuid': capture_uuid}, 400

# parent = data.get('parent')

# TODO parent
task_uuid = create_task(task['url'], depth=task['depth_limit'], har=task['har'], screenshot=task['screenshot'],
proxy=task['proxy'], tags=task['tags'],
parent='manual', task_uuid=task_uuid, external=True)
if not task_uuid:
return {'error': 'Aborted by Crawler', 'task_uuid': task_uuid, 'capture_uuid': capture_uuid}, 400
task = CrawlerTask(task_uuid)
create_capture(capture_uuid, task_uuid)
task.start()
Expand Down

0 comments on commit bd2ca4b

Please sign in to comment.