Greasy Fork

来自缓存

Greasy Fork is available in English.

荔枝FM 节目下载。Download Lizhi FM MP3

下载当前节目。Download current MP3 playing on Lizhi FM

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        荔枝FM 节目下载。Download Lizhi FM MP3
// @namespace   feifeihang.info
// @description 下载当前节目。Download current MP3 playing on Lizhi FM
// @include     http://www.lizhi.fm/box*
// @version     1
// @grant       none
// ==/UserScript==
(function (window, document, undefined) {
  window.addEventListener('load', function () {
    var frag = document.createDocumentFragment();
    var link = document.createElement('a');
    link.addEventListener('mouseenter', function () {
      ready(link);
    });
    link.target = '_blank';
    link.style = 'display: block; color: #fff; position: fixed; z-index: 999999; top: 0;' +
      ' right: 20px; width: 100px; height: 35px; background: #7695D6; text-decoration: none;' + 
      ' cursor: pointer; line-height: 35px; font-weight: bold; text-align: center';
    link.appendChild(document.createTextNode('下载当前节目'));
    frag.appendChild(link);
    document.body.appendChild(frag);
  });
  function ready(anchor) {
    if (window.player && window.player.getCurrentAudio()) {
      var audio = window.player.getCurrentAudio();
      download(anchor, audio.url, audio.title || 'download');
    }
  }
  function download(link, url, name) {
    link.download = name;
    link.href = url;
  }
}) (this, this.document);