Skip to content

Commit 830694a

Browse files
fix(deps): update dependency youtube-transcript-api to v1 (#2206)
* fix(deps): update dependency youtube-transcript-api to v1 * fixing tests * clarify params --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: shankar ambady <ambady@mit.edu>
1 parent e05628a commit 830694a

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

learning_resources/etl/youtube_test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import pytest
1212
from googleapiclient.errors import HttpError
1313
from youtube_transcript_api import NoTranscriptFound
14+
from youtube_transcript_api._transcripts import FetchedTranscriptSnippet
1415

1516
from learning_resources.constants import (
1617
Availability,
@@ -283,7 +284,9 @@ def test_get_captions_for_video(mocker):
283284
)
284285
mock_captions_api.return_value.find_manually_created_transcript.return_value = Mock(
285286
fetch=Mock(
286-
return_value=[{"text": caption_text, "start": 0.608, "duration": 3.129}]
287+
return_value=[
288+
FetchedTranscriptSnippet(text=caption_text, start=0, duration=1)
289+
]
287290
)
288291
)
289292

@@ -300,7 +303,7 @@ def test_get_captions_for_video_autogenerated_only(mocker):
300303
mock_captions_api.return_value.find_manually_created_transcript.return_value = None
301304
mock_captions_api.return_value.find_generated_transcript.return_value = Mock(
302305
fetch=Mock(
303-
return_value=[{"text": auto_text, "start": 0.608, "duration": 3.129}]
306+
return_value=[FetchedTranscriptSnippet(text=auto_text, start=0, duration=1)]
304307
)
305308
)
306309

poetry.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ named-enum = "^1.4.0"
7575
drf-nested-routers = "^0.94.0"
7676
django-scim2 = "^0.19.1"
7777
django-oauth-toolkit = "^2.3.0"
78-
youtube-transcript-api = "^0.6.2"
78+
youtube-transcript-api = "^1.0.0"
7979
posthog = "^3.5.0"
8080
ruff = "0.11.5"
8181
dateparser = "^1.2.0"

0 commit comments

Comments
 (0)