// ==UserScript== // @name 腾讯视频片库 // @namespace https://github.com/local/tx-unified-list // @version 1.9.0 // @description 腾讯视频 8 频道整合:标签栏+居中弹窗筛选、竖版手机3列/PC5列、横版手机2列/PC4列、PC限宽居中、自动加载。左上搜索引擎切换(6选项含默认)、点卡片按引擎搜索、右上搜索历史(≤30条自动清理)。访问https://v.qq.com/tv-series-list/v-index.html即可使用 // @author 失辛向南 // @license MIT // @match *://v.qq.com/tv-series-list/v-index.html* // @run-at document-idle // @noframes // @grant GM_addStyle // ==/UserScript== (function () { 'use strict'; // ==================== 频道配置 ==================== const CHANNELS = [ { id: '100173', name: '电影', params: 'sort=75' }, { id: '100113', name: '电视剧', params: 'sort=75' }, { id: '100109', name: '综艺', params: 'sort=75' }, { id: '100119', name: '动漫', params: 'sort=75' }, { id: '100150', name: '少儿', params: 'itype=75' }, { id: '120188', name: '短剧', params: 'attraction=1' }, { id: '100105', name: '纪录片', params: 'sort=75' }, { id: '100103', name: '体育', params: 'irace=11' }, ]; const BASE = 'https://v.qq.com/tv-series-list/v-index.html'; function channelUrl(c) { return BASE + '?filter_params=' + c.params + '&page_id=channel_list_second_page&channel_id=' + c.id; } function currentChannelId() { try { return new URL(location.href).searchParams.get('channel_id') || ''; } catch (e) { return ''; } } const state = { activeTab: null }; // ==================== 样式 ==================== const CSS = ` /* ---------- 自然滚动布局(不锁高度) ---------- */ html, body { margin: 0 !important; padding: 0 !important; width: 100% !important; background: #fff !important; } *, *::before, *::after { box-sizing: border-box !important; } /* ---------- 隐藏腾讯外壳 ---------- */ .top-bar-wrap, .left-bar-wrap, .v-left-nav-area, .top-nav-wrap, .search-wrap, #ssi-user-bar, .back-button, .tag-bar, #login_win, .web-login-container, #toast-container, .gatherable-layer, [class*="gatherable"] { display: none !important; } /* ---------- 底部遮挡清除 ---------- */ .screen-list__footer, .screen-list__loading, .lazy-list__footer, .lazy-list__loading, .filter-expand, .quick_pop_footer, .app-download-bar, .app-download, .download-bar, .bottom-guide, .guide-bottom, .v-bottom-bar, .bottom-bar-wrap, .mobile-tab-bar, .screen-app-download, [class*="bottom-banner"], [class*="app-promote"], [class*="download-app"], [class*="footer-fixed"], [class*="fixed-bottom"], [class*="bottom-fixed"], [class*="guide-bar"], [class*="openapp"], [class*="open-app"], [class*="float-bar"], [class*="floatbar"] { display: none !important; visibility: hidden !important; height: 0 !important; pointer-events: none !important; } /* ---------- 强制全宽,去掉左右偏移 ---------- */ #app, .web-page, .v-station-screen-content, .v-station-content, #root, #app-root, .screen-page, .screen-page__main-content, .screen-list, .content-wrap, vstation-screen-content { width: 100% !important; max-width: 100% !important; min-width: 0 !important; margin: 0 !important; padding-left: 0 !important; padding-right: 0 !important; height: auto !important; overflow: visible !important; display: block !important; } .screen-list { padding: 0 !important; background: #fff !important; position: relative !important; height: calc(100vh - 110px) !important; overflow-y: auto !important; overflow-x: hidden !important; } .grid-waterfall.screen-list__grid { display: block !important; padding: 8px 12px 24px !important; margin: 0 !important; } /* ---------- 顶部 #tx-header(吸顶) ---------- */ #tx-header { position: sticky; top: 0; z-index: 20; background: #fff; padding: 10px 12px 0; box-shadow: 0 1px 4px rgba(0,0,0,.06); text-align: left !important; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif !important; color: #1a1a1a !important; } #tx-header .tx-title { font-size: 15px; font-weight: 700; color: #1a1a1a; margin: 0 0 8px; display: grid !important; grid-template-columns: 1fr auto 1fr !important; align-items: center !important; text-align: center !important; gap: 6px; } #tx-header .tx-title-text { text-align: center !important; justify-self: center; } #tx-header .tx-icon-btn { width: 32px; height: 32px; border: 0; background: #f0f0f3; color: #333; border-radius: 16px; font-size: 17px; cursor: pointer; padding: 0; display: flex !important; align-items: center !important; justify-content: center !important; font-family: inherit !important; } #tx-header .tx-engine-btn { justify-self: start !important; } #tx-header .tx-history-btn { justify-self: end !important; } #tx-channels { display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 8px; } #tx-channels::-webkit-scrollbar { display: none; } #tx-channels button { flex: 0 0 auto; border: 0; background: #f0f0f3; color: #555; padding: 7px 16px; border-radius: 16px; font-size: 14px; cursor: pointer; white-space: nowrap; font-family: inherit !important; min-width: 0; line-height: 1.2; } #tx-channels button.active { background: #e6f4ff; color: #1a8cff; font-weight: 700; } /* ---------- 筛选标签栏(放在 header 里) ---------- */ .tx-filter-tabs { display: flex !important; flex-wrap: nowrap !important; flex-direction: row !important; gap: 8px !important; overflow-x: auto !important; padding: 8px 0 !important; background: #fff !important; align-items: center !important; scrollbar-width: none; border-top: 1px solid #f0f0f0; } .tx-filter-tabs::-webkit-scrollbar { display: none; } .tx-tab { flex: 0 0 auto; border: 0; background: #f0f0f3; color: #333; padding: 6px 14px; border-radius: 16px; font-size: 13px; cursor: pointer; white-space: nowrap; font-family: inherit !important; line-height: 1.2; } .tx-tab.tx-active { background: #1a8cff; color: #fff; font-weight: 600; } /* 隐藏原站筛选 DOM */ .filter-line { display: none !important; } /* ---------- 居中弹窗 ---------- */ .tx-filter-modal { position: fixed; inset: 0; z-index: 99999; } .tx-filter-mask { position: absolute; inset: 0; background: rgba(0,0,0,.45); } .tx-filter-panel { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: #fff; border-radius: 16px; padding: 20px; width: 320px; max-width: 90vw; max-height: 70vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,.2); } .tx-modal-title { font-size: 16px; font-weight: 700; color: #222; margin-bottom: 14px; } .tx-opt { display: inline-block; padding: 7px 14px; margin: 3px; border-radius: 16px; background: #f5f5f7; border: 0; cursor: pointer; font-size: 13px; color: #555; font-family: inherit !important; line-height: 1.2; } .tx-opt.sel { background: #1a8cff; color: #fff; font-weight: 600; } /* ---------- 卡片墙 grid ---------- */ .grid-waterfall__content, .grid-waterfall__content--web { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 10px !important; padding: 0 !important; width: 100% !important; max-width: 100% !important; margin: 0 !important; justify-items: stretch !important; align-items: stretch !important; justify-content: stretch !important; } .screen-cover, .screen-cover--pc { width: 100% !important; margin: 0 !important; justify-self: stretch !important; border-radius: 8px !important; background: #fff !important; box-shadow: 0 1px 4px rgba(0,0,0,.08); display: flex !important; flex-direction: column !important; overflow: visible !important; height: auto !important; } .screen-cover .poster-view, .screen-cover .item-poster { width: 100% !important; height: auto !important; aspect-ratio: 2 / 3 !important; position: relative !important; border-radius: 8px 8px 0 0 !important; overflow: hidden !important; } .screen-cover .poster-view__img { width: 100% !important; height: 100% !important; object-fit: cover !important; display: block !important; } .screen-cover .item-info { width: 100% !important; padding: 6px 8px 10px !important; overflow: visible !important; } .screen-cover .item-title { font-size: 13px !important; font-weight: 600 !important; color: #222 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 1.3; } .screen-cover .item-secondTitle { font-size: 11px !important; color: #999 !important; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 1.3; } .screen-cover .item-tags { display: none !important; } /* ---------- 横版频道 ---------- */ body.tx-landscape .grid-waterfall__content, body.tx-landscape .grid-waterfall__content--web { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; } body.tx-landscape .screen-cover .poster-view, body.tx-landscape .screen-cover .item-poster { aspect-ratio: 16 / 9 !important; } body.tx-landscape .screen-cover .item-info { padding: 8px 10px 12px !important; height: auto !important; flex: 1; } body.tx-landscape .screen-cover .item-title { font-size: 14px !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; display: block !important; line-height: 1.35; } body.tx-landscape .screen-cover .item-secondTitle { margin-top: 4px; overflow: hidden !important; text-overflow: ellipsis; display: block; } /* ---------- PC 宽屏 ---------- */ @media (min-width: 769px) { .grid-waterfall__content, .grid-waterfall__content--web { grid-template-columns: repeat(5, 1fr) !important; gap: 16px !important; } body.tx-landscape .grid-waterfall__content, body.tx-landscape .grid-waterfall__content--web { grid-template-columns: repeat(4, 1fr) !important; gap: 18px !important; } .grid-waterfall.screen-list__grid { padding: 16px 24px !important; } #tx-header { padding: 12px 24px 0 !important; } #tx-header .tx-title { font-size: 17px !important; } #tx-channels button { padding: 8px 20px !important; font-size: 14px !important; } .tx-filter-tabs { padding: 10px 0 !important; } } /* ---------- 窄屏手机 ---------- */ @media (max-width: 600px) { #tx-header { padding: 8px 8px 0 !important; } #tx-channels button { padding: 6px 12px; font-size: 13px; } .grid-waterfall.screen-list__grid { padding: 6px !important; } .grid-waterfall__content, .grid-waterfall__content--web { gap: 6px !important; } body.tx-landscape .grid-waterfall__content, body.tx-landscape .grid-waterfall__content--web { gap: 8px !important; } body.tx-landscape .screen-cover .item-title { font-size: 13px !important; } } /* ---------- 搜索引擎菜单 + 历史面板 ---------- */ #tx-engine-menu, #tx-history-menu { position: fixed; z-index: 99998; background: #fff; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.18); padding: 6px 0; display: none; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif !important; } #tx-engine-menu { top: 56px; left: 12px; min-width: 172px; } #tx-history-menu { top: 56px; right: 12px; min-width: 210px; max-width: 260px; max-height: 62vh; overflow-y: auto; } #tx-engine-menu.show, #tx-history-menu.show { display: block; } #tx-engine-menu h3, #tx-history-menu h3 { font-size: 13px; color: #999; font-weight: 500; margin: 0; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; } #tx-engine-menu button, #tx-history-menu button { display: flex; align-items: center; width: 100%; border: 0; background: transparent; padding: 11px 16px; font-size: 15px; color: #333; cursor: pointer; text-align: left; font-family: inherit !important; } #tx-engine-menu button .check { margin-left: auto; color: #00b894; font-weight: 700; } #tx-engine-menu button.active { background: #e6f4ff; color: #1a8cff; } #tx-history-menu button[data-htitle] { border-bottom: 1px solid #f5f5f7; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } #tx-history-menu .tx-history-empty { padding: 18px 16px; font-size: 13px; color: #999; text-align: center; } #tx-history-menu #tx-clear-history { width: auto; padding: 3px 10px; font-size: 12px; color: #666; background: #f0f0f3; border-radius: 10px; flex: 0 0 auto; } `; // ==================== 搜索引擎 + 搜索历史 ==================== const ENGINES = [ { key: 'ikan1', name: '爱看1', prefix: 'https://ikanbot.eu.org/search?q=' }, { key: 'ikan2', name: '爱看2', prefix: 'https://www1.ikanbot.com/search?q=' }, { key: 'quark', name: '夸克', prefix: 'https://m.quark.cn/s?q=' }, { key: 'bing', name: '必应', prefix: 'https://www.bing.com/search?q=' }, { key: 'sogou', name: '搜狗', prefix: 'https://www.sogou.com/web?query=' }, { key: 'default', name: '默认', prefix: '' }, ]; let engine = localStorage.getItem('tx-rank-engine') || 'ikan1'; let engineMenu = null; let historyMenu = null; function getHistory() { try { return JSON.parse(localStorage.getItem('tx-rank-history') || '[]'); } catch (e) { return []; } } function saveHistory(arr) { localStorage.setItem('tx-rank-history', JSON.stringify(arr)); } function pushHistory(title) { const h = getHistory().filter(x => x !== title); h.unshift(title); if (h.length > 30) h.length = 30; saveHistory(h); } function escapeHtml(s) { return String(s).replace(/&/g, '&').replace(/"/g, '"').replace(//g, '>'); } // 按当前引擎搜索片名(引擎=「默认」时回退第一个可搜索引擎) function searchTitle(title) { if (!title) return; pushHistory(title); renderHistoryMenu(); const en = ENGINES.find(e => e.key === engine && e.prefix) || ENGINES.find(e => e.prefix); window.open(en.prefix + encodeURIComponent(title), '_blank'); } function renderEngineMenu() { engineMenu.innerHTML = '