Commit 255fd487 by muhammad-ammar Committed by muzaffaryousaf

cielo24 fixes

parent 2fa85511
......@@ -114,12 +114,12 @@ class Cielo24TranscriptTests(APITestCase):
self.transcript_process_metadata = TranscriptProcessMetadata.objects.create(**metadata)
self.transcript_create_data = {
'transcript_format': transcripts.TRANSCRIPT_SJSON,
'file_format': transcripts.TRANSCRIPT_SJSON,
'video_id': self.video.studio_id,
'transcript_url': '{directory}{uuid}.sjson'.format(
'name': '{directory}{uuid}.sjson'.format(
directory=CONFIG_DATA['transcript_bucket_directory'], uuid=self.uuid_hex
),
'language': 'en',
'language_code': 'en',
'provider': TranscriptProvider.CIELO24
}
......@@ -227,7 +227,7 @@ class Cielo24TranscriptTests(APITestCase):
# verify sjson data uploaded to s3
bucket = conn.get_bucket(CONFIG_DATA['transcript_bucket_name'])
key = Key(bucket)
key.key = transcript_create_request_data['transcript_url']
key.key = transcript_create_request_data['name']
sjson = json.loads(key.get_contents_as_string())
self.assertEqual(sjson, TRANSCRIPT_SJSON_DATA)
......
......@@ -137,7 +137,7 @@ def cielo24_transcript_callback(sender, **kwargs):
provider=TranscriptProvider.CIELO24,
process_id=job_id,
lang_code=lang_code
).latest('modified')
).latest()
except TranscriptProcessMetadata.DoesNotExist:
LOGGER.exception(
'[CIELO24 TRANSCRIPTS] Unable to get transcript process metadata for job_id=%s',
......
......@@ -126,7 +126,7 @@ class Cielo24TranscriptTests(TestCase):
'method': 'GET'
},
{
'url': 'https://api.cielo24.com/api/job/perform_transcription?transcription_fidelity=PROFESSIONAL&job_id=000-111-222&v=1&priority=PRIORITY&api_token=cielo24_api_key&callback_url=https%253A%252F%252Fveda.edx.org%252Fcielo24%252Ftranscript_completed%252F1234567890%253Flang_code%253D{}%2526video_id%253D12345%2526job_id%253D000-111-222%2526org%253DMAx&target_language={}',
'url': 'https://api.cielo24.com/api/job/perform_transcription?transcription_fidelity=PROFESSIONAL&job_id=000-111-222&v=1&priority=PRIORITY&api_token=cielo24_api_key&callback_url=https%3A%2F%2Fveda.edx.org%2Fcielo24%2Ftranscript_completed%2F1234567890%3Flang_code%3D{}%26video_id%3D12345%26job_id%3D000-111-222%26org%3DMAx&target_language={}',
'body': None,
'method': 'GET'
}
......
......@@ -105,15 +105,14 @@ class Cielo24Transcript(object):
"""
Request cielo24 to generate transcripts for a video.
"""
callback_url = urllib.quote_plus(
build_url(
self.callback_base_url,
job_id=job_id,
lang_code=lang_code,
org=self.org,
video_id=self.video.studio_id
)
callback_url = build_url(
self.callback_base_url,
job_id=job_id,
lang_code=lang_code,
org=self.org,
video_id=self.video.studio_id
)
response = requests.get(
build_url(
self.cielo24_site,
......
......@@ -398,10 +398,10 @@ class VALAPICall():
post_data = {
'video_id': video_id,
'language': lang_code,
'transcript_url': name,
'transcript_format': transcript_format,
'name': name,
'provider': provider,
'language_code': lang_code,
'file_format': transcript_format,
}
response = requests.post(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment