星空影院(ixkw.tv)- 豆瓣电影搜索插件

星空影院(ixkw.tv)是一个影视资源聚合在线视频平台。安装脚本后豆瓣电影标题旁会显示星空影院的logo,点击就可以享受影视资源了。

// ==UserScript==
// @name         星空影院(ixkw.tv)- 豆瓣电影搜索插件
// @namespace    https://ixkw.tv/
// @version      0.0.6
// @author       星空影院
// @match        *://movie.douban.com/subject/*
// @description 星空影院(ixkw.tv)是一个影视资源聚合在线视频平台。安装脚本后豆瓣电影标题旁会显示星空影院的logo,点击就可以享受影视资源了。
// @grant        GM_registerMenuCommand
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_addStyle
// @icon       	 https://pic.ziyuan.wang/2023/10/25/guest_85e78e66969d1.ico
// ==/UserScript==

(function () {
    'use strict';

    GM_addStyle(`
        .huatube {
            vertical-align: middle;
        }
        .huatube:hover {
            background: #fff!important;
        }
    `);
    // 获取用户的选择
    const isChina = GM_getValue('isChina', true);
    //运行模式 大陆版 或者 海外版 , 根据用户的选择来决定
    const sunTitle = isChina ? '模式:【 大陆 】👈🏻轻点切换🔥🔥' : '模式:【 海外 】👈🏻轻点切换🔥🔥';

    // 注册菜单命令
    GM_registerMenuCommand(sunTitle, function () {
        //点击菜单命令后,切换用户的选择
        GM_setValue('isChina', !isChina);
        //提示用户已经切换
        alert('切换成功! 已经切换到' + (isChina ? '【 海外 】' : '【 大陆 】') + '模式');
        //刷新页面
        window.location.reload();
    });


    const toHost = isChina ? 'https://ixkw.cc' : 'https://ixkw.tv';
    const host = location.hostname;
    if (host === 'movie.douban.com') {
        const dbid = location.pathname.match(/\/subject\/(\d+)/)[1];
        const subjectwrap = document.querySelector('h1');
        const subject = document.querySelector('.year');
        if (!subjectwrap || !subject) {
            return;
        }
        const sectl = document.createElement('span');
        subjectwrap.insertBefore(sectl, subject.nextSibling);
        sectl.insertAdjacentHTML('beforebegin',
            `<a href="${toHost}/hi/${dbid}/" class="huatube" target="_blank">
            <?xml version="1.0" encoding="UTF-8" standalone="no"?>
                <svg t="1698212777722" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="883" width="30" height="30"><path d="M396.54467773 390.93192544c-79.59594727 40.90209961-133.5333252 121.00891114-137.04345703 211.33300782a1.2689209 1.28540039 22.6 0 1-2.14233398 0.88989257c-43.75305176-40.78674317-73.3996582-93.19152833-87.39074708-150.96862793q-1.94458008-8.0090332-3.22998046-20.8795166c-0.95581055-9.37683106-2.90039063-18.88549805-2.42248535-28.08105468q1.25244141-24.98291016 3.75732422-35.84289552 10.33264161-44.9395752 43.4564209-81.26037597c48.91113281-53.64074708 128.75427247-90.95031739 188.67370605-25.60913086q19.72595215 21.50573731 28.36120605 44.37927246 12.0300293 31.83837891 15.16113281 65.88500976a1.59851075 1.59851075 0 0 1-1.07116698 1.66442872c-15.63903809 5.30639648-31.92077637 11.20605469-46.10961915 18.48999023z" fill="#019FE8" p-id="884"></path><path d="M714.76367188 467.47916665c-38.6114502-52.50366211-92.48291016-86.23718262-155.96191407-99.65148925-8.23974609-1.74682617-16.14990234-2.17529297-24.48852539-2.38952637a1.0546875 1.0546875 0 0 1-0.75805664-1.76330566c38.56201172-42.8137207 87.01171875-75.04760742 140.14160156-92.08740235q50.55908203-16.23229981 106.58935547-11.71691895 18.17687989 1.46667481 32.51403809 5.02624512c43.75305176 10.87646484 86.55029297 37.27661133 101.97509765 81.72180176q4.36706543 12.57385254 5.38879395 28.90502929c1.13708497 17.86376953 0.52734375 36.40319825-4.66369629 53.32763672-21.90124512 71.43859864-95.00427247 100.09643555-161.7791748 113.11523438q-0.80749512 0.16479492-1.30187989-0.49438477-1.41723633-1.87866211-2.14233399-4.13635253-11.99707031-37.85339356-35.51330565-69.85656739z" fill="#9CC715" p-id="885"></path><path d="M565.24523926 387.55362954c81.11206055 19.80834961 141.70715333 77.99743653 168.79943847 155.86303711a2.25769043 2.25769043 0 0 1-1.82922362 2.98278809c-6.31164551 0.88989258-12.2442627 0.92285156-18.55590822 1.31835938-13.2824707 0.85693359-27.05932617 4.30114747-41.57775878 3.42773437q-0.87341309-0.04943848-1.21948242-0.85693359-33.98071289-77.48657227-114.07104492-101.28295899c-9.73937989-2.90039063-21.86828614-4.00451661-31.19567872-5.76782226q-18.37463379-3.47717286-35.77697753 1.51611328a1.61499023 1.61499023 0 0 1-1.99401856-1.97753906c5.65246583-20.89599609 17.00683594-46.06018067 30.99792481-60.67749024a2.05993653 2.07641602 21.1 0 1 1.40075684-0.6262207c9.36035156-0.34606934 18.17687989 1.91162109 27.30651855 3.08166503q11.35437012 1.45019531 17.7154541 2.99926758z" fill="#9CC715" p-id="886"></path><path d="M444.15393066 456.45438638c-64.56665039 27.68554688-103.44177247 86.66564942-106.506958 156.34094238q-0.57678223 13.20007325 2.63671875 26.05407715a2.70263672 2.71911622 75.9 0 1-1.97753907 3.27941894q-1.00524903 0.23071289-3.47717285-0.11535644-24.19189453-3.51013184-45.25268555-15.49072265c-12.65625-7.20153809-14.37011719-7.28393555-13.2824707-21.81884766q1.35131836-18.30871583 4.25170898-33.37097168c16.57836914-86.38549805 80.33752442-154.92370606 164.28405762-180.40100098a1.02172852 1.02172852 0 0 1 1.31835938 0.92285157q1.56555176 30.61889648 0.29663086 61.27075195a3.7902832 3.7902832 0 0 1-2.29064942 3.32885742z" fill="#019FE8" p-id="887"></path><path d="M575.52844239 545.95450845c-36.41967773-7.79479981-70.20263672-23.30200195-85.08361817-59.40856933-2.58728028-6.29516602-2.88391114-13.74389648-4.54833985-20.56640625a3.42773438 3.44421387 79.3 0 1 2.88391114-4.21875q38.44665528-5.10864258 73.82812499 7.95959472 60.62805176 22.37915039 88.75854492 80.30456543 0.49438477 1.00524903-0.6097412 1.03820801c-17.74841309 0.56030273-36.51855469 1.28540039-53.93737794-1.87866211-7.13562012-1.30187989-14.93041992-1.86218262-21.2915039-3.22998047z" fill="#9CC715" p-id="888"></path><path d="M421.7088623 582.25882974c-10.62927247 26.16943359-35.08483887 53.73962403-64.22058105 58.0078125q-0.85693359 0.13183594-0.92285156-0.72509765-1.64794922-21.45629883-0.57678223-34.78820802c4.53186036-56.07971192 38.08410645-105.30395508 88.95629883-129.46289062a0.93933106 0.93933106 0 0 1 1.31835938 1.00524903c-1.28540039 7.33337403-2.81799317 14.38659667-3.5925293 21.86828612q-4.48242188 43.53881836-20.96191406 84.09484864z" fill="#019FE8" p-id="889"></path><path d="M683.65039063 589.06486001c20.99487305 1.28540039 39.46838379 9.82177734 57.64526367 20.79711914q3.180542 1.91162109 3.41125488 4.77905274 1.20300293 13.9251709-0.92285156 27.58666992c-2.14233398 13.76037598-3.3782959 22.64282227-6.78955078 34.60693359-21.35742188 74.61914063-72.39440918 130.83068848-145.33264161 158.31848145q-9.26147461 3.49365234-15.3918457 4.8449707a0.92285156 0.93933106 84.1 0 1-1.12060547-0.90637207l-0.2142334-62.04528808a1.84570313 1.81274414 79 0 1 1.12060547-1.6973877c56.62353516-23.43383789 96.35559083-73.76220703 105.43579102-134.93408203 0.95581055-6.42700195 2.68615723-13.20007325 3.04870605-19.03381348q0.90637207-14.45251465-3.37829589-29.21813965-0.95581055-3.31237793 2.48840331-3.09814453z" fill="#F9BE00" p-id="890"></path><path d="M665.32519531 599.89188638c5.88317872 60.41381836-23.86230469 117.41638184-75.41015625 148.77685547q-6.55883789 3.98803711-12.11242676 6.03149414-3.24645997 1.20300293-2.29064941-2.1258545 3.01574708-10.546875 3.54309083-21.45629882 0.26367188-5.38879395 1.54907226-10.79406738c1.56555176-6.52587891 1.94458008-13.56262208 3.34533691-19.47875977 5.57006836-23.61511231 11.42028809-44.90661622 23.00537109-66.18164062q16.13342286-29.59716797 47.52685547-41.87438966 2.93334961-1.13708497 8.05847169-1.45019531 0.84045411-0.04943848 1.33483886 0.60974122c2.05993653 2.70263672 1.20300293 5.45471192 1.45019531 7.94311523zM744.22900391 710.93070474q8.61877442-20.69824219 14.13940429-46.66992187 1.40075684-6.59179688 2.40600586-18.32519532 0.79101563-9.31091309 2.27416992-18.39111328a0.82397461 0.8404541 27.7 0 1 1.41723633-0.44494629c12.68920898 13.0847168 25.5267334 26.61437989 35.89233399 40.75378418q37.65563965 51.35009766 52.17407226 113.64257813c2.52136231 10.82702637 3.13110352 23.2196045 4.68017578 34.85412597 1.59851075 11.96411133-0.39550781 23.07128906-1.84570312 34.83764648-6.27868653 51.36657715-37.16125489 93.53759766-77.99743652 123.29956055-25.51025391 18.60534668-52.28942872 31.82189942-84.09484864 31.14624024q-35.33203125-0.74157715-63.38012695-26.03759766-31.40991211-28.31176758-42.84667969-72.09777832-7.33337403-28.08105469-9.36035156-47.6586914-0.11535645-1.00524903 0.84045411-1.28540039c74.98168945-22.37915039 135.75805664-75.75622559 165.70129394-147.62329102z" fill="#F9BE00" p-id="891"></path><path d="M352.79162597 685.15677896c29.97619629 65.58837891 92.26867676 104.13391114 164.15222169 103.70544433q4.8449707-0.03295898 15.3918457-2.75207519a0.80749512 0.80749512 0 0 1 1.00524903 0.85693359q-0.39550781 4.25170898-2.34008789 10.16784668-8.07495117 24.42260742-23.92822267 46.91711426-2.52136231 3.5760498-5.48767089 5.50415039-0.72509766 0.46142578-1.56555177 0.36254883c-12.57385254-1.54907227-25.98815918-3.09814453-37.62268065-5.65246582-82.82592773-18.09448242-147.14538575-76.23413086-174.6661377-156.25854493q-1.00524903-2.94982911 2.09289551-3.21350097 27.0098877-2.37304688 54.48120117-5.2734375c4.91088867-0.51086426 6.49291992 1.2689209 8.48693848 5.63598633z" fill="#E51374" p-id="892"></path><path d="M446.75769042 756.1504313c-32.01965333-14.50195313-61.41906739-42.51708984-76.25061034-75.06408692q-0.49438477-1.08764648 0.69213867-1.15356445c35.89233398-1.82922363 79.26635742 1.92810059 113.21411133 17.55065919 27.10876465 12.45849609 50.1965332 37.42492676 50.54260254 68.73596191a3.3782959 3.3782959 0 0 1-3.01574707 3.39477539q-44.44519043 4.97680664-85.18249513-13.46374512zM290.21899414 737.36381021c40.52307129 71.68579102 112.67028809 121.15722656 196.05651856 128.95202636a1.0546875 1.03820801 20.6 0 1 0.75805663 1.64794922q-3.67492676 5.15808106-7.366333 8.89892578c-49.02648926 49.63623047-116.54296875 87.73681641-186.99279786 93.43872071q-32.05261231 2.60375977-59.17785644 0.41198731c-15.68847656-1.25244141-34.68933106-6.70715333-49.50439453-12.34313966-33.78295898-12.82104492-66.80786133-40.73730469-77.78320313-75.87158203-5.45471192-17.43530273-5.96557617-37.77099609-4.36706543-56.45874023 7.28393555-85.23193359 92.54882813-123.15124512 164.82788087-136.77978516a2.7520752 2.7520752 0 0 1 3.08166503 1.71386719c5.99853516 15.77087403 12.45849609 32.21740723 20.4675293 46.38977051z" fill="#E51374" p-id="893"></path></svg>
           </a>`
        );
    }
})();