itingwa_download

显示听哇网站文件的url以便快速下载。

目前為 2021-03-30 提交的版本,檢視 最新版本

// ==UserScript==
// @name itingwa_download
// @version      0.6
// @namespace       [url=mailto:[email protected]]mailto:[email protected][/url]
// @match https://www.itingwa.com/listen/*
// @match https://www.itingwa.com/article/*
// @match https://www.itingwa.com/radio/*
// @match https://www.itingwa.com/?c=player*
// @grant none
// @description 显示听哇网站文件的url以便快速下载。
// ==/UserScript==
function itingwa_add_src(){
    var newNode_div = document.createElement("div");
    var itingwa_src = $("#jp_audio_0").get(0).src;
    var newNode = document.createElement("a");
    newNode.setAttribute("href",itingwa_src);
    newNode.innerHTML = "右键另存本歌曲";
    var url=/^https:\/\/www.itingwa.com\/article\/*/;
    console.log(window.location.href);
    if(url.test(window.location.href)){
        console.log("test");
        $('.top_15.font_14.color2').append(newNode_div);
        $('.top_15.font_14.color2 div').append(newNode);
    }
    else{
        var object = listen_channel.appendChild(newNode);
    }
}
function top_select()
{

            var new_click_li = document.createElement("li");
            var new_click_a = document.createElement("a");
            new_click_a.setAttribute("name","player_nav");
            new_click_a.setAttribute("href","javascript:void(0)");
            new_click_a.innerHTML="获取此歌地址";
            $("a:contains(播放列表)").parent().parent().append(new_click_li);
            $("#player_music_list > div.wrap_960 > div.music_wrap.clearfix > ul > li:last ").append(new_click_a);
}

function width_ui_fix()
{
  var content_width=document.body.clientWidth-(document.body.clientWidth *0.2)
  var url=/^https:\/\/www.itingwa.com\/listen\/*/;
    if(content_width>960 && url.test(window.location.href))
    {
        var content_sum=(content_width-100)*0.8+(content_width-100)*0.2;
        $("body > div.frame1").css("width",content_width);
        $("body > div.frame1 > div.lt_frame").css("width",(content_width-100)*0.8);
        $("body > div.frame1 > div.rt_frame").css("width",(content_width-100)*0.2);
        $("div.clearfix").eq(0).css("width",(content_width-100)*0.8)
        $("body > div.frame1 > div.lt_frame > div:nth-child(1) > div.right.top_10.module_event").eq(0).removeAttr("width");
        $("div:contains(扫码,手机听)").eq(0).css("margin-left",document.body.clientWidth*0.8 /2);
        $("#back_to_top").css("left",(document.body.clientWidth-content_sum)/2+content_sum);
    }
}
(function () {
    'use strict';
                    $(window).resize(function() {
            width_ui_fix();
  });
    var player_zj=/^https:\/\/www.itingwa.com\/\?c=player*/;
    window.addEventListener('load', (event) => {
width_ui_fix();
        if(player_zj.test(window.location.href)===true)
        {
            top_select();
            var show_download_src = $("#player_music_list > div.wrap_960 > div.music_wrap.clearfix > ul > li:last > a");
            show_download_src.bind('click', function(e) {
                var test_node=/右键另存本歌曲/;
                if (test_node.test($("#listen_channel > a:last").get(0).innerHTML) === false)
                {
                    itingwa_add_src();
                }
            });
        }
        else
        {
            itingwa_add_src();
        }
    });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址