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.

답글 게시

답글을 게시하려면 로그인하세요.