From 68f80936055eeb268dce2050120fac2e82ccb103 Mon Sep 17 00:00:00 2001 From: Bernard Szabo Date: Wed, 30 Nov 2022 09:57:59 -0500 Subject: [PATCH] feat: TNL-9460 TEXT_API -> TRANSCRIPTS TEXT_API should have been deleted in this commit, but wasn't. Attended to in a later commit. --- cms/envs/common.py | 3 ++- lms/envs/common.py | 3 ++- xmodule/tests/test_video.py | 7 +++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/cms/envs/common.py b/cms/envs/common.py index 9eaabe6c32..42e4fc19e6 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -1516,7 +1516,7 @@ YOUTUBE = { # URL to get YouTube metadata 'METADATA_URL': 'https://www.googleapis.com/youtube/v3/videos', - # Current youtube api for requesting transcripts. + # Deprecated youtube api for requesting transcripts. # For example: http://video.google.com/timedtext?lang=en&v=j_jEn79vS3g. 'TEXT_API': { 'url': 'video.google.com/timedtext', @@ -1526,6 +1526,7 @@ YOUTUBE = { }, }, + # Current web page mechanism for scraping transcript information from youtube video pages 'TRANSCRIPTS': { 'CAPTION_TRACKS_REGEX': r"captionTracks\"\:\[(?P[^\]]+)", 'YOUTUBE_URL_BASE': 'https://www.youtube.com/watch?v=', diff --git a/lms/envs/common.py b/lms/envs/common.py index 6a5cd8a5ea..0d301279fd 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -2906,7 +2906,7 @@ YOUTUBE = { # URL to get YouTube metadata 'METADATA_URL': 'https://www.googleapis.com/youtube/v3/videos/', - # Current youtube api for requesting transcripts. + # Deprecated youtube api for requesting transcripts. # For example: http://video.google.com/timedtext?lang=en&v=j_jEn79vS3g. 'TEXT_API': { 'url': 'video.google.com/timedtext', @@ -2916,6 +2916,7 @@ YOUTUBE = { }, }, + # Current web page mechanism for scraping transcript information from youtube video pages 'TRANSCRIPTS': { 'CAPTION_TRACKS_REGEX': r"captionTracks\"\:\[(?P[^\]]+)", 'YOUTUBE_URL_BASE': 'https://www.youtube.com/watch?v=', diff --git a/xmodule/tests/test_video.py b/xmodule/tests/test_video.py index 79e2522ce2..3f2ec02801 100644 --- a/xmodule/tests/test_video.py +++ b/xmodule/tests/test_video.py @@ -916,6 +916,12 @@ class VideoBlockStudentViewDataTestCase(unittest.TestCase): 'v': 'set_youtube_id_of_11_symbols_here', }, }, + + # Current web page mechanism for scraping transcript information from youtube video pages + 'TRANSCRIPTS': { + 'CAPTION_TRACKS_REGEX': r"captionTracks\"\:\[(?P[^\]]+)", + 'YOUTUBE_URL_BASE': 'https://www.youtube.com/watch?v=', + } }) @patch.object(settings, 'CONTENTSTORE', create=True, new={ 'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore', @@ -1007,6 +1013,7 @@ class VideoBlockIndexingTestCase(unittest.TestCase): start_time="00:00:01" download_video="false" end_time="00:01:00"> + end_time="00:01:00">