{"id":49565402,"url":"https://github.com/berkeley-cdss/lecture-sharing-scripts","last_synced_at":"2026-05-03T11:38:08.618Z","repository":{"id":350308325,"uuid":"1205419743","full_name":"berkeley-cdss/lecture-sharing-scripts","owner":"berkeley-cdss","description":"🎥 Scripts for working with the bCourses Media Gallery \u0026 Kaltura","archived":false,"fork":false,"pushed_at":"2026-04-09T18:51:29.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-09T20:27:43.992Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/berkeley-cdss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-09T00:23:56.000Z","updated_at":"2026-04-09T19:41:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/berkeley-cdss/lecture-sharing-scripts","commit_stats":null,"previous_names":["berkeley-cdss/lecture-sharing-scripts"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/berkeley-cdss/lecture-sharing-scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berkeley-cdss%2Flecture-sharing-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berkeley-cdss%2Flecture-sharing-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berkeley-cdss%2Flecture-sharing-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berkeley-cdss%2Flecture-sharing-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/berkeley-cdss","download_url":"https://codeload.github.com/berkeley-cdss/lecture-sharing-scripts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berkeley-cdss%2Flecture-sharing-scripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32567934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-03T11:38:07.931Z","updated_at":"2026-05-03T11:38:08.605Z","avatar_url":"https://github.com/berkeley-cdss.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scripts for working with the bCourses Media Gallery \u0026 Kaltura\n\nThese scripts were designed for [CS70](https://www.eecs70.org/). We're sharing them so others can adapt them to their courses! \n\nFor context, CS70 uses UC Berkeley's [Course Capture](https://rtl.berkeley.edu/services-programs/course-capture) service to record its lectures. These recordings are automatically added to the [\"Media Gallery\" tab](https://knowledge.kaltura.com/help/access-and-work-in-the-media-gallery) on bCourses (Canvas). We maintain our own website (see [eecs70.org](https://www.eecs70.org/)) and have links bCourses for lecture recordings.\n\nThe process for linking a lecture recording on the website is:\n\n* Create a bCourses page for the lecture.\n* Embed the video from the media gallery onto that bCourses page using the Canvas editor.\n* Link the bCourses page on the website for students to access.\n\nThis is a slightly monotonous task that Head TAs have to do for every lecture. Manually doing this also causes a delay between the recording being available and the recording being listed on the website. This inconveniences students.\n\nWe built these scripts to automate the process.\n\n**The first script is `scrape_webcasts.py`.** It is the script that will (via bCourses), generate a list of every video in your media gallery and a link to it. You can see an example of its output in `examples/media-gallery.csv`.\n\nThe inputs you can provide the script are: `--course-id`, `--tool-id`, `--channel-path`, and `--output`. `--output` is just the filename for the CSV you'd like to save. `--course-id` and `--tool-id` can be extracted from the URL of your media gallery, eg. CS 70's is `https://bcourses.berkeley.edu/courses/1551726/external_tools/90481`. And then to find the `--channel-path`, you can inspect the media gallery in bCourses and get the embedded URL: \n\n\u003cimg width=\"400\" alt=\"HTML of the media gallery in bCourses\" src=\"https://github.com/user-attachments/assets/177f65af-ea1d-4575-b05b-6f7068e6bd70\" /\u003e\n\n\nHere's an example of running the script:\n\n```\nCANVAS_API_TOKEN=\"your_token\" python3 _utils/scrape_webcasts.py --course-id 1551726 --tool-id 90481 --channel-path /channel/1551726/397920713 --output _data/webcasts.csv\n```\n\n**The second script is `sync_webcast_pages.py`.** It is a little bit more specific to CS 70 but it should be adaptable to your course. It takes the output of the scraper and creates individual bCourses pages for each lecture. It then outputs a CSV of the bCourses pages for each lecture. We then use that CSV to display them on the course website. The inputs are `--course-id` (on Canvas), `--webcasts-csv` (the CSV that the previous script generated), `--weeks-yml` (CS70-specific, this is our course schedule that the website is built off of), and `--output` (path of the CSV you'd like it to output). The important chunk of code is this chunk here (and the functions it calls):\n\n```python\nlookup_uuid = create_resource_link(\n  session, args.course_id, lec[\"entry_id\"], lec[\"title\"]\n)\n\nbody = build_embed_body(args.course_id, lookup_uuid, lec[\"title\"])\n\npage = create_page(session, args.course_id, lec[\"page_title\"], body)\npage_slug = page[\"url\"]\nprint(f\"  {lec['page_title']}: created -\u003e {page_slug}\")\n\ncreated.append(lec)\n```\n\nFiguring out that you needed to use [this API](https://developerdocs.instructure.com/services/canvas/resources/lti_resource_links) to find the `lookup_uuid` was the hardest part of this. Happy to help anyone adapt the script to their courses! I've also attached an example of the output in `examples/webcast_pages.csv`.\n\nFeel free to reach out to `sampoder@` for help and support with these scripts.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberkeley-cdss%2Flecture-sharing-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberkeley-cdss%2Flecture-sharing-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberkeley-cdss%2Flecture-sharing-scripts/lists"}