// ==UserScript== // @name 网易新闻视频地址解析 // @namespace http://fulicat.com // @version 1.0.2 // @url https://greasyfork.org/zh-CN/scripts/382595 // @description 网易新闻内容 视频地址 解析 // @author Jack.Chan // @match *://c.m.163.com/news/* // @match *://3g.163.com/news/* // @grant none // @run-at document-end // @downloadURL none // ==/UserScript== (function() { 'use strict'; function init() { var $player = document.querySelector('#player'); if ($player && $player.src) { var url = $player.src, title = document.title; var style = []; style.push(''); var html = []; html.push('
'); html.push('
视频:'+ title +'
'); html.push('
'+ title +'   下载
'); html.push('
'); var $parser = document.createElement('div'); $parser.id = 'parser'; $parser.className = 'parser'; $parser.innerHTML = style.join('') + html.join(''); document.body.appendChild($parser); var $items = document.querySelectorAll('li.js-open-newsapp'); $items && $items.forEach(function(item) { (function(li){ var nli = li.cloneNode(true); nli.onclick = function(e) { e.preventDefault(); e.stopPropagation(); var param = this.dataset.param; if (param) { location.href = '//c.m.163.com/news/v/'+ param +'.html'; } return false; } li.parentNode.replaceChild(nli, li); })(item); }); } fixes(); } function fixes() { try{ document.querySelector('article[id^=article-]').style.cssText = ''; //document.querySelector('article[id^=article-]').id = '' document.querySelector('.js-show-article').click(); //自动展开文章 document.querySelector('.g-top-slider').remove(); document.querySelector('.js-slider').remove(); document.querySelector('.doc-footer-wrapper').remove(); document.querySelector('.m-slider-footer').remove(); }catch(ex){} } if (location.href.startsWith('https://c.m.163.com/news/') || location.href.startsWith('https://3g.163.com/news/')) { fixes(); setTimeout(function(){ init(); }, 1000); } })();