How can I debug not being able to import youtube transcripts?

Hello. What’s the correct way to find the data necessary to help debug why the youtube transcript import button doesn’t work, so that I can provide it here? (I’m running Lilac with tutor.)

I found the following in my logs,

ESC[32mcms_1            |ESC[0m [pid: 109|app: -1|req: -1/56] 172.18.0.13 () {58 vars in 2340 bytes} [Sun Apr  3 14:04:49 2022] GET /static/studio/indigo/images/favicon.e5
a6e8c56bd8.ico => generated 6119 bytes in 0 msecs via sendfile() (HTTP/1.0 200) 3 headers in 127 bytes (0 switches on core 0)
ESC[32mcms_1            |ESC[0m 2022-04-03 14:04:49,676 INFO 7 [tracking] [user 3] [ip 123.321.111.222] logger.py:41 - {"name": "/xblock/container/block-v1:site+class+version+type@vertical+block@a63cdf2a9bde418db24e426823344516", "context": {"user_id": 3, "path": "/xblock/container/block-v1:site
+class+version+type@vertical+block@a63cdf2a9bde418db24e426823344516", "course_id": "", "org_id": ""}, "username": "User", "session": "9b06ffaa632ac9442093b93
17b44ac97", "ip": "123.321.111.222", "agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36", "host": "studio.be
ta.ost2.fyi", "referer": "https://studio.foo.bar.com/container/block-v1:site+class+version+type@vertical+block@a63cdf2a9bde418db24e4268233
44516", "accept_language": "en-US,en;q=0.9", "event": "{\"GET\": {}, \"POST\": {}}", "time": "2022-04-03T14:04:49.676012+00:00", "event_type": "/xblock/container/block-v1:
site+class+version+type@vertical+block@a63cdf2a9bde418db24e426823344516", "event_source": "server", "page": null}
ESC[32mcms_1            |ESC[0m 2022-04-03 14:04:49,746 INFO 109 [tracking] [user 3] [ip 123.321.111.222] logger.py:41 - {"name": "/preview/xblock/block-v1:site+class+version+type@video+block@56ad6f69fb174512ab1b9a4adfeba193/handler/transcript/translation/en", "context": {"user_id": 3, "path": "/preview/xblock/b
lock-v1:site+class+version+type@video+block@56ad6f69fb174512ab1b9a4adfeba193/handler/transcript/translation/en", "course_id": "", "org_id": 
""}, "username": "User", "session": "9b06ffaa632ac9442093b9317b44ac97", "ip": "123.321.111.222", "agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Ge
cko) Chrome/98.0.4758.102 Safari/537.36", "host": "studio.foo.bar.com", "referer": "https://studio.foo.bar.com/container/block-v1:site+class+version+type@vertical+block@a63cdf2a9bde418db24e426823344516", "accept_language": "en-US,en;q=0.9", "event": "{\"GET\": {\"videoId\": [\"censored\"]}, \"POST\": {}
}", "time": "2022-04-03T14:04:49.746329+00:00", "event_type": "/preview/xblock/block-v1:site+class+version+type@video+block@56ad6f69fb174512
ab1b9a4adfeba193/handler/transcript/translation/en", "event_source": "server", "page": null}
ESC[32mcms_1            |ESC[0m 2022-04-03 14:04:49,810 ERROR 109 [xmodule.video_module.video_handlers] [user 3] [ip 123.321.111.222] video_handlers.py:351 - [Translation Di
spatch] block-v1:site+class+version+type@video+block@56ad6f69fb174512ab1b9a4adfeba193
ESC[32mcms_1            |ESC[0m Traceback (most recent call last):
ESC[32mcms_1            |ESC[0m   File "/openedx/edx-platform/common/lib/xmodule/xmodule/video_module/transcripts_utils.py", line 1062, in get_transcript
ESC[32mcms_1            |ESC[0m     raise NotFoundError
ESC[32mcms_1            |ESC[0m xmodule.exceptions.NotFoundError
ESC[32mcms_1            |ESC[0m 
ESC[32mcms_1            |ESC[0m During handling of the above exception, another exception occurred:
ESC[32mcms_1            |ESC[0m 
ESC[32mcms_1            |ESC[0m Traceback (most recent call last):
ESC[32mcms_1            |ESC[0m   File "/openedx/edx-platform/common/lib/xmodule/xmodule/video_module/video_handlers.py", line 336, in transcript
ESC[32mcms_1            |ESC[0m     content, filename, mimetype = get_transcript(
ESC[32mcms_1            |ESC[0m   File "/openedx/edx-platform/common/lib/xmodule/xmodule/video_module/transcripts_utils.py", line 1065, in get_transcript
ESC[32mcms_1            |ESC[0m     return get_transcript_from_contentstore(
ESC[32mcms_1            |ESC[0m   File "/openedx/edx-platform/common/lib/xmodule/xmodule/video_module/transcripts_utils.py", line 69, in wrapper
ESC[32mcms_1            |ESC[0m     return func(*args, **kwds)
ESC[32mcms_1            |ESC[0m   File "/openedx/edx-platform/common/lib/xmodule/xmodule/video_module/transcripts_utils.py", line 945, in get_transcript_from_contentstore
ESC[32mcms_1            |ESC[0m     raise NotFoundError('No transcript for `{lang}` language'.format(
ESC[32mcms_1            |ESC[0m xmodule.exceptions.NotFoundError: No transcript for `en` language
ESC[32mcms_1            |ESC[0m [pid: 109|app: 0|req: 12/57] 172.18.0.13 () {58 vars in 2638 bytes} [Sun Apr  3 14:04:49 2022] GET /preview/xblock/block-v1:site+class+version+type@video+block@56ad6f69fb174512ab1b9a4adfeba193/handler/transcript/translation/en?videoId=censored => generated 0 bytes in 164 msecs (HTTP/1.0 404) 5 headers in 286 bytes (1 switches on core 0)

but don’t understand why it’s saying there’s no english transcript when youtube shows a transcript:

I see this previous thread but no one replied: Lilac broke Youtube Transcript import?

Hi there @Rohan! :wave:t3:

Have you read this thread by chance?

Hi Maria. Yes. The same person who said that they got it working on Koa in the thread you cited, said it’s broken on Lilac and Maple in the thread I cited, as appears to be my experience on Lilac. I did get my youtube API set up based on that thread you cited though.

Right, the thread already mentioned they tried that. So I’ll try to reproduce this error in my local env to see if there’s something I can do to fix it. I’ll keep you posted!

That would be fabulous! Thank you!

1 Like

I have good and not-so-good news for this issue.

The good :smile:
I found this issue opened last year in the Video block, it seems to be your exact problem!

The not-so-good :sweat_smile:
It doesn’t look that straightforward to solve.

Hello there @Evgen_Dyudyunov! How did you fix this problem in your installation?

1 Like

Hi there!
All I have for this issue is collected in the mentioned by Maria GitHub Issue. Long story short: this doesn’t seem to be connected to open edx or video-xblock updates. The root of the problem is in the YouTube APIs. As a solution – need to rework the transcripts functionality according to the new YouTube API (I have no ready-to-use solution)

1 Like

I’m glad to learn it’s not just me who had the issue…but of course it’s disheartening to know it’s a fundamental bug that hasn’t been fixed and probably won’t be fixed for a long long time since it requires a lot of work.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.