Repository navigation
Refactor kalvidres LTI extractor to improve URL extraction and direct Kaltura HLS download - #254
Merged
Merged
Conversation
…ng of launch forms
Owner
|
I'm not really happy with the manual construction of cdnapisec.kaltura.com. But since I have no way to test this I hope it improves the extractor. Did you make the changes yourself or did you use an AI? I will merge it later :) |
Author
|
Hi, yes, I used an LLM to write the fix. EDIT
|
* origin/main: fix ruff Switch to ruff and uv fix default filter mode Fix empty whitelist course filtering added debug lines Fix Windows DNS resolution issue in aiohttp ClientSession Prevent downloader from receiving unsupported gzip encoding # Conflicts: # moodle_dl/downloader/extractors/kalvidres_lti.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
_hidden_inputs, instead of strictly matching the ID "ltiLaunchForm".window.top.location.replaceorlocation.hrefacross different Moodle configurations.partner_id,entry_id, andkstokens if standard embedding extraction fails.KalturaIEAPI flavor resolution completely. Instead, construct a direct signed HLSplayManifestURL using the extracted metadata, routing the download directly through the CloudFront CDN stream and resolving API access/extraction errors.Summary of changes
KalvidresLtiIEto bypass standardKalturaIEAPI flavor resolution. It now constructs a direct signed HLSplayManifestURL usingpartner_id,entry_id, and the extracted Kaltura Session (ks) token, routing the download directly through the CloudFront CDN stream."ltiLaunchForm", the extractor now grabs the first available form and parses inputs dynamically using common hidden input utilities.window.top.location.replaceorlocation.href) utilized by various Moodle configurations.KalturaIEembed extraction fails.Detailed Breakdown
1. LTI Launch Form Extraction
Example HTML:
ltiLaunchForm. ThrewUnable to extract ltiLaunchForm formexception when missing.2. JavaScript Redirection Handling
Example HTML:
.replace(), or window wrappers (window.top), throwing anUnable to extract kalvidres redirect urlerror.3. Kaltura API vs. Direct CDN Stream Bypass
KalturaIE._extract_url(), which frequently failed due to strict API multirequest rule updates or restricted API access.The server successfully issues an HLS
.m3u8playlist which routes directly to the CloudFront CDN source (https://cfvod.kaltura.com/scf/hls/...), bypassing the API limitations entirely.