nicoLivew

    @@ -74,7 +74,6 @@ // rn = p.replace(/.*?"(relatedNicoliveProgramId)".+?"(\w+)".*/,'&$1=$2'), // bi = p.replace(/.*?"(broadcastId)".+?"(\d+)".*/,'&$1=$2'), // pi = p.replace(/.*?"(programId)".+?"(\d+)".*/,'&$1=$2'); - // var Aries = '<input type="button" value="Aries" onClick="window.open(\'' + swf + ws + ot + at + ec + bt + rn + bi + pi + '\',\'_blank\',\'width=960,height=512\');var f = &quot;playerswf&quot;,flv = document.getElementById(f);flv.parentNode.removeChild(flv);"><br>', // delButton = 'var f = &quot;playerswf&quot;,flv = document.getElementById(f);flv.parentNode.removeChild(flv);', // nushi = 'N', @@ -82,7 +81,7 @@ } case /live2\.nicovideo\.jp\/watch/.test(loc): { var liveId = loc.replace(/.+?watch\/(lv\d+).*/, '$1'); - delButton = ''; + delButton = 'var plycls = &quot;___player-body-area___3aMT1&quot;,player5 = document.getElementsByClassName(plycls);player5[0].parentNode.removeChild(player5[0]);'; nushi = 'Y'; break; @@ -118,7 +117,7 @@ div.style.border = '2px solid black'; div.style.right = '20px'; div.style.bottom = '20px'; - div.style.background = 'rgba(0,120,240,0.5)'; + div.style.background = 'rgba(0,80,160,0.5)'; div.setAttribute("id", "nicoLivew"); document.body.appendChild(div); }();
  • /* @title nicoLivew
     * @description ニコニコ生放送のプレイヤーだけ抜き出したりとかするやつ
     * @description http://ch.nicovideo.jp/star/blomaga/ar303976
     * @description ギッタァブでも管理してます https://github.com/uzuky/nicoLivew
     * @license MIT License
     */
     
    
    javascript:!function() {
      var loc = document.location.href,
      div = document.createElement('div'),
      day = 'v20180219',
      ver = '<small><a href="http://nico.ms/ar303976" target="_blank" title="support" style="position:relative; top:5px; background-color:rgba(255,255,255,0.4);">' + day + '</a></small>';
      switch (true) {
    //いつもの放送ページの処理
      case /live\.nicovideo\.jp\/watch/.test(loc): {
      //ここ仕様変更に弱そう
        var url = document.querySelector('meta[property="al:web:url"]');
      //放送IDを取得
        liveId = url.outerHTML.replace(/.+?watch\/(lv\d+).*/, '$1');
        delButton = 'var f = &quot;flvplayer_container&quot;,flv = document.getElementById(f);flv.parentNode.removeChild(flv);';
    //放送主かどうか
      //ログインしてるユーザーIDを取得
        var myUserIdSource = document.getElementById('siteHeaderNotification');
        if (!myUserIdSource) {
          var myUserId = '0';
        } else {
          var myUserId = myUserIdSource.outerHTML.replace(/[\s\S]+data\-nico\-userid="(\d+)"[\s\S]*/, '$1');
        }
      //放送主のユーザーIDを取得(表示がない放送は0)
        var liveUserIdSource = document.querySelector('.nicopedia_nushi');
          if (!liveUserIdSource) {
            var liveUserId = 0;
          } else {
            var liveUserId = liveUserIdSource.outerHTML.replace(/[\s\S]+nicovideo.jp\/user\/(\d+)[\s\S]+/, '$1');
          }
      //ログインしてるユーザーIDと放送主のユーザーIDを比較
    console.log(myUserIdSource.outerHTML);
          if (myUserId != liveUserId) {
            var nushi = 'N';
          } else {
            var nushi = 'Y';
          }
      break;
    
    
    //新しい放送ページ(?)の処理
    // こんなものはない
    //   } case /live2\.nicovideo\.jp\/watch/.test(loc): {
    //     var liveId = loc.replace(/.+?watch\/(lv\d+).*/, '$1'),
    //     scripts = document.getElementsByTagName('script');
    //     //ソースから flash に渡すパラメータの部分を取得
    //     var i = 0;
    //     while (scripts[i] != null) {
    //       if (/.+flashVars.+/.test(scripts[i].outerHTML)) {
    //         var flashParam = scripts[i].outerHTML;
    //         break;
    //       }
    //       //console.log(scripts[i]);
    //       ++i;
    //     }
    //     if (flashParam == null) {
    //       alert('flashParam が取得できませんでした(◞‸◟)\nこのページのURL「' + loc + '」\n連絡先とか http://nico.ms/ar303976\nfriends.nico@uzuky');
    //     }
    //     var p = flashParam.replace(/[\s\u2028\u2029]/g,''),
    //     //URL のパラメータ
    //     swf = p.replace(/.*?swf:"(http:.+?AriesPlayer\.swf)".*/,'$1?'),
    //     ws0 = p.replace(/.*?"(webSocketUrl)".+?"([\w\W]+?)".*/,'&$1=$2'),
    //     ws = ws0.replace(/\\\//g,'/'),
    //     ot = p.replace(/.*?"(openTime)".+?"(\w+)".*/,'&$1=$2'),
    //     at = p.replace(/.*?"(audienceToken)".+?"(\w+)".*/,'&$1=$2'),
    //     ec = "&enableClientLog=1",
    //     bt = p.replace(/.*?"(beginTime)".+?"(\d+)".*/,'&$1=$2'),
    //     rn = p.replace(/.*?"(relatedNicoliveProgramId)".+?"(\w+)".*/,'&$1=$2'),
    //     bi = p.replace(/.*?"(broadcastId)".+?"(\d+)".*/,'&$1=$2'),
    //     pi = p.replace(/.*?"(programId)".+?"(\d+)".*/,'&$1=$2');
    //       var Aries = '<input type="button" value="Aries" onClick="window.open(\'' + swf + ws + ot + at + ec + bt + rn + bi + pi + '\',\'_blank\',\'width=960,height=512\');var f = &quot;playerswf&quot;,flv = document.getElementById(f);flv.parentNode.removeChild(flv);"><br>',
    //       delButton = 'var f = &quot;playerswf&quot;,flv = document.getElementById(f);flv.parentNode.removeChild(flv);',
    //       nushi = 'N',
    //     break;
    
      } case /live2\.nicovideo\.jp\/watch/.test(loc): {
        var liveId = loc.replace(/.+?watch\/(lv\d+).*/, '$1');
        delButton = 'var plycls = &quot;___player-body-area___3aMT1&quot;,player5 = document.getElementsByClassName(plycls);player5[0].parentNode.removeChild(player5[0]);';
        nushi = 'Y';
      break;
    
    //それ以外のページの処理
      } default: {
        var liveId = prompt('放送IDかURL', '');
        if (liveId.match(/lv[0-9]+/)) {
          var liveId = liveId.replace(/.+?(lv\d+).*/, '$1');
          delButton = '';
          nushi = 'Y';
        } else {
          alert('lvで始まる放送IDが入ってないよ!\n「' + liveId + '」\n連絡先とか http://nico.ms/ar303976\nfriends.nico@uzuky');
          return false;
        }
      break;
      }}
    //放送主だったら追加
      if (nushi == 'Y') {
        var nama1 = '<div style="background: rgba(0, 0, 0, 0.3);"><b>放送主用</b><br><input type="button" value="放送情報変更" onClick="window.open(\'http://live.nicovideo.jp/editstream/' + liveId + '\',\'_blank\',\'width=960,height=600,scrollbars=1\')"><input type="button" value="配信ツール" onClick="window.open(\'http://live.nicovideo.jp/nicolivebroadcaster.swf?dicfilename=NicoliveBroadcasterDictionaryJAJP.swf&v=' + liveId + '\',\'_blank\',\'width=900,height=250\')"><br><input type="button" value="配信ツール(原宿)" onClick="window.open(\'http://live.nicovideo.jp/utility_v1.swf?v=' + liveId + '\',\'_blank\',\'width=950,height=200\')"> </div>',
        nama2 = '<small><b>※"配信ツール"は正常に動作するか現在不明です。<br>※放送情報変更の反映は少し時間がかかります。<br>※放送主用は放送主のみ使えます。<br>※HTML5版の対応予定はないです。</b></small><br>';
      } else {
        var nama1 = '',
        nama2 = '';
      }
    //ページに追加
        div.innerHTML = '<div><b><span title="閉じる" onClick="var c = &quot;nicoLivew&quot;,close = document.getElementById(c);close.parentNode.removeChild(close);" style="float:right; cursor:pointer; font-size:large; position:relative; bottom:10px; left:5px;">×</span><span title="!?" onClick="' + delButton + '" style="cursor:default;">プレイヤー抜き出し</span></b></div><span style="white-space:nowrap;"><input type="button" value="GINZA" onClick="window.open(\'http://live.nicovideo.jp/nicoliveplayer.swf?v=' + liveId + '&languagecode=ja-jp\',\'_blank\',\'width=960,height=490\');' + delButton + '"><input type="button" value="原宿" onClick="window.open(\'http://live.nicovideo.jp/liveplayer.swf?v=' + liveId + '\',\'_blank\',\'width=950,height=520\');' + delButton + '"></span><br><input type="button" value="ニコファーレ" onClick="window.open(\'http://live.nicovideo.jp/liveplayer_farre.swf?v=' + liveId + '\',\'_blank\',\'width=960,height=520\');' + delButton + '"><br><input type="button" value="ページ更新してリセット" onClick="window.location.reload(true)"><br>' + nama1 + nama2 + ver;
        div.style.color = 'rgb(250,250,250)';
        div.style.textAlign = 'center';
        div.style.padding = '10px';
        div.style.position = 'fixed';
        div.style.zIndex = '9999';
        div.style.fontSize = '12px';
        div.style.border = '2px solid black';
        div.style.right = '20px';
        div.style.bottom = '20px';
        div.style.background = 'rgba(0,80,160,0.5)';
        div.setAttribute("id", "nicoLivew");
        document.body.appendChild(div);
    }();
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2018/02/19 21:59:39 - 2018-02-19
  2. 2018/02/19 21:08:46 - 2018-02-19
  3. 2016/09/01 19:38:21 - 2016-09-01
  4. 2016/02/19 02:35:21 - 2016-02-19
  5. 2016/02/19 02:28:03 - 2016-02-19
  6. 2016/01/31 19:39:17 - 2016-01-31
  7. 2016/01/31 18:36:20 - 2016-01-31
  8. 2016/01/31 18:28:30 - 2016-01-31
  9. 2015/09/12 01:54:26 - 2015-09-12
  10. 2015/09/12 01:53:32 - 2015-09-12
  11. 2015/09/12 01:35:59 - 2015-09-12
  12. 2015/09/12 01:32:46 - 2015-09-12
  13. 2014/12/31 19:21:09 - 2014-12-31
  14. 2014/12/31 18:29:53 - 2014-12-31
  15. 2014/02/25 04:12:50 - 2014-02-25
  16. 2014/01/12 16:41:03 - 2014-01-12
  17. 2014/01/12 16:36:03 - 2014-01-12
  18. 2014/01/01 17:22:45 - 2014-01-01
  19. 2014/01/01 02:23:22 - 2014-01-01
  20. 2014/01/01 00:52:27 - 2014-01-01
  21. 2013/12/31 22:28:27 - 2013-12-31
  22. 2013/12/31 21:49:11 - 2013-12-31
  23. 2013/12/31 16:51:42 - 2013-12-31
  24. 2013/12/31 16:51:27 - 2013-12-31
  25. 2013/12/31 16:44:14 - 2013-12-31
  26. 2013/12/31 16:43:37 - 2013-12-31
  27. 2013/09/13 21:16:17 - 2013-09-13
  28. 2013/09/13 16:26:23 - 2013-09-13
  29. 2013/09/13 16:25:02 - 2013-09-13
  30. 2013/09/09 19:59:11 - 2013-09-09
  31. 2013/09/09 19:56:30 - 2013-09-09
  32. 2013/09/09 00:07:20 - 2013-09-09
  33. 2013/09/01 18:01:54 - 2013-09-01
  34. 2013/08/23 11:17:25 - 2013-08-23
  35. 2013/08/23 11:13:57 - 2013-08-23
  36. 2013/08/23 11:09:26 - 2013-08-23
  37. 2013/08/23 10:59:05 - 2013-08-23
  38. 2013/08/23 10:35:09 - 2013-08-23
  39. 2013/08/23 10:07:35 - 2013-08-23