// ==UserScript== // @name 网易新闻视频地址解析 // @namespace http://tampermonkey.net/ // @version 0.2 // @description 网易新闻内容 视频地址 解析 // @author Jack.Chan // @match *://c.m.163.com/news/* // @include https://3g.163.com/all/article/* // @grant none // @run-at document-end // @downloadURL https://update.greasyfork.icu/scripts/370233/%E7%BD%91%E6%98%93%E6%96%B0%E9%97%BB%E8%A7%86%E9%A2%91%E5%9C%B0%E5%9D%80%E8%A7%A3%E6%9E%90.user.js // @updateURL https://update.greasyfork.icu/scripts/370233/%E7%BD%91%E6%98%93%E6%96%B0%E9%97%BB%E8%A7%86%E9%A2%91%E5%9C%B0%E5%9D%80%E8%A7%A3%E6%9E%90.meta.js // ==/UserScript== (function() { 'use strict'; var videoList = [], pageTitle = document.title; if(window.DATA){ if(window.DATA.video && window.DATA.video.length){ videoList = window.DATA.video; pageTitle = window.DATA.title; } }else{ if(document.querySelector('.js-video')){ var video = document.querySelector('.js-video').querySelector('video'); videoList.push({url:video.src, title: document.title}); pageTitle = document.title; } } if(videoList.length){ var html = [], url, title; html.push('
'); html.push('
'+ pageTitle +'
'); videoList.forEach(function(item, i){ item.url = (item.mp4Hd_url || item.mp4_url || item.url_mp4 || item.url || '#'); item.title = (item.title || item.alt || document.title); html.push('
视频'+ parseInt(i+1) +':'+ item.title +'  下载
'); }); html.push('
'); var style = []; style.push(''); if(document.getElementById('parser')){ document.body.removeChild(document.getElementById('parser')); } var $parser = document.createElement('div'); $parser.id = 'parser'; $parser.className = 'parser'; $parser.innerHTML = style.join('') + html.join(''); document.body.appendChild($parser); }else{ if(location.host=='c.m.163.com'){ if(confirm('切换到:3g.163.com 可查看视频')){ var href = location.href.replace('c.m.163.com/news/a/', '3g.163.com/all/article/'); location.href = href; } } } try{ 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){} })();