@require_admin
@api_handle_error_with_json
def start_video_download(request):
 force_job('videodownload', stop=True, locale=request.language)
 paths = OrderedSet(json.loads((request.body or '{}')).get('paths', []))
 lang = json.loads((request.body or '{}')).get('lang', 'en')
 youtube_ids = get_download_youtube_ids(paths, language=lang, downloaded=False)
 queue = VideoQueue()
 queue.add_files(youtube_ids, language=lang)
 force_job('videodownload', _('Download Videos'), locale=lang)
 return JsonResponseMessageSuccess(_('Launched video download process successfully.'))

@ require_admin @ api_handle_error_with_json def start_video_download ( request ) : force_job ( 'videodownload' , stop = True , locale = request . language ) paths = OrderedSet ( json . loads ( ( request . body or '{}' ) ) . get ( 'paths' , [ ] ) ) lang = json . loads ( ( request . body or '{}' ) ) . get ( 'lang' , 'en' ) youtube_ids = get_download_youtube_ids ( paths , language = lang , downloaded = False ) queue = VideoQueue ( ) queue . add_files ( youtube_ids , language = lang ) force_job ( 'videodownload' , _ ( 'Download Videos' ) , locale = lang ) return JsonResponseMessageSuccess ( _ ( 'Launched video download process successfully.' ) )
api endpoint for launching the videodownload job .