Using youtube api (v3) instead of v2 to get the video duration .
TNL-2413
This commit is contained in:
@@ -118,8 +118,8 @@ except ImportError:
|
||||
pass
|
||||
|
||||
# Point the URL used to test YouTube availability to our stub YouTube server
|
||||
YOUTUBE['API'] = "127.0.0.1:{0}/get_youtube_api/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['TEST_URL'] = "127.0.0.1:{0}/test_youtube/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['API'] = "http://127.0.0.1:{0}/get_youtube_api/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['METADATA_URL'] = "http://127.0.0.1:{0}/test_youtube/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['TEXT_API']['url'] = "127.0.0.1:{0}/test_transcripts_youtube/".format(YOUTUBE_PORT)
|
||||
|
||||
# Generate a random UUID so that different runs of acceptance tests don't break each other
|
||||
|
||||
@@ -348,3 +348,4 @@ if FEATURES['ENABLE_COURSEWARE_INDEX'] or FEATURES['ENABLE_LIBRARY_INDEX']:
|
||||
|
||||
XBLOCK_SETTINGS = ENV_TOKENS.get('XBLOCK_SETTINGS', {})
|
||||
XBLOCK_SETTINGS.setdefault("VideoDescriptor", {})["licensing_enabled"] = FEATURES.get("LICENSING", False)
|
||||
XBLOCK_SETTINGS.setdefault("VideoModule", {})['YOUTUBE_API_KEY'] = AUTH_TOKENS.get('YOUTUBE_API_KEY', YOUTUBE_API_KEY)
|
||||
|
||||
@@ -103,8 +103,8 @@ FEATURES['ENTRANCE_EXAMS'] = True
|
||||
|
||||
# Point the URL used to test YouTube availability to our stub YouTube server
|
||||
YOUTUBE_PORT = 9080
|
||||
YOUTUBE['API'] = "127.0.0.1:{0}/get_youtube_api/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['TEST_URL'] = "127.0.0.1:{0}/test_youtube/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['API'] = "http://127.0.0.1:{0}/get_youtube_api/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['METADATA_URL'] = "http://127.0.0.1:{0}/test_youtube/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['TEXT_API']['url'] = "127.0.0.1:{0}/test_transcripts_youtube/".format(YOUTUBE_PORT)
|
||||
|
||||
FEATURES['ENABLE_COURSEWARE_INDEX'] = True
|
||||
|
||||
@@ -44,7 +44,7 @@ from lms.envs.common import (
|
||||
PROFILE_IMAGE_SECRET_KEY, PROFILE_IMAGE_MIN_BYTES, PROFILE_IMAGE_MAX_BYTES,
|
||||
# The following setting is included as it is used to check whether to
|
||||
# display credit eligibility table on the CMS or not.
|
||||
ENABLE_CREDIT_ELIGIBILITY
|
||||
ENABLE_CREDIT_ELIGIBILITY, YOUTUBE_API_KEY
|
||||
)
|
||||
from path import path
|
||||
from warnings import simplefilter
|
||||
@@ -654,10 +654,10 @@ CELERY_QUEUES = {
|
||||
|
||||
YOUTUBE = {
|
||||
# YouTube JavaScript API
|
||||
'API': 'www.youtube.com/iframe_api',
|
||||
'API': 'https://www.youtube.com/iframe_api',
|
||||
|
||||
# URL to test YouTube availability
|
||||
'TEST_URL': 'gdata.youtube.com/feeds/api/videos/',
|
||||
# URL to get YouTube metadata
|
||||
'METADATA_URL': 'https://www.googleapis.com/youtube/v3/videos',
|
||||
|
||||
# Current youtube api for requesting transcripts.
|
||||
# For example: http://video.google.com/timedtext?lang=en&v=j_jEn79vS3g.
|
||||
@@ -996,6 +996,9 @@ ELASTIC_FIELD_MAPPINGS = {
|
||||
XBLOCK_SETTINGS = {
|
||||
"VideoDescriptor": {
|
||||
"licensing_enabled": FEATURES.get("LICENSING", False)
|
||||
},
|
||||
'VideoModule': {
|
||||
'YOUTUBE_API_KEY': YOUTUBE_API_KEY
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user