Skip to content
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

[Feature] Implemented "Generate Quiz from YouTube Video" Context Menu #223

Merged
merged 2 commits into from
Feb 17, 2025

Conversation

yatikakain
Copy link
Contributor

Description

This PR introduces a new feature that allows users to generate quizzes from YouTube videos by extracting their transcripts. The implementation includes:

  • Context Menu Integration: A new context menu option appears when right-clicking on YouTube video pages.
  • Transcript Extraction: A new API endpoint (/getTranscript) has been added in server.py to fetch video transcripts using yt-dlp.
  • Content Script Injection: youtubeContentScript.js extracts video IDs and requests transcripts from the backend.
  • Badge Notification: A browser action badge indicates successful transcript retrieval.

Changes Made

  • Added a new API endpoint in server.py to handle transcript extraction.
  • Updated background.js to include a context menu for YouTube video pages.
  • Implemented youtubeContentScript.js to interact with YouTube pages and fetch transcripts.
  • Updated manifest.json to include necessary permissions.

How to Test

  1. Load the extension in Developer Mode.
  2. Navigate to a YouTube video page.
  3. Right-click and select "Generate Quiz from YouTube Video".
  4. Verify that the transcript is extracted and displayed in the extension UI.

Webcast

youtube_context_demo.mp4

Checklist

  • Tested manually on different YouTube videos.
  • Proper error handling added for missing captions.

Related Issues

Fixes #190

@Aditya062003
Copy link
Contributor

Looks good to me! we've always needed integrations with other platforms.

@Aditya062003 Aditya062003 merged commit b83a01c into AOSSIE-Org:main Feb 17, 2025
4 checks passed
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.

[Feature] Implement "Generate Quiz from YouTube Video" Context Menu Option
2 participants