Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name issoutv
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author ence
- // @match https://avenoel.org/topic*
- // @grant none
- // ==/UserScript==
- function createIssoutvPlayer (id) {
- const formats = ['webm', 'mp4'];
- let video = document.createElement('video');
- video.setAttribute('controls', '');
- video.setAttribute('width', '320');
- video.setAttribute('height', '240');
- video.setAttribute('preload', 'none');
- let sources = formats.map(format => {
- let source = document.createElement('source');
- source.setAttribute('src', `http://issoutv.com/files/${id}${format === 'mp4' ? '.mp4' : ''}`);
- source.setAttribute('src', `http://issoutv.com/filesSecond/${id}${format === 'mp4' ? '.mp4' : ''}`);
- source.setAttribute('type', `video/${format}`);
- video.appendChild(source);
- });
- return video;
- }
- function issoutv () {
- Array.from(document.getElementsByClassName('message-content')).map(message => {
- Array.from(message.getElementsByTagName('a'))
- .filter(a => a.host === 'issoutv.com' && a.pathname === '/view.php')
- .map(a => {
- let player = createIssoutvPlayer(a.search.split('=')[1]);
- a.parentNode.parentNode.replaceChild(player, a.parentNode);
- });
- });
- }
- (function() {
- 'use strict';
- console.log('issoutv running...');
- issoutv ();
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement