Created
September 8, 2025 16:43
-
-
Save shalakolee/8618eb479b5b01d89f18aab286acde20 to your computer and use it in GitHub Desktop.
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
| (async () => { | |
| // Find the current video ID from the URL | |
| const match = window.location.pathname.match(/video\/([a-zA-Z0-9]+)/); | |
| if (!match) { | |
| console.log("Video ID not found in URL."); | |
| return; | |
| } | |
| const videoId = match[1]; | |
| // Fetch the metadata endpoint | |
| const metaUrl = `https://www.dailymotion.com/player/metadata/video/${videoId}`; | |
| try { | |
| const response = await fetch(metaUrl); | |
| const data = await response.json(); | |
| if ( | |
| data && | |
| data.qualities && | |
| data.qualities.auto && | |
| data.qualities.auto[0] && | |
| data.qualities.auto[0].url | |
| ) { | |
| console.log("Direct m3u8 link:", data.qualities.auto[0].url); | |
| } else { | |
| console.log("Direct m3u8 link not found in metadata."); | |
| } | |
| } catch (e) { | |
| console.error("Failed to fetch metadata:", e); | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment