Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Fix BitChute not playing videos
- // @author nilk || https://nilk.xyz
- // @version 2.0
- // @grant none
- // @include *://*.bitchute.com/api/*
- // ==/UserScript==
- var videoTag = document.querySelector("video");
- if (!videoTag) return;
- videoTag.id = "pleaseDontChangeMySrc"; // prevent BitChute from modifying the video element
- var link = media_url;
- //alternative seeds/subdomains //you can add some yourself, if these don't work
- var seedArray = [111, 118, 122, 124, 125, 126, 128, 129, 131, 132, 154, 191, 305, 306, 307, "xvj21", "p29xb"];
- const regex = /https:\/\/([^"'.]*[^"'.]*).*?(?=.|$)/g;
- errorHandler();
- function errorHandler() {
- addSrc(null, link);
- seedArray.forEach((seed) => addSrc(seed));
- videoTag.load();
- videoTag.play();
- }
- function addSrc(seed, originalUrl) {
- let url = originalUrl || "https://seed" + seed + link.replace(regex, "");
- let source = document.createElement("source");
- source.setAttribute("src", url);
- source.setAttribute("type", "video/mp4");
- videoTag.appendChild(source);
- }
Advertisement
Add Comment
Please, Sign In to add comment