您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Показывает прямые ссылки на видео в твиттере. Direct twitter video links showing in the bottom of the player.
当前为
// ==UserScript== // @name Twitter video links // @namespace twitter // @description Показывает прямые ссылки на видео в твиттере. Direct twitter video links showing in the bottom of the player. // @include https://twitter.com/i/videos/* // @version 2 // @grant none // ==/UserScript== $(document).ready(function(){ $(document).on("dataPlayerReadyEvent", function(){ var astyle = "text-decoration: underline; color: #37f;", vmap_url = ($pt=$("#playerContainer")).length == 1? ( (st=$pt.data("config").source_type) === 'amplify'? $pt.data("config").vmap_url : '' ) : '', vd = (dr=$pt.data("config").duration)? Math.floor(dr/1000) : 0; Number.prototype.to2D = function(){ return (this<10)? '0' + this : this.toString(); } with(Math){ vd = (vd > 0)? ' ('+[(h=floor(vd/3600)).to2D(), (m=floor((vd - h*3600)/60)).to2D(), (vd - h*3600 - m*60).to2D()].join(':')+')' : ''; } if(vmap_url !== '' || $.inArray(st, ['consumer', 'snap-reel', 'gif']) > -1 ){ var $vspan = $('<span>') .css({ position: "fixed", bottom: "0px", right: "0px", 'background-color': "#fff", padding: "0px 5px 2px", margin: "2px", }); if( $.inArray( (ct = $pt.data("config").content_type), ['video/mp4', 'application/x-mpegURL'] ) > -1 && typeof (vu = $pt.data("config").video_url) !== 'undefined' ){ $vspan.append('<a style="'+astyle+'" href="'+vu+'" target="_blank" title="'+ct+'">Main video'+vd+'</a> '); }else if( vmap_url !== '' ){ $.get( vmap_url, function( vdata ) { $vspan.append('<a style="'+astyle+'" href="'+vmap_url+'" target="_blank">vmap.xml</a> '); var mvid_url = ($mf = $(vdata).find("MediaFile")).length == 1? $mf.text().replace(/[\s\n\r\t]/gm, '') : ''; if(mvid_url !== ''){ $vspan.append('| <a style="'+astyle+'" href="'+mvid_url+'" target="_blank">Main video'+vd+'</a> '); } var yt_url = ($wn = $(vdata).find("tw\\:cta_watch_now, cta_watch_now")).length == 1? $wn.attr("url") : ''; if(yt_url !== ''){ $vspan.append('| <a style="'+astyle+'" href="'+yt_url+'" target="_blank">YouTube</a> '); } $(vdata).find("tw\\:videoVariant, videoVariant").each(function(vidx, vidvar){ if($(vidvar).attr("content_type") == 'video/mp4'){ var vcap = (mtch = $(vidvar).attr("url").match(/vid\/(\d+x\d+)\//)).length > 1 ? mtch[1] : $(vidvar).attr("bit_rate")+' bps'; $vspan.append('| <a style="'+astyle+'" href="'+$(vidvar).attr("url")+'" target="_blank">'+vcap+'</a> ') } }); }); }else{ $vspan.append('<a style="'+astyle+'" href="'+document.location.href+'" target="_blank">Can`t parse this frame</a>'); } $(document.body).append($vspan); $(".error-msg-container").css('opacity', "0"); } }); });
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址