Last active
September 9, 2024 05:23
-
-
Save leftmove/a1c7d244b195f26b479904e0d7abb752 to your computer and use it in GitHub Desktop.
This file contains 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
let keepLooking = true | |
XMLHttpRequest.prototype._originalOpen = XMLHttpRequest.prototype.open; | |
XMLHttpRequest.prototype.open = function(method, url, async, user, password) { | |
const isDelivery = url.includes("deliveries") | |
const isM3u8 = url.includes("m3u8") | |
if (keepLooking && isDelivery && isM3u8) { | |
let videoUrl = url.replace("m3u8", "mp4") | |
var videoIndex = videoUrl.indexOf("mp4") + 3 | |
videoUrl = videoUrl.slice(0, videoIndex) | |
console.log(videoUrl) | |
keepLooking = false | |
window.open(videoUrl, "_blank") | |
this.open = this._originalOpen | |
// window.location.reload() | |
} | |
this._originalOpen(method, url, async, user, password); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment