YouTube Video Preview and Ratings Keyless

Instant video previews in popup player by hovering or clicking video thumbs. Video ratings and resolution data shown on the thumbs. Gets video information without using a YouTube API key, which can be banned or limited.

< YouTube Video Preview and Ratings Keyless 피드백

리뷰: 좋음 - 잘 동작함

Deleted user 25884
§
작성: 2021-08-23

Request: Please allow percentage ranges instead of a gradient. I miss the old setting, where I could set >90 green, 80-90 orange and <80 red. A gradient is sometimes hard to read for me and there really are terrible videos, not just those below 50%.

I tried changing the code but I couldn't get a satisfying result on my end.

Deleted user 25884
§
작성: 2021-08-23
수정: 2021-08-23
        if (rating > 0) {
            var perc = Math.round((rating/5)*100);
            var scaled = perc/100;
            var hex;
            if (scaled > 0.9){
            hex = `#33cc33`;
            }
            else if (scaled > 0.8 && scaled <= 0.9){
            hex = `#ff9933`;
            }
            else if (scaled <= 0.8){
            hex = `#cc0000`;
            }

            newElem("div",
                    { "class": "vpp_meta_rate",
                      "style": `background:${hex} !important;`,
                      "title": `${Number(views).toLocaleString()} views`
                    },
                    `${perc}`,
                    parent);
            parent.setAttribute("vpp_meta_rate", "");
        }

Never mind, fix was trivial.

댓글 남기기

댓글을 남기려면 로그인하세요.