Created
March 7, 2024 01:19
-
-
Save 0x722/4dbcfa46ab676d23646d2763752ec7b4 to your computer and use it in GitHub Desktop.
bitview
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
// ==UserScript== | |
// @name BitView Video Downloader | |
// @namespace http://bitview.net/ | |
// @version 1 | |
// @description Downloads bitview videos | |
// @author sh0rk | |
// @match http://*.bitview.net/* | |
// @match https://*.bitview.net/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function isDependenciesLoaded() { | |
return typeof viValues !== 'undefined'; | |
} | |
function init() { | |
if (isDependenciesLoaded()) { | |
var bvdownloadLink = document.createElement('a'); | |
bvdownloadLink.innerHTML = 'Download Video'; | |
bvdownloadLink.href = viValues.src; | |
var watchChannelStatsElement = document.getElementById('watch-channel-stats'); | |
if (watchChannelStatsElement && watchChannelStatsElement.parentNode) { | |
watchChannelStatsElement.parentNode.insertBefore(bvdownloadLink, watchChannelStatsElement.nextSibling); | |
} else { | |
document.body.appendChild(bvdownloadLink); | |
} | |
} else { | |
setTimeout(init, 100); | |
} | |
} | |
window.addEventListener('load', init); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment