Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-video-pipeline
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-video-pipeline
Commits
e0e2d4c9
Unverified
Commit
e0e2d4c9
authored
Nov 29, 2017
by
Muhammad Ammar
Committed by
GitHub
Nov 29, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #71 from edx/ammar/improve-url-construction
improve url construction
parents
7de77557
b96b1e55
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
+14
-14
VEDA/utils.py
+1
-1
control/tests/test_deliver_cielo.py
+6
-6
control/veda_deliver_cielo.py
+7
-7
No files found.
VEDA/utils.py
View file @
e0e2d4c9
...
...
@@ -90,7 +90,7 @@ def scrub_query_params(url, params_to_scrub):
>>> old_url = https://sandbox.veda.com/api/do?api_token=veda_api_key&job_name=12345&language=en&v=1
>>> new_url = https://sandbox.veda.com/api/do?v=1&job_name=12345&language=en&api_token=XXXXXXXXXXXX
"""
parsed
=
urlparse
.
urlparse
(
url
lib
.
unquote
(
url
)
)
parsed
=
urlparse
.
urlparse
(
url
)
# query_params will be in the form of [('v', '1'), ('job_name', '12345')]
query_params
=
urlparse
.
parse_qsl
(
parsed
.
query
)
...
...
control/tests/test_deliver_cielo.py
View file @
e0e2d4c9
...
...
@@ -146,13 +146,13 @@ class Cielo24TranscriptTests(TestCase):
v
=
CIELO24_API_VERSION
,
job_id
=
'000-111-222'
,
target_language
=
'TARGET_LANG'
,
callback_url
=
build_url
(
callback_url
=
'{}?job_id={}&iwp_name={}&lang_code={}&org={}&video_id={}'
.
format
(
'https://veda.edx.org/cielo24/transcript_completed/1234567890'
,
lang_code
=
'TARGET_LANG
'
,
video_id
=
'12345
'
,
job_id
=
'000-111-222
'
,
iwp_name
=
'{iwp_name}
'
,
org
=
'MAx
'
,
'000-111-222
'
,
'{iwp_name}
'
,
'TARGET_LANG
'
,
'MAx
'
,
'12345
'
,
),
api_token
=
'cielo24_api_key'
,
priority
=
'PRIORITY'
,
...
...
control/veda_deliver_cielo.py
View file @
e0e2d4c9
...
...
@@ -117,13 +117,13 @@ class Cielo24Transcript(object):
"""
Request cielo24 to generate transcripts for a video.
"""
callback_url
=
build_url
(
callback_url
=
'{}?job_id={}&iwp_name={}&lang_code={}&org={}&video_id={}'
.
format
(
self
.
callback_base_url
,
job_id
=
job_id
,
iwp_name
=
'{iwp_name}'
,
lang_code
=
lang_code
,
org
=
self
.
org
,
video_id
=
self
.
video
.
studio_id
job_id
,
'{iwp_name}'
,
lang_code
,
self
.
org
,
self
.
video
.
studio_id
)
perform_transcript_url
=
build_url
(
...
...
@@ -136,7 +136,7 @@ class Cielo24Transcript(object):
api_token
=
self
.
api_key
,
priority
=
self
.
turnaround
,
transcription_fidelity
=
self
.
fidelity
,
options
=
json
.
dumps
({
"return_iwp"
:
[
"FINAL"
]})
options
=
json
.
dumps
({
"return_iwp"
:[
"FINAL"
]})
)
response
=
requests
.
get
(
perform_transcript_url
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment