🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

微信公众号音频 助手

浏览微信公众号时自动发现音频,并生成下载按钮

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey to install this script.

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name         微信公众号音频 助手
// @namespace    http://tampermonkey.net/
// @version      0.12
// @description  浏览微信公众号时自动发现音频,并生成下载按钮
// @author       BeihaiZhang
// @match        https://mp.weixin.qq.com/s*
// @grant GM_download

// ==/UserScript==

(function() {
    'use strict';
    var mpvoices=document.querySelectorAll('mpvoice');
    var i;
    for (i = 0; i < mpvoices.length; i++) {
        let mpvoice = mpvoices[i]
        if(mpvoice){
            let fileid=mpvoice.getAttribute('voice_encode_fileid');
            let title=mpvoice.getAttribute('name');
            let url='https://res.wx.qq.com/voice/getvoice?mediaid='+fileid;
            let tips=document.createElement('div');
            tips.style="min-width:300px;min-height:30px;background:#ff0;color:#f00;font-size:120%;text-align:center;line-height:30px;cursor:pointer;padding:10px;border-radius:10px;border:1px solid #f00;";
            tips.innerHTML="下载音频“"+title+"”";
            tips.onclick=function(){
                GM_download(url,title+'.mp3');
            };
            mpvoice.after(tips);
        }
    }
})();