Skip to content

Get captions from embedded YouTube videos (iss. #5) #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

lsloan
Copy link
Contributor

@lsloan lsloan commented May 6, 2024

Resolves #5.

Search the contents of Canvas Page objects for YouTube videos embedded via iframe elements.

Test Plan

Preparation

  1. Clone this branch (lsloan:5-YouTube-captions) to a new directory named langchain-doc-canvas_testplan and cd into it…
    git clone -b 5-YouTube-captions https://github.com/lsloan/langchain-doc-canvas.git langchain-doc-canvas_testplan
    cd langchain-doc-canvas_testplan
  2. Create a Python virtual environment and activate it…
    python3.11 -m venv .venv-testplan
    source .venv-testplan/bin/activate
  3. Install Python dependencies for the module, development, and testing…
    pip install -r requirements.txt
  4. Get a Canvas API token. Either use the token for itsaistu or follow these steps to create a new token.
    1. While authenticated to Canvas as a user you'd like to use for testing, go to: https://umich.instructure.com/profile/settings
    2. Click the "New Access Token" button and follow the prompts.
    3. Ensure that the user the token is associated with has an "Observer" role in a course you'd like to use for testing.

Run Example Program

  1. Set environment variables with the Canvas API URL, API token, and course ID…

    export TEST_CANVAS_API_URL=https://umich.instructure.com  # production Canvas
    export TEST_CANVAS_API_KEY=your_API_token_from_preparation_step_4
    export TEST_CANVAS_COURSE_ID=718331  # lsloan-caption, for example

    Testing configuration available in Dropbox:
    https://www.dropbox.com/scl/fi/mzcf6ccqugvr1n5yi84ha/.env.txt?rlkey=6qx7352jvx50ktbhbioarjms2&st=o79puh7x&dl=0

  2. Run the program canvas-test.py to get captions from some existing YouTube videos…

    python canvas-test.py

lsloan added 4 commits May 2, 2024 16:46
Later, this should be replaced with the name of the package in PyPI or URL to the release in our repo.
TL colleagues with Cavas expertise recommend Document objects for YouTube captions should link to the Canvas page on which they were embedded to keep students in the learning context.  Maizey project colleagues say linking to YouTube is fine.  I'm adding extra metadata here for Canvas to show what the links back to Canvas could look like.  They couldn't make the player start at a specific time, but maybe the AI could tell the user the timestamp for the section of video that contains the caption of interest.
@lsloan lsloan marked this pull request as ready for review May 9, 2024 13:27
@lsloan
Copy link
Contributor Author

lsloan commented May 24, 2024

@mlhess, I've updated the syllabus support. I have some minor adjustments to make on its metadata.

I didn't have enough time to figure out the best support for YouTube links in PDFs, as described by the instructor we wrote to. However, I've added "TODO" comments in the code where support for that and Powerpoint files should be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

index captions of embedded YouTube media
1 participant