Doveboy

Untitled

May 18th, 2018
567
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 199.51 KB | None | 0 0
  1. // ==UserScript==
  2. // @name 豆瓣资源下载大师·完整版
  3. // @description 在豆瓣电影/电视剧/纪录片/综艺/动画等页面显示对应的在线播放链接、字幕下载链接及PT/NZB/BT/磁力/百度盘/115网盘等资源下载链接,聚合186+主流资源网站/字幕网站/资源搜索引擎,是目前聚合资源网站最多的脚本,独家资源颜色标记功能:有对应资源的网站显示绿色,当前无法访问的网站显示白色,没有对应资源的网站则显示删除线;给豆瓣电影条目添加IMDB评分、Metascore及烂番茄评分;本脚本聚合的网站包含需要登陆才能自动颜色标记是否有对应资源的PT/NZB/论坛等网站,如无需聚合这些需要登陆的资源网站,请下载安装豆瓣资源下载大师·轻量版脚本。
  4. // @author 白鸽男孩
  5. // @connect *
  6. // @grant GM_xmlhttpRequest
  7. // @grant GM_setClipboard
  8. // @grant GM_addStyle
  9. // @grant GM_setValue
  10. // @grant GM_getValue
  11. // @grant GM_listValues
  12. // @grant GM_deleteValue
  13. // @grant GM_registerMenuCommand
  14. // @require http://cdn.bootcss.com/jquery/3.2.1/jquery.min.js
  15. // @require https://greasyfork.org/scripts/368137-encodetogb2312/code/encodeToGb2312.js?version=598005
  16. // @include https://movie.douban.com/subject/*
  17. // @version 4.6.4
  18. // @run-at document-start
  19. // @namespace doveboy_js
  20. // ==/UserScript==
  21.  
  22. // add back in GM_addStyle for scripts in @grant none mode
  23. if (typeof GM_addStyle === "undefined") {
  24. function GM_addStyle (cssStr) {
  25. let D = document;
  26. let newNode = D.createElement ('style');
  27. newNode.textContent = cssStr;
  28.  
  29. let targ = D.getElementsByTagName ('head')[0] || D.body || D.documentElement;
  30. targ.appendChild (newNode);
  31. }
  32. }
  33.  
  34. let myScriptStyle = "@charset utf-8;#dale_movie_subject_top_right,#dale_movie_subject_top_right,#dale_movie_subject_top_midle,#dale_movie_subject_middle_right,#dale_movie_subject_bottom_super_banner,#footer,#dale_movie_subject_download_middle,#dale_movie_subject_inner_middle,#movie_home_left_bottom,#dale_movie_home_top_right,#dale_movie_home_side_top,#dale_movie_home_bottom_right,#dale_movie_home_inner_bottom,#dale_movie_home_download_bottom,#dale_movie_home_bottom_right_down,#dale_movie_towhome_explore_right,#dale_movie_chart_top_right,#dale_movie_tags_top_right,#dale_review_best_top_right,.mobile-app-entrance.block5.app-movie,.qrcode-app,.top-nav-doubanapp,.extra,div.gray_ad,p.pl,div.ticket{display:none}.c-aside{margin-bottom:30px}.c-aside-body{*letter-spacing:normal}.c-aside-body a{border-radius:6px;color:#37A;display:inline-block;letter-spacing:normal;margin:0 8px 8px 0;padding:0 8px;text-align:center;width:65px}.c-aside-body a:link,.c-aside-body a:visited{background-color:#f5f5f5;color:#37A}.c-aside-body a:hover,.c-aside-body a:active{background-color:#e8e8e8;color:#37A}.c-aside-body a.disabled{}.c-aside-body a.available{background-color:#5ccccc;color:#006363}.c-aside-body a.available:hover,.c-aside-body a.available:active{background-color:#3cc}.c-aside-body a.sites_r0{text-decoration:line-through}#c_dialog li{margin:10px}#c_dialog{text-align:center}#interest_sectl .rating_imdb{border-top:1px solid #eaeaea;border-bottom:1px solid #eaeaea;padding-bottom:0}#interest_sectl .rating_wrap{padding-top:15px}#interest_sectl .rating_more{border-bottom:1px solid #eaeaea;color:#9b9b9b;margin:0;padding:15px 0;position:relative}#interest_sectl .rating_more a{left:80px;position:absolute}#interest_sectl .rating_more .titleOverviewSprite{background:url(https://coding.net/u/Changhw/p/MyDoubanMovieHelper/git/raw/master/title_overview_sprite.png) no-repeat;display:inline-block;vertical-align:middle}#interest_sectl .rating_more .popularityImageUp{background-position:-14px -478px;height:8px;width:8px}#interest_sectl .rating_more .popularityImageDown{background-position:-34px -478px;height:8px;width:8px}#interest_sectl .rating_more .popularityUpOrFlat{color:#83C40B}#interest_sectl .rating_more .popularityDown{color:#930E02}/*!jQuery UI - v1.12.1 - 2016-09-14 * http://jqueryui.com * Includes:core.css,accordion.css,autocomplete.css,menu.css,button.css,controlgroup.css,checkboxradio.css,datepicker.css,dialog.css,draggable.css,resizable.css,progressbar.css,selectable.css,selectmenu.css,slider.css,sortable.css,spinner.css,tabs.css,tooltip.css,theme.css * To view and modify this theme,visit http://jqueryui.com/themeroller/?bgShadowXPos=&bgOverlayXPos=&bgErrorXPos=&bgHighlightXPos=&bgContentXPos=&bgHeaderXPos=&bgActiveXPos=&bgHoverXPos=&bgDefaultXPos=&bgShadowYPos=&bgOverlayYPos=&bgErrorYPos=&bgHighlightYPos=&bgContentYPos=&bgHeaderYPos=&bgActiveYPos=&bgHoverYPos=&bgDefaultYPos=&bgShadowRepeat=&bgOverlayRepeat=&bgErrorRepeat=&bgHighlightRepeat=&bgContentRepeat=&bgHeaderRepeat=&bgActiveRepeat=&bgHoverRepeat=&bgDefaultRepeat=&iconsHover=url(%22images%2Fui-icons_555555_256x240.png%22)&iconsHighlight=url(%22images%2Fui-icons_777620_256x240.png%22)&iconsHeader=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsError=url(%22images%2Fui-icons_cc0000_256x240.png%22)&iconsDefault=url(%22images%2Fui-icons_777777_256x240.png%22)&iconsContent=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsActive=url(%22images%2Fui-icons_ffffff_256x240.png%22)&bgImgUrlShadow=&bgImgUrlOverlay=&bgImgUrlHover=&bgImgUrlHighlight=&bgImgUrlHeader=&bgImgUrlError=&bgImgUrlDefault=&bgImgUrlContent=&bgImgUrlActive=&opacityFilterShadow=Alpha(Opacity%3D30)&opacityFilterOverlay=Alpha(Opacity%3D30)&opacityShadowPerc=30&opacityOverlayPerc=30&iconColorHover=%23555555&iconColorHighlight=%23777620&iconColorHeader=%23444444&iconColorError=%23cc0000&iconColorDefault=%23777777&iconColorContent=%23444444&iconColorActive=%23ffffff&bgImgOpacityShadow=0&bgImgOpacityOverlay=0&bgImgOpacityError=95&bgImgOpacityHighlight=55&bgImgOpacityContent=75&bgImgOpacityHeader=75&bgImgOpacityActive=65&bgImgOpacityHover=75&bgImgOpacityDefault=75&bgTextureShadow=flat&bgTextureOverlay=flat&bgTextureError=flat&bgTextureHighlight=flat&bgTextureContent=flat&bgTextureHeader=flat&bgTextureActive=flat&bgTextureHover=flat&bgTextureDefault=flat&cornerRadius=3px&fwDefault=normal&ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&cornerRadiusShadow=8px&thicknessShadow=5px&offsetLeftShadow=0px&offsetTopShadow=0px&opacityShadow=.3&bgColorShadow=%23666666&opacityOverlay=.3&bgColorOverlay=%23aaaaaa&fcError=%235f3f3f&borderColorError=%23f1a899&bgColorError=%23fddfdf&fcHighlight=%23777620&borderColorHighlight=%23dad55e&bgColorHighlight=%23fffa90&fcContent=%23333333&borderColorContent=%23dddddd&bgColorContent=%23ffffff&fcHeader=%23333333&borderColorHeader=%23dddddd&bgColorHeader=%23e9e9e9&fcActive=%23ffffff&borderColorActive=%23003eff&bgColorActive=%23007fff&fcHover=%232b2b2b&borderColorHover=%23cccccc&bgColorHover=%23ededed&fcDefault=%23454545&borderColorDefault=%23c5c5c5&bgColorDefault=%23f6f6f6 * Copyright jQuery Foundation and other contributors;Licensed MIT */ .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{border:0;font-size:100%;line-height:1.3;list-style:none;margin:0;outline:0;padding:0;text-decoration:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{border-collapse:collapse;content:'';display:table}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default !important;pointer-events:none}.ui-icon{background-repeat:no-repeat;display:inline-block;margin-top:-.25em;overflow:hidden;position:relative;text-indent:-99999px;vertical-align:middle}.ui-widget-icon-block{display:block;left:50%;margin-left:-8px}.ui-widget-overlay{height:100%;left:0;position:fixed;top:0;width:100%}.ui-accordion .ui-accordion-header{cursor:pointer;display:block;font-size:100%;margin:2px 0 0 0;padding:.5em .5em .5em .7em;position:relative}.ui-accordion .ui-accordion-content{border-top:0;overflow:auto;padding:1em 2.2em}.ui-autocomplete{cursor:default;left:0;position:absolute;top:0}.ui-menu{display:block;list-style:none;margin:0;outline:0;padding:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{cursor:pointer;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);margin:0}.ui-menu .ui-menu-item-wrapper{padding:3px 1em 3px .4em;position:relative}.ui-menu .ui-menu-divider{border-width:1px 0 0 0;font-size:0;height:0;line-height:0;margin:5px 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{bottom:0;left:.2em;margin:auto 0;position:absolute;top:0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-button{cursor:pointer;display:inline-block;line-height:normal;margin-right:.1em;overflow:visible;padding:.4em 1em;position:relative;text-align:center;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{box-sizing:border-box;text-indent:-9999px;white-space:nowrap;width:2em}input.ui-button.ui-button-icon-only{text-indent:0}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px;margin-top:-8px;position:absolute;top:50%}.ui-button.ui-icon-notext .ui-icon{height:2.1em;padding:0;text-indent:-9999px;white-space:nowrap;width:2.1em}input.ui-button.ui-icon-notext .ui-icon{height:auto;padding:.4em 1em;text-indent:0;white-space:normal;width:auto}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-controlgroup{display:inline-block;vertical-align:middle}.ui-controlgroup>.ui-controlgroup-item{float:left;margin-left:0;margin-right:0}.ui-controlgroup>.ui-controlgroup-item:focus,.ui-controlgroup>.ui-controlgroup-item.ui-visual-focus{z-index:9999}.ui-controlgroup-vertical>.ui-controlgroup-item{display:block;float:none;margin-bottom:0;margin-top:0;text-align:left;width:100%}.ui-controlgroup-vertical .ui-controlgroup-item{box-sizing:border-box}.ui-controlgroup .ui-controlgroup-label{padding:.4em 1em}.ui-controlgroup .ui-controlgroup-label span{font-size:80%}.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item{border-left:none}.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item{border-top:none}.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content{border-right:none}.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content{border-bottom:none}.ui-controlgroup-vertical .ui-spinner-input{width:75%;width:calc(100% - 2.4em)}.ui-controlgroup-vertical .ui-spinner .ui-spinner-up{border-top-style:solid}.ui-checkboxradio-label .ui-icon-background{border:0;border-radius:.12em;box-shadow:inset 1px 1px 1px #ccc}.ui-checkboxradio-radio-label .ui-icon-background{border:0;border-radius:1em;height:16px;overflow:visible;width:16px}.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon{background-image:none;border-style:solid;border-width:4px;height:8px;width:8px}.ui-checkboxradio-disabled{pointer-events:none}.ui-datepicker{display:none;padding:.2em .2em 0;width:17em}.ui-datepicker .ui-datepicker-header{padding:.2em 0;position:relative}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{height:1.8em;position:absolute;top:2px;width:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;left:50%;margin-left:-8px;margin-top:-8px;position:absolute;top:50%}.ui-datepicker .ui-datepicker-title{line-height:1.8em;margin:0 2.3em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{border-collapse:collapse;font-size:.9em;margin:0 0 .4em;width:100%}.ui-datepicker th{border:0;font-weight:bold;padding:.7em .3em;text-align:center}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;border-bottom:0;border-left:0;border-right:0;margin:.7em 0 0 0;padding:0 .2em}.ui-datepicker .ui-datepicker-buttonpane button{cursor:pointer;float:right;margin:.5em .2em .4em;overflow:visible;padding:.2em .6em .3em .6em;width:auto}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{margin:0 auto .4em;width:95%}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;font-size:0;width:100%}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{left:auto;right:2px}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{left:auto;right:1px}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:1px;border-right-width:0}.ui-datepicker .ui-icon{background-repeat:no-repeat;display:block;left:.5em;overflow:hidden;text-indent:-99999px;top:.3em}.ui-dialog{left:0;outline:0;padding:.2em;position:absolute;top:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;overflow:hidden;white-space:nowrap;width:90%;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{height:20px;margin:-10px 0 0 0;padding:1px;position:absolute;right:.3em;top:50%;width:20px}.ui-dialog .ui-dialog-content{background:none;border:0;overflow:auto;padding:.5em 1em;position:relative}.ui-dialog .ui-dialog-buttonpane{background-image:none;border-width:1px 0 0 0;margin-top:.5em;padding:.3em 1em .5em .4em;text-align:left}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{cursor:pointer;margin:.5em .4em .5em 0}.ui-dialog .ui-resizable-n{height:2px;top:0}.ui-dialog .ui-resizable-e{right:0;width:2px}.ui-dialog .ui-resizable-s{bottom:0;height:2px}.ui-dialog .ui-resizable-w{left:0;width:2px}.ui-dialog .ui-resizable-se,.ui-dialog .ui-resizable-sw,.ui-dialog .ui-resizable-ne,.ui-dialog .ui-resizable-nw{height:7px;width:7px}.ui-dialog .ui-resizable-se{bottom:0;right:0}.ui-dialog .ui-resizable-sw{bottom:0;left:0}.ui-dialog .ui-resizable-ne{right:0;top:0}.ui-dialog .ui-resizable-nw{left:0;top:0}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-resizable{position:relative}.ui-resizable-handle{display:block;font-size:.1px;position:absolute;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;left:0;top:-5px;width:100%}.ui-resizable-s{bottom:-5px;cursor:s-resize;height:7px;left:0;width:100%}.ui-resizable-e{cursor:e-resize;height:100%;right:-5px;top:0;width:7px}.ui-resizable-w{cursor:w-resize;height:100%;left:-5px;top:0;width:7px}.ui-resizable-se{bottom:1px;cursor:se-resize;height:12px;right:1px;width:12px}.ui-resizable-sw{bottom:-5px;cursor:sw-resize;height:9px;left:-5px;width:9px}.ui-resizable-nw{cursor:nw-resize;height:9px;left:-5px;top:-5px;width:9px}.ui-resizable-ne{cursor:ne-resize;height:9px;right:-5px;top:-5px;width:9px}.ui-progressbar{height:2em;overflow:hidden;text-align:left}.ui-progressbar .ui-progressbar-value{height:100%;margin:-1px}.ui-progressbar .ui-progressbar-overlay{background:url(data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==);height:100%;opacity:.25;filter:alpha(opacity=25)}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{border:1px dotted black;position:absolute;z-index:100}.ui-selectmenu-menu{display:none;left:0;margin:0;padding:0;position:absolute;top:0}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{border:0;font-size:1em;font-weight:bold;height:auto;line-height:1.5;margin:.5em 0 0 0;padding:2px .4em}.ui-selectmenu-open{display:block}.ui-selectmenu-text{display:block;margin-right:20px;overflow:hidden;text-overflow:ellipsis}.ui-selectmenu-button.ui-button{text-align:left;white-space:nowrap;width:14em}.ui-selectmenu-icon.ui-icon{float:right;margin-top:0}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{cursor:default;height:1.2em;position:absolute;width:1.2em;z-index:2;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{background-position:0 0;border:0;display:block;font-size:.7em;position:absolute;z-index:1}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{margin-left:-.6em;top:-.3em}.ui-slider-horizontal .ui-slider-range{height:100%;top:0}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{height:100px;width:.8em}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-bottom:-.6em;margin-left:0}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-spinner{display:inline-block;overflow:hidden;padding:0;position:relative;vertical-align:middle}.ui-spinner-input{background:none;border:0;color:inherit;margin:.2em 0;margin-left:.4em;margin-right:2em;padding:.222em 0;vertical-align:middle}.ui-spinner-button{cursor:default;display:block;font-size:.5em;height:50%;margin:0;overflow:hidden;padding:0;position:absolute;right:0;text-align:center;width:1.6em}.ui-spinner a.ui-spinner-button{border-bottom-style:none;border-right-style:none;border-top-style:none}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-tabs{padding:.2em;position:relative}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{border-bottom-width:0;float:left;list-style:none;margin:1px .2em 0 0;padding:0;position:relative;top:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{background:none;border-width:0;display:block;padding:1em 1.4em}.ui-tooltip{max-width:300px;padding:8px;position:absolute;z-index:9999}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #c5c5c5}.ui-widget-content{background:#fff;border:1px solid #ddd;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{background:#e9e9e9;border:1px solid #ddd;color:#333;font-weight:bold}.ui-widget-header a{color:#333}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{background:#f6f6f6;border:1px solid #c5c5c5;color:#454545;font-weight:normal}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#454545;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{background:#ededed;border:1px solid #ccc;color:#2b2b2b;font-weight:normal}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#2b2b2b;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px #5e9ed6}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{background:#007fff;border:1px solid #003eff;color:#fff;font-weight:normal}.ui-icon-background,.ui-state-active .ui-icon-background{background-color:#fff;border:#003eff}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#fff;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{background:#fffa90;border:1px solid #dad55e;color:#777620}.ui-state-checked{background:#fffa90;border:1px solid #dad55e}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#777620}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{background:#fddfdf;border:1px solid #f1a899;color:#5f3f3f}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#5f3f3f}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#5f3f3f}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{font-weight:normal;opacity:.7;filter:Alpha(Opacity=70)}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{background-image:none;opacity:.35;filter:Alpha(Opacity=35)}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{height:16px;width:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(https://cdn.bootcss.com/jqueryui/1.12.1/images/ui-icons_444444_256x240.png)}.ui-widget-header .ui-icon{background-image:url(https://cdn.bootcss.com/jqueryui/1.12.1/images/ui-icons_444444_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url(https://cdn.bootcss.com/jqueryui/1.12.1/images/ui-icons_555555_256x240.png)}.ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url(https://cdn.bootcss.com/jqueryui/1.12.1/images/ui-icons_ffffff_256x240.png)}.ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url(https://cdn.bootcss.com/jqueryui/1.12.1/images/ui-icons_777620_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(https://cdn.bootcss.com/jqueryui/1.12.1/images/ui-icons_cc0000_256x240.png)}.ui-button .ui-icon{background-image:url(https://cdn.bootcss.com/jqueryui/1.12.1/images/ui-icons_777777_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:3px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:3px}.ui-widget-overlay{background:#aaa;opacity:.003;filter:Alpha(Opacity=.3)}.ui-widget-shadow{-webkit-box-shadow:0 0 5px #666;box-shadow:0 0 5px #666}";
  35. GM_addStyle(myScriptStyle);
  36.  
  37.  
  38. $(document).ready(funciton(){if (location.href.startwith('https://movie.douban.com/subject/')) {
  39. // 定义基础方法
  40. function getDoc(url, meta, callback) {
  41. GM_xmlhttpRequest({
  42. method: 'GET',
  43. url: url,
  44. headers: {
  45. 'User-agent': window.navigator.userAgent,
  46. 'Content-type': null
  47. },
  48. onload: function (responseDetail) {
  49. if (responseDetail.status === 200) {
  50. let doc = (new DOMParser).parseFromString(responseDetail.responseText, 'text/html');
  51. callback(doc, responseDetail, meta);
  52. }
  53. }
  54. });
  55. }
  56. function getJSON(url, callback) {
  57. GM_xmlhttpRequest({
  58. method: 'GET',
  59. url: url,
  60. headers: {
  61. 'Accept': 'application/json'
  62. },
  63. onload: function (response) {
  64. if (response.status >= 200 && response.status < 400) {
  65. callback(JSON.parse(response.responseText), url);
  66. } else {
  67. callback(false, url);
  68. }
  69. }
  70. });
  71. }
  72.  
  73. let cache_prefix = "cache_";
  74.  
  75. function GM_deletedCacheValue(name) {
  76. GM_deleteValue(name);
  77. GM_deleteValue(cache_prefix + name);
  78. }
  79.  
  80. function GM_setCacheValue (name,value,expire,json_parser) {
  81. GM_setValue(name,json_parser ? JSON.stringify(value) : value);
  82. GM_setValue(cache_prefix + name,json_parser ? JSON.stringify(Date.now() + expire) : (Date.now() + expire));
  83. }
  84.  
  85. function GM_getCacheValue (name,defaultValue,json_parser) {
  86. let expire_timestamp = parseInt(GM_getValue(cache_prefix + name));
  87. if (expire_timestamp < Date.now()) {
  88. GM_deletedCacheValue(name);
  89. }
  90.  
  91. return json_parser ? JSON.parse(GM_getValue(name,defaultValue)): GM_getValue(name,defaultValue);
  92. }
  93.  
  94. function GM_clearExpiredCacheValue(force) {
  95. let cache_key = GM_listValues().filter(function (key) {
  96. return key.includes(cache_prefix)
  97. });
  98. for (let i=0;i< cache_key.length;i++) {
  99. let name = cache_key[i].slice(cache_prefix.length);
  100. let expired_timestamp = GM_getValue(cache_prefix + name);
  101. if(force || expired_timestamp < Date.now()) {
  102. GM_deletedCacheValue(name);
  103. }
  104. }
  105. }
  106.  
  107. GM_clearExpiredCacheValue(false);
  108.  
  109. let _version = GM_getValue("version","完整版");
  110.  
  111. if (typeof GM_registerMenuCommand !== "undefined") {
  112.  
  113. function changeVersionConfirm() {
  114. if (confirm(`你当前版本是 ${_version},是否进行切换?`)) {
  115. GM_setValue("version",_version === "完整版" ? "轻量版" : "完整版");
  116. }
  117. }
  118. GM_registerMenuCommand("脚本功能切换",changeVersionConfirm);
  119.  
  120. function deleteSitePrompt() {
  121. let delete_site_prefix = "delete_site_";
  122. let name=prompt("请输入你不想看到的站点名称,请注意,除非重装脚本,否则该操作不可撤销","");
  123. if (name!=null && name!=="") {
  124. if (GM_getValue(delete_site_prefix + name,false)) {
  125. GM_deleteValue(delete_site_prefix + name);
  126. } else { // 二次输入恢复
  127. GM_setValue(delete_site_prefix + name,true);
  128. }
  129. }
  130. }
  131. GM_registerMenuCommand("删除不想显示的站",deleteSitePrompt);
  132.  
  133. function changeTagBColor() {
  134. let now_bcolor_list = [GM_getValue("tag_bcolor_exist","#e3f1ed"),GM_getValue("tag_bcolor_not_exist","#f4eac2"),GM_getValue("tag_bcolor_need_login",""),GM_getValue("tag_bcolor_error","")];
  135. let name = prompt("请依次输入代表'资源存在','资源不存在','站点需要登陆','站点解析错误'颜色的Hex值,并用英文逗号分割。当前值为:" , `${now_bcolor_list.join(',')}`);
  136. if (name!=null && name!=="") {
  137. try {
  138. let bcolor_list = name.split(",");
  139. GM_setValue("tag_bcolor_exist",bcolor_list[0] || "#e3f1ed");
  140. GM_setValue("tag_bcolor_not_exist",bcolor_list[1] || "#f4eac2");
  141. GM_setValue("tag_bcolor_need_login",bcolor_list[2] || "");
  142. GM_setValue("tag_bcolor_error",bcolor_list[3] || "");
  143. } catch (e) {
  144. alert("解析输入出错");
  145. }
  146. }
  147. }
  148. GM_registerMenuCommand("更改标签背景色",changeTagBColor);
  149.  
  150. function changeTagFColor() {
  151. let now_fcolor_list = [GM_getValue("tag_fcolor_exist","#3377aa"),GM_getValue("tag_fcolor_not_exist","#3377aa"),GM_getValue("tag_fcolor_need_login","#3377aa"),GM_getValue("tag_fcolor_error","#3377aa")];
  152. let name = prompt("请依次输入代表'资源存在','资源不存在','站点需要登陆','站点解析错误'颜色的Hex值,并用英文逗号分割。当前值为:" , `${now_fcolor_list.join(',')}`);
  153. if (name!=null && name!=="") {
  154. try {
  155. let fcolor_list = name.split(",");
  156. GM_setValue("tag_fcolor_exist",fcolor_list[0] || "#3377aa");
  157. GM_setValue("tag_fcolor_not_exist",fcolor_list[1] || "#3377aa");
  158. GM_setValue("tag_fcolor_need_login",fcolor_list[2] || "#3377aa");
  159. GM_setValue("tag_fcolor_error",fcolor_list[3] || "#3377aa");
  160. } catch (e) {
  161. alert("解析输入出错");
  162. }
  163. }
  164. }
  165. GM_registerMenuCommand("更改标签文字色",changeTagFColor);
  166.  
  167. function forceCacheClear() {
  168. if (confirm("清空所有缓存信息(包括资源存在情况、登陆情况、imdb250等)")) {
  169. GM_clearExpiredCacheValue(true);
  170. }
  171. }
  172. GM_registerMenuCommand("清空脚本缓存",forceCacheClear);
  173.  
  174. }
  175.  
  176.  
  177. $(document).ready(function () {
  178. // 脚本对页面进行预处理
  179. if($('#info span.pl:contains("又名")').length === 0){
  180. $('#info').append('<div style="display: none"><span class="pl">又名:</span>啥也没有<br></div>');
  181. }
  182.  
  183. if($('div#info a[href^=\'http://www.imdb.com/title/tt\']').length === 0){
  184. $('#info').append('<div style="display: none"><span class="pl">IMDb链接:</span><a href="http://www.imdb.com/title/tt9999999" target="_blank" rel="nofollow">tt9999999</a><br></div>');
  185. }
  186.  
  187. if ($('#mainpic p.gact').length === 0) {
  188. $("#mainpic").append("<p class=\"gact\"></p>")
  189. }
  190.  
  191. let interest_sectl_selector = $('#interest_sectl');
  192. interest_sectl_selector.after($('div.grid-16-8 div.related-info'));
  193. interest_sectl_selector.attr('style', 'float:right');
  194. $('div.related-info').attr('style', 'width:480px;float:left');
  195.  
  196. $("div#info").append("<span class=\"pl\">生成信息: </span><a id='movieinfogen' href='javascript:void(0);'>movieinfo</a>");
  197. let movieinfo_html = $("<div class='c-aside' style='float:left;margin-top:20px;width: 470px;display: none' id='movieinfo_div'><h2><i>电影简介</i>· · · · · · </h2><a href='javascript:void(0);' id='copy_movieinfo'>点击复制</a><div class=\"c-aside-body\" style=\"padding: 0 12px;\" id='movieinfo'></div></div>");
  198. if ($("#movieinfo").length === 0) {
  199. $("div.related-info").before(movieinfo_html);
  200. $("a#copy_movieinfo").click(function() {
  201. let movieinfo_html = $("#movieinfo").html();
  202. let movieclip = movieinfo_html.replace(/<br>/ig,"\n")
  203. .replace(/<a [^>]*>/g,"").replace(/<\/a>/g,"");
  204. GM_setClipboard(movieclip);
  205. $(this).text("复制成功");
  206. })
  207. }
  208.  
  209. // 查看原图
  210. let posterAnchor = document.querySelector('#mainpic > a > img');
  211. if (posterAnchor) {
  212. let postersUrl = posterAnchor.getAttribute("src");
  213. let rawUrl = postersUrl.replace(/photo\/s_ratio_poster\/public\/(p\d+).+$/,"photo/raw/public/$1.jpg");
  214. $('#mainpic p.gact').after(`<a target="_blank" rel="nofollow" href="${rawUrl}">查看原图</a>`);
  215. }
  216.  
  217. // Movieinfo信息生成相关
  218. let poster;
  219. let this_title, trans_title, aka;
  220. let year, region, genre,language,playdate;
  221. let imdb_link, imdb_id, imdb_average_rating, imdb_votes, imdb_rating;
  222. let douban_link, douban_id, douban_average_rating, douban_votes, douban_rating;
  223. let episodes, duration;
  224. let director, writer, cast;
  225. let tags,introduction,awards;
  226.  
  227. function descriptionGenerator() {
  228. let descr = "";
  229. descr += poster ? `[img]${poster}[/img]\n\n` : "";
  230. descr += (trans_title && !trans_title.match(/啥也没有/)) ? `◎译  名 ${trans_title}\n` : "";
  231. descr += this_title ? `◎片  名 ${this_title}\n` : "";
  232. descr += year ? `◎年  代 ${year.trim()}\n` : "";
  233. descr += region ? `◎产  地 ${region}\n` : "";
  234. descr += genre ? `◎类  别 ${genre}\n` : "";
  235. descr += language ? `◎语  言 ${language}\n` : "";
  236. descr += playdate ? `◎上映日期 ${playdate}\n` : "";
  237. descr += imdb_rating ? `◎IMDb评分 ${imdb_rating}\n` : ""; // 注意如果长时间没能请求完成imdb信息,则该条不显示
  238. descr += (imdb_link && !imdb_link.match(/9999999/)) ? `◎IMDb链接 ${imdb_link}\n` : "";
  239. descr += douban_rating ? `◎豆瓣评分 ${douban_rating}\n` : "";
  240. descr += douban_link ? `◎豆瓣链接 ${douban_link}\n` : "";
  241. descr += episodes ? `◎集  数 ${episodes}\n` : "";
  242. descr += duration ? `◎片  长 ${duration}\n` : "";
  243. descr += director ? `◎导  演 ${director}\n` : "";
  244. descr += writer ? `◎编  剧 ${writer}\n` : "";
  245. descr += cast ? `◎主  演 ${cast.replace(/\n/g, '\n' + ' '.repeat(4) + '  ').trim()}\n` : "";
  246. descr += tags ? `\n◎标  签 ${tags}\n` : "";
  247. descr += introduction ? `\n◎简  介\n\n  ${introduction.replace(/\n/g, '\n' + ' '.repeat(2))}\n` : "";
  248. descr += awards ? `\n◎获奖情况\n\n  ${awards.replace(/\n/g, '\n' + ' '.repeat(2))}\n` : "";
  249. movieinfo_html.find("div#movieinfo").html(descr.replace(/\n/ig,"<br>"));
  250. }
  251. $("a#movieinfogen").click(function() {
  252. descriptionGenerator();
  253. $("#movieinfo_div").toggle();
  254. });
  255.  
  256. let fetch = function (anchor) {
  257. return anchor[0].nextSibling.nodeValue.trim();
  258. };
  259.  
  260. // 从页面中解析信息并请求imdb等第三方数据
  261. let chinese_title = document.title.replace('(豆瓣)','').trim();
  262. let foreign_title = $('#content h1>span[property="v:itemreviewed"]').text().replace(chinese_title, '').trim();
  263. let aka_anchor = $('#info span.pl:contains("又名")');
  264. if (aka_anchor[0]) {
  265. aka = fetch(aka_anchor).split(' / ').sort(function (a, b) {//首字(母)排序
  266. return a.localeCompare(b);
  267. }).join('/');
  268. }
  269. if (foreign_title) {
  270. trans_title = chinese_title + (aka ? ('/' + aka) : '');
  271. this_title = foreign_title;
  272. } else {
  273. trans_title = aka ? aka : '';
  274. this_title = chinese_title;
  275. }
  276. year = ' ' + $('#content > h1 > span.year').text().substr(1, 4);
  277.  
  278. let regions_anchor = $('#info span.pl:contains("制片国家/地区")'); //产地
  279. if (regions_anchor[0]) {
  280. region = fetch(regions_anchor).split(' / ').join('/');
  281. }
  282.  
  283. genre = $('#info span[property="v:genre"]').map(function () { //类别
  284. return $(this).text().trim();
  285. }).toArray().join('/');
  286.  
  287. let language_anchor = $('#info span.pl:contains("语言")'); //语言
  288. if (language_anchor[0]) {
  289. language = fetch(language_anchor).split(' / ').join('/');
  290. }
  291.  
  292. playdate = $('#info span[property="v:initialReleaseDate"]').map(function () { //上映日期
  293. return $(this).text().trim();
  294. }).toArray().sort(function (a, b) {//按上映日期升序排列
  295. return new Date(a) - new Date(b);
  296. }).join('/');
  297. //IMDb链接
  298. let imdb_link_anchor = $('#info span.pl:contains("IMDb链接")');
  299. if (imdb_link_anchor[0]) { // 请求IMDb信息(最慢,最先且单独请求)
  300. imdb_link = imdb_link_anchor.next().attr('href').replace(/(\/)?$/, '/').replace("http://","https://");
  301. imdb_id = imdb_link.match(/tt\d+/)[0];
  302.  
  303. // add IMDB top 250 tag
  304. function addIMDBtop250(list) {
  305. let number = list.indexOf('data-tconst="' + imdb_id + '"') + 1;
  306. if (number < 1 || number > 250) return;
  307. // inject css if needed
  308. if (document.getElementsByClassName('top250').length === 0) {
  309. let style = '.top250{background:url(https://s.doubanio.com/f/movie/f8a7b5e23d00edee6b42c6424989ce6683aa2fff/pics/movie/top250_bg.png) no-repeat;width:150px;font:12px Helvetica,Arial,sans-serif;margin:5px 0;color:#744900}.top250 span{display:inline-block;text-align:center;height:18px;line-height:18px}.top250 a,.top250 a:link,.top250 a:hover,.top250 a:active,.top250 a:visited{color:#744900;text-decoration:none;background:none}.top250-no{width:34%}.top250-link{width:66%}';
  310. GM_addStyle(style);
  311. }
  312. let after = document.getElementById('dale_movie_subject_top_icon');
  313. if (!after) after = document.querySelector('h1');
  314. after.insertAdjacentHTML('beforebegin', '<div class="top250"><span class="top250-no">No.' + number + '</span><span class="top250-link"><a href="http://www.imdb.com/chart/top">IMDb Top 250</a></span></div>');
  315. [].forEach.call(document.getElementsByClassName('top250'), function (e) {
  316. e.style.display = 'inline-block';
  317. });
  318. }
  319.  
  320. let cache_imdb_250 = GM_getCacheValue("imdb_250",false);
  321. if (cache_imdb_250) {
  322. addIMDBtop250(cache_imdb_250);
  323. } else {
  324. getDoc('https://m.imdb.com/chart/top',null, function (doc,res) {
  325. let list = res.responseText.match(/data-tconst="(tt\d{7})"/g);
  326. GM_setCacheValue("imdb_250",list,86400 * 1e3);
  327. addIMDBtop250(list)
  328. });
  329. }
  330.  
  331. $("div.rating_betterthan").after("<div class='rating_wrap clearbox' id='loading_more_rate'>加载第三方评价信息中.......</div>");
  332. getDoc(imdb_link,null,function (doc) {
  333. // 评分,Metascore,烂番茄
  334. imdb_average_rating = $('span[itemprop=ratingValue]', doc).text();
  335. imdb_votes = $('span[itemprop=ratingCount]', doc).text();
  336. imdb_rating = imdb_votes ? imdb_average_rating + '/10 from ' + imdb_votes + ' users' : ''; // MovieinfoGen 相关
  337.  
  338. let starValue = parseFloat(imdb_average_rating) / 2;
  339. starValue = starValue % 1 > 0.5 ? Math.floor(starValue) + 0.5 : Math.floor(starValue);
  340. starValue *= 10;
  341.  
  342. $('#interest_sectl').append(`<div class="rating_wrap clearbox rating_imdb" rel="v:rating"> <div class=rating_logo >IMDB 评分</div> <div class="rating_self clearfix" typeof="v:Rating"> <strong class="ll rating_num" property="v:average">${imdb_average_rating}</strong><span property="v:best" content=10.0 ></span> <div class="rating_right "> <div class="ll bigstar ${'bigstar' + starValue}"></div> <div class="rating_sum"> <a href=${imdb_link + 'ratings?ref_=tt_ov_rt'} class=rating_people ><span property="v:votes">${imdb_votes}</span>人评价</a> </div> </div> </div> </div>`);
  343.  
  344. // put on more ratings
  345. $('#interest_sectl .rating_imdb').after('<div class="rating_more"></div>');
  346. let rating_more = $('#interest_sectl .rating_more');
  347. let titleReviewBarItem = $('.titleReviewBar div.titleReviewBarItem', doc);
  348. for (let i = 0; i < titleReviewBarItem.length; i++) {
  349. let item = titleReviewBarItem[i];
  350. let text = $(item).text();
  351. if (text.indexOf('Metascore') !== -1) {
  352. let metascore = $(item).find('a[href^=criticreviews] span').text();
  353. rating_more.append(`<div>Metascore<a href='${imdb_link + 'criticreviews?ref_=tt_ov_rt'}' target="_blank">${metascore}</a></div>`);
  354. } else if (text.indexOf('Popularity') !== -1) {
  355. let popularity = $(item).find('span.subText').html();
  356. popularity = `<div>流行度&nbsp;&nbsp;${popularity}<br><div>`;
  357. rating_more.append(popularity);
  358. } else if (text.indexOf('Reviews') !== -1) {
  359. // TODO let reviews;
  360. }
  361. }
  362.  
  363. // add rottentomatoes block
  364. $('#titleYear', doc).remove();
  365. let movieTitle = $.trim($('h1[itemprop=name]', doc).text());
  366. let rottURL = 'https://www.rottentomatoes.com/m/' + movieTitle.replace(/\s+/g,"_").replace(/\W+/g,"").toLowerCase();
  367. getDoc(rottURL, null, function(rotdoc) {
  368. let rott_html = '<div class="rating_wrap clearbox rating_rott"><span class="rating_logo ll">烂番茄新鲜度</span><br><div id="rottValue" class="rating_self clearfix"></div></div>';
  369. $('#interest_sectl').append(rott_html);
  370. if(!rotdoc.title){
  371. $('#interest_sectl div.rating_rott').append(`<br>搜索rotta: <a target='_blank' href='${'https://www.rottentomatoes.com/search/?search=' + encodeURI(movieTitle)}'>${movieTitle}</a>`);
  372. } else if($('#tomato_meter_link',rotdoc).length > 0) {
  373. let rating_rott_value = $('#tomato_meter_link .meter-value.superPageFontColor', rotdoc).html();
  374. $('#scoreStats .subtle.superPageFontColor', rotdoc).remove();
  375. let fresh_rott_value = $('#scoreStats .superPageFontColor:eq(2)', rotdoc).text();
  376. let rotten_rott_value = $('#scoreStats .superPageFontColor:eq(3)', rotdoc).text();
  377. $('#interest_sectl .rating_rott #rottValue').append(`<strong class="ll rating_num"><a target="_blank" href="${rottURL}">${rating_rott_value}</a></strong><div class="rating_right" style="line-height: 16px;"><span>鲜:&nbsp;&nbsp;${fresh_rott_value}</span><br><span>烂:&nbsp;&nbsp;${rotten_rott_value}</span></div>`);
  378. } else {
  379. $('#interest_sectl div.rating_rott').hide();
  380. }
  381. });
  382.  
  383. $("#loading_more_rate").hide();
  384. });
  385. }
  386.  
  387. douban_link = 'https://' + location.href.match(/movie.douban.com\/subject\/\d+\//); //豆瓣链接
  388. douban_id = location.href.match(/(\d{7,8})/g);
  389. //集数
  390. let episodes_anchor = $('#info span.pl:contains("集数")');
  391. if (episodes_anchor[0]) {
  392. episodes = fetch(episodes_anchor);
  393. }
  394. //片长
  395. let duration_anchor = $('#info span.pl:contains("单集片长")');
  396. if (duration_anchor[0]) {
  397. duration = fetch(duration_anchor);
  398. } else {
  399. duration = $('#info span[property="v:runtime"]').text().trim();
  400. }
  401.  
  402. getDoc(douban_link + 'awards/',null,function (doc) {
  403. awards = $('#content>div>div.article',doc).html()
  404. .replace(/[ \n]/g, '')
  405. .replace(/<\/li><li>/g, '</li> <li>')
  406. .replace(/<\/a><span/g, '</a> <span')
  407. .replace(/<(div|ul)[^>]*>/g, '\n')
  408. .replace(/<[^>]+>/g, '')
  409. .replace(/&nbsp;/g, ' ')
  410. .replace(/ +\n/g, '\n')
  411. .trim();
  412. }); // 该影片的评奖信息
  413. getJSON('https://api.douban.com/v2/movie/' + douban_id,function (data1) {
  414. douban_average_rating = data1.rating.average || 0;
  415. douban_votes = data1.rating.numRaters.toLocaleString() || 0;
  416. douban_rating = douban_average_rating + '/10 from ' + douban_votes + ' users';
  417. introduction = data1.summary.replace(/^None$/g, '暂无相关剧情介绍');
  418. poster = data1.image.replace(/s(_ratio_poster|pic)/g, 'l');
  419. director = data1.attrs.director ? data1.attrs.director.join(' / ') : '';
  420. writer = data1.attrs.writer ? data1.attrs.writer.join(' / ') : '';
  421. cast = data1.attrs.cast ? data1.attrs.cast.join('\n') : '';
  422. tags = data1.tags.map(function (member) {
  423. return member.name;
  424. }).join(' | ');
  425. }); //豆瓣评分,简介,海报,导演,编剧,演员,标签
  426.  
  427. // 获取电影英文名
  428. let eng_title = [this_title, trans_title].join("/").split("/").filter(function (arr) {
  429. return /([a-zA-Z]){2,}/.test(arr);
  430. })[0] || "";
  431.  
  432. // 剧集修正季数名
  433. eng_title = eng_title.match(/Season\s\d\d/) ? eng_title.replace(/Season\s/, "S") : eng_title.replace(/Season\s/, "S0");
  434. eng_title = eng_title.replace(/[:,!\-]/g, "").replace(/ [^a-z0-9]+$/,"");
  435. let eng_title_clean = eng_title.replace(/ S\d\d*$/, "");
  436.  
  437. // 电影+年份 (只有电影才搜索并赋值年份)
  438. let is_movie = $('a.bn-sharing').attr('data-type').match(/电影/);
  439. let encode_year = is_movie ? year.replace(/ /,"_") : "";
  440. let nian = is_movie ? year : "";
  441. let encode_eng_title = (eng_title || "").replace(/ /g,"_");
  442. let ptzimu = encode_eng_title + encode_year;
  443. chinese_title = chinese_title.replace(/[:,]/," ");
  444. let gtitle = encodeToGb2312(chinese_title,true);
  445. let ywm = eng_title + nian;
  446. let zwm = chinese_title + nian;
  447.  
  448. // get Chinese title
  449. let title = encodeURI($('#content > h1 > span')[0].textContent.split(' ').shift().replace(/[:,]/," "));
  450.  
  451. let site_map = [];
  452.  
  453. /** label对象键值说明:
  454. * name: String 站点名称,请注意该站点名称在不同的site_map中也应该唯一,以免脚本后续判断出错
  455. * method: String 搜索请求方式,默认值为 "GET"
  456. * link: String 构造好的请求页面链接,作为label的href属性填入,用户应该能直接点开这个页面。
  457. * ajax: String 如果站点使用ajax的形式加载页面,则需要传入该值作为实际请求的链接,即优先级比link更高。
  458. * type: String 返回结果类型,脚本默认按html页面解析;只有当传入值为"json"时,脚本按JSON格式解析
  459. * selector: String 搜索成功判断结果,默认值为 "table.torrents:last > tbody > tr:gt(0)" (适用于国内多数NexusPHP构架的站点)
  460. * 如果type为"page"(默认)时,为一个(jQuery)CSS选择器,
  461. * 如果type为"json"时,为一个具体的判断式。
  462. * selector_need_login 搜索需要登录的选择器,仅在type为默认时有用,其余用法同Selector一致。
  463. * selector_not_exit 搜索资源不存在的选择器,仅在type为默认时有用,其余用法同Selector一致。
  464. * data: String 作为请求的主体发送的内容,默认为空即可
  465. * headers: Object 修改默认请求头,(防止某些站点有referrer等请求头检查
  466. * rewrite_href: Boolean 如果站点最终搜索显示的页面与实际使用搜索页面(特别是使用post进行交互的站点)不一致,
  467. * 设置为true能让脚本存储最终url,并改写label使用的href属性
  468. *
  469. * 注意: 1. 如果某键有默认值,则传入值均会覆盖默认值
  470. * 2. 关于请求方法请参考:https://github.com/scriptish/scriptish/wiki/GM_xmlhttpRequest
  471. * */
  472.  
  473. if (_version === "完整版") {
  474. let neizhan = imdb_id.match(/9999999/) ? ('/subject/' + douban_id) : imdb_id; // PT内站 智能判定是用IMDB ID还是豆瓣ID
  475. let npid = imdb_id.match(/9999999/) ? ('douban=' + douban_id) : ('imdb=' + imdb_id); // NPUBITS 智能判定是用IMDB ID还是豆瓣ID
  476. let ttgid = imdb_id.match(/9999999/) ? (zwm) : ( 'IMDB' + imdb_id.slice(2)); // TTG 智能判定是用IMDB ID还是中文名
  477. let zxid = imdb_id.match(/9999999/) ? (zwm) : imdb_id; // ZX 智能判定是用IMDB ID还是中文名
  478.  
  479. site_map.push({
  480. name: "PT内站",
  481. label: [
  482. {name: "BTSchool", link: 'http://pt.btschool.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,/* selector: "table.torrents:last > tbody > tr:gt(0)"}, */},
  483. {name: "BYRBT", link: 'https://bt.byr.cn/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  484. {name: "CCFBits", link: 'http://www.ccfbits.org/browse.php?fullsearch=1&notnewword=1&search=' + neizhan, selector: "table.mainouter > tbody > tr:last > td > table:nth-child(10) > tbody > tr:gt(0)"},
  485. {name: "CHDBits", link: 'https://chdbits.co/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  486. {name: "CMCT", link: 'https://hdcmct.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  487. {name: "GZTown", link: 'https://pt.gztown.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  488. {name: "FRDS", link: 'http://pt.keepfrds.com/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  489. {name: "HDChina", link: 'https://hdchina.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrent_list:last > tbody > tr:gt(0)"},
  490. {name: "HDCity", link: 'https://hdcity.city/pt?incldead=1&search_area=1&notnewword=1&iwannaseethis=' + neizhan, selector: "center > div > div > div.text"},
  491. {name: "HDHome", link: 'https://hdhome.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  492. {name: "HDSky", link: 'https://hdsky.me/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  493. {name: "HDStreet", link: 'https://hdstreet.club/torrents.php?incldead=1&search_area=4&notnewword=1&search=' + douban_id,},
  494. {name: "HDTime", link: 'https://hdtime.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  495. {name: "HDU", link: 'http://pt.upxin.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  496. {name: "Hyperay", link: 'https://hyperay.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrents > tbody > tr.nonstick_outer_bg"},
  497. {name: "JoyHD", link: 'https://www.joyhd.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  498. {name: "MTeam", link: 'https://tp.m-team.cc/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  499. {name: "NPUBITS", link: 'https://npupt.com/torrents.php?incldead=1&search_area=1&notnewword=1&' + npid, selector: "#torrents_table > tbody > tr:gt(0)"},
  500. {name: "NWSUAF", link: 'https://pt.nwsuaf6.edu.cn/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  501. {name: "NYPT", link: 'https://nanyangpt.com/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrents:last > tbody > tr"},
  502. {name: "OpenCD", link: 'https://open.cd/torrents.php?incldead=1&search_area=0&notnewword=1&search=' + chinese_title, selector: "table.torrents:last > tbody > tr:gt(0)"},
  503. {name: "OurBits", link: 'https://ourbits.club/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  504. {name: "OurDiSC", link: 'http://bt.ourdisc.net/browse.php?incldead=0&search=' + chinese_title, selector: "table[width='100%'][border='0'][cellspacing='0'][cellpadding='10'] i"},
  505. {name: "PlayPT", link: 'http://pt.playpt123.org/play.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  506. {name: "SJTU", link: 'https://pt.sjtu.edu.cn/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrents:last > tbody > tr"},
  507. {name: "SS", link: 'https://skyeysnow.com/forum.php?mod=torrents&notnewword=1&search=' + chinese_title + year, selector: "table.torrents > tbody > tr:gt(0)"},
  508. {name: "TCCF", link: 'https://et8.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  509. {name: "TLFBits", link: 'http://pt.eastgame.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  510. {name: "TTG", link: 'https://totheglory.im/browse.php?c=M&notnewword=1&search_field=' + ttgid, selector: "table#torrent_table:last > tbody > tr:gt(0)"},
  511. {name: "U2", link: 'https://u2.dmhy.org/torrents.php?incldead=1&search_area=0&notnewword=1&search=' + chinese_title + year,},
  512. {name: "WHUPT", link: 'https://pt.whu.edu.cn/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrents:last > tbody > tr"},
  513. {name: "ZX", link: 'http://pt.zhixing.bjtu.edu.cn/search/x' + zxid + '-notnewword=1/', selector: "table.torrenttable > tbody > tr:gt(1)"},
  514. ]
  515. });
  516. if(!imdb_id.match(/9999999/)){
  517. site_map.push({
  518. name: "PT外站",
  519. label:[
  520. {name: "AB", link: 'https://animebytes.tv/torrents.php?searchstr=' + ywm, selector: "div.thin > div.group_cont"},
  521. {name: "ADC", link: 'http://asiandvdclub.org/browse.php?descr=1&btnSubmit=Search%21&search=' + imdb_id, selector: "table.torrenttable:last > tbody > tr"},
  522. {name: "AOX", link: 'https://aox.to/index.php?page=torrents&options=4&search=' + imdb_id, selector: "table.table.table-bordered:last > tbody > tr:gt(0)"},
  523. {name: "Apollo", link: 'https://apollo.rip/torrents.php?searchstr=' + eng_title, selector:"#torrent_table:last > tbody > tr.group_torrent:gt(0)"},
  524. {name: "AR", link: 'https://alpharatio.cc/torrents.php?searchstr=' + ywm, selector:"#torrent_table > tbody > tr:gt(0)"},
  525. {name: "AT", link: 'https://animetorrents.me/torrents.php?search=' + eng_title, ajax: 'https://animetorrents.me/ajax/torrents_data.php?total=1&search=' + eng_title + '&SearchSubmit=&page=1' , headers:{"x-requested-with": "XMLHttpRequest"}, rewrite_href:false, selector:'table.dataTable > tbody > tr:nth-child(2)', selector_need_login:"h1.headline strong:contains('Access Denied!')"},
  526. {name: "AVZ", link: 'https://avistaz.to/torrents?in=1&search=' + ywm, selector:"table.table-condensed.table-striped.table-bordered:last > tbody > tr:gt(0)"},
  527. {name: "BakaBT", link: 'https://bakabt.me/browse.php?q=' + ywm, selector:"table.torrents > tbody > tr:gt(0)", selector_need_login:"#loginForm"},
  528. {name: "BHD", link: 'https://beyond-hd.me/browse.php?incldead=0&search=' + imdb_id, selector:"table.tb_detail.grey.torrenttable:last > tbody > tr:gt(0)"},
  529. {name: "CC", link: 'http://www.cartoonchaos.org/index.php?page=torrents&options=0&active=1&search=' + ywm, selector:"table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(2) > td > table > tbody > tr:gt(0)"},
  530. {name: "HDF", link: 'https://hdf.world/torrents.php?searchstr=' + ywm, selector:"#torrent_table > tbody > tr:gt(0)"},
  531. {name: "HDME", link: 'http://hdme.eu/browse.php?incldead=1&blah=1&search=' + imdb_id, selector:"table:nth-child(13) > tbody > tr"},
  532. {name: "HDMonkey", link: 'https://hdmonkey.org/torrents-search.php?incldead=0&search=' + ywm, selector: "table.ttable_headinner > tbody > tr:gt(0)"},
  533. {name: "HDS", link: 'https://hd-space.org/index.php?page=torrents&active=1&options=2&search=' + imdb_id, selector: "table.lista:last > tbody > tr:gt(0)"},
  534. {name: "HDT", link: 'https://hd-torrents.org/torrents.php?active=1&options=2&search=' + imdb_id, selector: "table.mainblockcontenttt b"},
  535. //{name: "ILC", link: 'http://www.iloveclassics.com/browse.php?searchin=2&search=' + imdb_id, selector: "#hover-over > tbody > tr.table_col1:gt(0)"},
  536. {name: "IPT", link: 'https://iptorrents.com/t?qf=all&q=' + imdb_id, selector: "#torrents td.ac"},
  537. {name: "JPOP", link: 'https://jpopsuki.eu/torrents.php?searchstr=' + eng_title, selector: "#torrent_table > tbody > tr:gt(0)"},
  538. {name: "NetHD", link: 'http://nethd.org/torrents.php?incldead=1&search_area=4&search=' + imdb_id, selector: "table.table.table-bordered.torrent > tbody > tr:gt(1)"},
  539. {name: "PHD", link: 'https://privatehd.to/torrents?in=1&search=' + ywm, selector: "table.table-condensed.table-striped.table-bordered:first > tbody > tr:gt(0)"},
  540. {name: "PTF", link: 'http://ptfiles.net/browse.php?incldead=0&title=0&search=' + ywm, selector: "#tortable > tbody > tr.rowhead:gt(0)"},
  541. {name: "Red", link: 'https://redacted.ch/torrents.php?searchstr=' + eng_title, selector: "#torrent_table > tbody > tr.group_torrent:gt(0)"},
  542. {name: "SC", link: 'https://secret-cinema.pw/torrents.php?cataloguenumber=' + imdb_id, selector: "div.torrent_card"},
  543. {name: "Speed", link: 'https://speed.cd/browse.php?d=on&search=' + imdb_id, selector: "div.boxContent > table:first >tbody > tr:gt(0)"},
  544. {name: "TD", link: 'https://www.torrentday.com/t?q=' + imdb_id, selector: "#torrentTable td.torrentNameInfo"},
  545. {name: "TS", link: 'https://www.torrentseeds.org/browse.php?searchin=title&incldead=0&search=%22' +eng_title +year + '%22', selector: "table.table.table-bordered > tbody > tr.browse_color:gt(0)"},
  546. {name: "TT", link: 'https://revolutiontt.me/browse.php?search=' + imdb_id, selector: "table#torrents-table > tbody > tr:gt(0)"},
  547. {name:"TL",type:"json",link:"https://www.torrentleech.org/torrents/browse/index/query/" + eng_title + year, ajax: "https://www.torrentleech.org/torrents/browse/list/query/" + eng_title + year, selector:"numFound > 0"},
  548. {name: "UHD",link: 'https://uhdbits.org/torrents.php?searchstr=' + imdb_id, selector: "table.torrent_table > tbody > tr.group"},
  549. {name: "Waffles", link: 'https://waffles.ch/browse.php?q=' + eng_title, selector: "#browsetable:last > tbody > tr:gt(0)"},
  550. {name: "WOP", link: 'http://worldofp2p.net/browse.php?incldead=0&searchin=descr&search=' + imdb_id, selector: "table.yenitorrenttable:last > tbody > tr:gt(0)"},
  551. ]
  552. });
  553. site_map.push({
  554. name: "NZB资源",
  555. label:[
  556. {name: "DOGnzb", link: 'https://dognzb.cr/search?q=' + ywm,selector: "#featurebox > table > tbody > tr > td > table > tbody > tr.odd:gt(0)"},
  557. {name: "LuluNZB", link: 'https://lulunzb.com/search/' + ywm, selector: "#browsetable > tbody > tr:gt(0)", selector_need_login:"div.login-box"},
  558. {name: "Miatrix",link: 'https://www.miatrix.com/search/' + ywm,selector: "#browsetable > tbody > tr:gt(0)"},
  559. {name: "NewzTown",link: 'https://newztown.co.za/search/' + ywm,selector: "#browsetable > tbody > tr:gt(0)"},
  560. {name: "NZBCat",link: 'https://nzb.cat/search/' + ywm,selector: "#browsetable > tbody > tr:gt(0)"},
  561. {name: "NZBgeek",link: 'https://nzbgeek.info/geekseek.php?moviesgeekseek=1&browsecategory=&browseincludewords=' + ywm,selector: "table > tbody > tr.HighlightTVRow2:gt(0)", selector_need_login:"input[value='do_login']"},
  562. {name: "NZBP", link: 'https://nzbplanet.net/search/' + ywm, selector: "#browsetable > tbody > tr:gt(0)"},
  563. {name: "Oznzb", link: 'https://www.oznzb.com/search/' + ywm, selector: "#browsetable > tbody > tr.ratingReportContainer:gt(0)", selector_need_login:"#login"},
  564. {name: "SNZB", link: 'https://simplynzbs.com/search/' + ywm, selector: "#browsetable > tbody > tr:gt(0)"},
  565. ]
  566. });
  567. }
  568. if (ptzimu.trim().length > 0) {
  569. site_map.push({
  570. name: "PT字幕",
  571. label:[
  572. {name:"BYRBT®", link: "https://bt.byr.cn/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table:last > tbody > tr:gt(1)"},
  573. {name:"CHDBits®", link: "https://chdbits.co/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table:last > tbody > tr:gt(1)"},
  574. {name:"CMCT®", link: "https://hdcmct.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table:last > tbody > tr:gt(1)"},
  575. {name:"FRDS®", link: "http://pt.keepfrds.com/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  576. {name:"HDChina®", link: "https://hdchina.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table.uploaded_sub_list > tbody > tr:gt(1)"},
  577. {name:"HDCity®", link: "https://hdcity.city/subtitles?notnewword=1&search=" + ptzimu, selector: "center > div:nth-child(1) > table > tbody > tr:nth-child(2)"},
  578. {name:"HDHome®", link: "https://hdhome.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table:last > tbody > tr:gt(1)"},
  579. {name:"HDSky®", link: "https://hdsky.me/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table:last > tbody > tr:gt(1)"},
  580. {name:"HDTime®", link: "https://hdtime.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='100%'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr"},
  581. {name:"HDU®", link: "http://pt.upxin.net/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  582. {name:"Hyperay®", link: "https://hyperay.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  583. {name:"JoyHD®", link: "https://www.joyhd.net/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  584. {name:"MTeam®", link: "https://tp.m-team.cc/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table.table-subtitle-list:last > tbody > tr"},
  585. {name:"NPUBITS®", link: "https://npupt.com/subtitles.php?notnewword=1&search=" + ptzimu, selector: "#main > table > tbody > tr:nth-child(2)"},
  586. {name:"NYPT®", link: "https://nanyangpt.com/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  587. {name:"OurBits®", link: "https://ourbits.club/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  588. {name:"SJTU®", link: "https://pt.sjtu.edu.cn/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  589. {name:"TCCF®", link: "https://et8.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  590. {name:"TLFBits®", link: "http://pt.eastgame.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  591. {name:"U2®", link: "https://u2.dmhy.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  592. {name:"WHUPT®", link: "https://pt.whu.edu.cn/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table.no-vertical-line:last > tbody > tr"},
  593. ]
  594. });
  595. }
  596. }
  597.  
  598. site_map.push({
  599. name: "中文字幕",
  600. label:[
  601. {name:'字幕库', link:'http://www.zimuku.cn/search?q=' + title,selector:'div.box.clearfix div.item.prel.clearfix'},
  602. {name:'字幕天堂',method:"post", link:'http://www.zmtiantang.com/e/search/',data:`keyboard=${title}&show=title&classid=1,3&tempid=1`,headers:{"Content-Type": "application/x-www-form-urlencoded"},rewrite_href:true,selector:'table.data > tbody > tr:nth-child(2)'},
  603. {name:'字幕组', link:'http://www.zimuzu.tv/search/index?type=subtitle&keyword=' + title,selector:".search-result li"},
  604. {name:'sub HD', link:'http://subhd.com/search/' + title,selector:"div.col-md-9 div.box"},
  605. {name:'伪射手', link:'http://assrt.net/sub/?searchword=' + title,selector:"div.body div.subitem"},
  606. {name:'163字幕', link:'http://www.163sub.com/Search?id=' + title,selector:"#main_narrow_bd div.subs_list"},
  607. {name:'电波字幕', link:'http://dbfansub.com/?s=' + title,selector:"div.panel-body article.panel.panel-default.archive"},
  608. {name:'字幕社', link:'https://www.zimushe.com/search.php?keywords=' + title,selector:"div.wrap-l li"},
  609. {name:'中文字幕网', link:'http://www.zimuzimu.com/so_zimu.php?title=' + title,selector:"table.sublist a.othersub"},
  610. {name:'r3sub', link:'https://r3sub.com/search.php?s=' + title,selector:"div.col-sm-8.col-md-9.col-lg-8 div.movie.movie--preview.ddd"},
  611. {name:'HDZIMU', link:'http://www.hdzimu.com/?s=' + title,selector:'div.post-warp div.post-box'},
  612. {name:'M1080', link:'http://zimu.m1080.com/search.asp?a=&s=' + title,selector:"table td"},
  613. {name:'OpenSub', link:'https://www.opensubtitles.org/zh/search/sublanguageid-chi,zht,zhe,eng/imdbid-' + imdb_id,selector:"#search_results tr.change"},
  614. ]
  615. });
  616.  
  617. if(!imdb_id.match(/9999999/)){
  618. site_map.push({
  619. name: "英文字幕",
  620. label:[
  621. {name:'Addic7ed', link:'http://www.addic7ed.com/search.php?search=' + eng_title_clean + year,selector:"table.tabel tr"},
  622. {name:'Podnapisi', link:'https://www.podnapisi.net/zh/subtitles/search/?language=zh&language=en&keywords=' + eng_title_clean + '&' + year + '-' + year,selector:"table tr.subtitle-entry"},
  623. {name:'Subscene', link:'https://subscene.com/subtitles/release?r=true&q=' + ywm,selector:"table td.a1"},
  624. {name:'TVsubs', link:'http://tvsubs.net/search.php?q=' + eng_title_clean,selector:"div.cont li"},
  625. {name:'TVsubtitles', link:'http://www.tvsubtitles.net/search.php?q=' + eng_title_clean,selector:"div.left_articles li"},
  626. {name:'YIFY', link:'http://www.yifysubtitles.com/search?q=' + eng_title_clean,selector:"div.col-sm-12 div.col-xs-12"},
  627. ]
  628. });
  629. }
  630.  
  631. site_map.push({
  632. name: "在线视频",
  633. label:[
  634. {name:'Neets', link:'http://neets.cc/search?key=' + title,selector:'#search_li_box div.search_li.clearfix'},
  635. {name:'爱奇艺视频', link:'https://so.iqiyi.com/so/q_' + title,selector:"div.mod_result a.info_play_btn"},
  636. {name:'次元壁', link:'http://www.ciyuan.bi/Search?keyword=' + title,selector:'div.search_left_container div.search_list_box_right'},
  637. {name:'哈哩哈哩', link:'http://www.halihali.cc/search/?wd=' + title,selector:'#contents div.info'},
  638. {name:'搜狐视频', link:'https://so.tv.sohu.com/mts?wd=' + title,selector:'div.wrap.cfix div.cfix.resource'},
  639. {name:'腾讯视频', link:'https://v.qq.com/x/search/?q=' + title,selector:'div.wrapper_main div._infos'},
  640. {name:'优酷视频', link:'http://www.soku.com/search_video/q_' + title,selector:'div.DIR div.s_info'},
  641. {name:'AAQQS', link:'http://aaxxy.com/vod-search-pg-1-wd-' + title + '.html',selector:'#find-focus li'},
  642. {name:'Q2电影网', link:'http://www.q2002.com/search?wd=' + title,selector:'div.container div.movie-item'},
  643. {name:'魔力电影网', link:'http://www.magbt.net/search.php?searchword=' + title,selector:'#content li.listfl'},
  644. {name:'小朱视频', link:'http://noad.zhuchaoli.club/search/' + title + '.html',selector:'div.b-listtab-main li.item'},
  645. {name:'9ANIME', link:'https://www4.9anime.is/search?keyword=' + eng_title,selector:"div.film-list a.name"},
  646. ]
  647. });
  648.  
  649. site_map.push({
  650. name: "电影资源",
  651. label:[
  652. {name:'52 Movie', link:'http://www.52movieba.com/search.htm?keyword=' + title,selector:'table.table.table-hover.threadlist tr.thread.tap'},
  653. {name:'97电影网', link:'http://www.id97.com/search?q=' + title,selector:'div.container div.col-xs-7'},
  654. {name:'爱下电影网', link:'http://www.aixia.cc/plus/search.php?searchtype=titlekeyword&q=' + title,selector:'div.con li'},
  655. {name:'比特大雄', link:'https://www.btdx8.com/?s=' + title,selector:'#content div.post.clearfix'},
  656. {name:'比特影视', link:'https://www.bteye.com/search/' + title,selector:'#main div.item'},
  657. {name:'电影巴士', link:'http://www.dy8c.com/?s=' + title,selector:'#content div.post-box'},
  658. {name:'电影首发站', link:'http://www.dysfz.cc/key/' + title + '/',selector:'.movie-list li'},
  659. {name:'电影天堂', method:"post", link:'https://www.dy2018.com/e/search/index.php',data:`show=title%2Csmalltext&tempid=1&keyboard=${gtitle}&Submit=%C1%A2%BC%B4%CB%D1%CB%F7`,headers:{"Content-Type": "application/x-www-form-urlencoded"},rewrite_href:true, selector:'div.co_content8 table'},
  660. {name:'嘎嘎影视', link:'http://www.gagays.xyz/movie/search?req%5Bkw%5D=' + title,selector:'#movie-sub-cont-db div.large-movie-detail'},
  661. {name:'高清MP4', link:'http://www.99tvs.com/?s=' + title,selector:'#post_container li'},
  662. {name:'高清电台', link:'https://gaoqing.fm/s.php?q=' + title,selector:'#result1 div.row'},
  663. {name:'高清控', link:'http://www.gaoqingkong.com/?s=' + title,selector:'#post_container div.post_hover'},
  664. {name:'户户盘', method:"post", link:'http://huhupan.com/e/search/index.php',data:`keyboard=${title}&show=title&tempid=1&tbname=news&mid=1&depost=search`,headers:{"Content-Type": "application/x-www-form-urlencoded"},rewrite_href:true, selector:'div.main h2'},
  665. {name:'蓝光网', link:'http://www.languang.co/?s=' + title,selector:'div.mi_cont li'},
  666. {name:'迷你MP4', link:'http://www.minimp4.com/search?q=' + title,selector:'div.container div.col-xs-7'},
  667. {name:'胖鸟电影', link:'http://www.pniao.com/Mov/so/' + title,selector:'div.mainContainer div.movieFlag.eachOne'},
  668. {name:'人生05', link:'http://www.rs05.com/search.php?s=' + title,selector:'#movielist li'},
  669. {name:'云播网', link:'http://www.yunbowang.cn/index.php?m=vod-search&wd=' + title,selector:'div.container div.col-xs-7'},
  670. {name:'中国高清网', link:'http://gaoqing.la/?s=' + title,selector:'div.mainleft div.post_hover'},
  671. {name:'最新影视站', link:'http://www.zxysz.com/?s=' + title,selector:'#content li.p-item'},
  672. ]
  673. });
  674.  
  675. site_map.push({
  676. name: "动漫内站",
  677. label:[
  678. {name:'ACG.RIP', link:'https://acg.rip/?term=' + title,selector:'tbody tr'},
  679. {name:'ACG狗狗', link:'http://bt.acg.gg/search.php?keyword=' + title,selector:'tbody p.original.download'},
  680. {name:'ACG搜', link:'http://www.acgsou.com/search.php?keyword=' + title,selector:'tbody span.bts_1'},
  681. {name:'动漫花园', link:'https://share.dmhy.org/topics/list?keyword=' + title,selector:'tbody span.btl_1'},
  682. {name:'爱恋动漫', link:'http://www.kisssub.org/search.php?keyword=' + title,selector:'tbody span.bts_1'},
  683. {name:'喵搜', link:'https://nyaso.com/dong/' + title +'.html',selector:'tbody a.down'},
  684. {name:'旋风动漫', link:'http://share.xfsub.com:88/search.php?keyword=' + title,selector:'#listTable span.bts_1'},
  685. {name:'怡萱动漫', link:'http://www.yxdm.tv/search.html?title=' + title,selector:'div.main p.stars1'},
  686. ]
  687. });
  688.  
  689. if(!imdb_id.match(/9999999/)){
  690. site_map.push({
  691. name: "动漫外站",
  692. label:[
  693. {name:'AniDex', link:'https://anidex.info/?q=' + eng_title,selector:'div.table-responsive tr'},
  694. {name:'AniRena', link:'https://www.anirena.com/?s=' + eng_title,selector:'#content table'},
  695. {name:'AniTosho', link:'https://animetosho.org/search?q=' + eng_title,selector:'#content div.home_list_entry'},
  696. {name:'Nyaa', link:'https://nyaa.si/?q=' + eng_title,selector:'div.table-responsive tr.default'},
  697. {name:'ニャパンツ', link:'https://nyaa.pantsu.cat/search?c=_&q=' + eng_title,selector:'#torrentListResults tr.torrent-info'},
  698. {name:'东京図书馆', link:'https://www.tokyotosho.info/search.php?terms=' + eng_title,selector:'table.listing td.desc-top'},
  699. ]
  700. });
  701. }
  702.  
  703. site_map.push({
  704. name: "美剧资源",
  705. label:[
  706. {name:'人人影视', link:'http://www.zimuzu.tv/search?type=resource&keyword=' + title,selector:"div.search-result > ul > li"},
  707. {name:'人人美剧', link:'http://www.yyetss.com/Search/index/s_keys/' + title,selector:'div.row div.col-xs-3'},
  708. {name:'天天美剧', link:'http://www.ttmeiju.vip/index.php/search/index.html?keyword=' + title,selector:'table.latesttable tr.Scontent1'},
  709. {name:'爱美剧', link:'https://22v.net/search/' + title,selector:'div.movie span'},
  710. {name:'天天看美剧', link:'http://www.msj1.com/?s=' + title,selector:'div.cat_list div.art_show_top'},
  711. {name:'美剧粉', link:'http://www.itvfans.com/?s=' + title,selector:'#main-wrap-left div.home-blog-entry-text'},
  712. ]
  713. });
  714.  
  715. site_map.push({
  716. name: "BT内站",
  717. label:[
  718. {name:'BT吧', link:'http://www.btba.com.cn/search?keyword=' + title,selector:'div.left li'},
  719. {name:'BT蚂蚁', link:'https://www.btmyi.com/search.html?kw=' + title,selector:"div.row h5.item-title"},
  720. {name:'BT天堂', link:'http://www.bttt.la/s.php?q=' + title,selector:'div.ml div.title'},
  721. {name:'BT之家', link:'http://www.btbtt.co/search-index-keyword-' + title + '.htm',selector:'#threadlist table'},
  722. {name:'RARBT', link:'http://www.rarbt.com/index.php/search/index.html?search=' + title,selector:'div.ml div.title'},
  723. {name:'查片源', link:'https://www.chapianyuan.com/?keyword=' + title,selector:'div.block li'},
  724. {name:'磁力猫', link:'http://www.cilimao.me/search?word=' + title,selector:'#Search__content_left___2MajJ div.MovieCard__content___3kv1W'}, // TODO check
  725. {name:'磁力站', link:'http://oabt004.com/index/index?c=&k=' + title,selector:'div.link-list-wrapper ul.link-list'},
  726. {name:'光影资源', link:'http://www.etdown.net/index.php?keyword=' + title,selector:'tbody.list_4 tr'},
  727. {name:'我爱P2P', link:'http://www.woaip2p.net/topic/list?categoryId=0&title=' + title,selector:'tbody td.word-break'},
  728. {name:'小浣熊下载', link:'https://www.xiaohx.org/search?key=' + title,selector:'div.search_right li'},
  729. {name:'一站搜', link:'http://v.yizhansou.com/search?kw=' + title,selector:'table td.st'},
  730. ]
  731. });
  732.  
  733. if(!imdb_id.match(/9999999/)){
  734. site_map.push({
  735. name: "BT外站",
  736. label:[
  737. {name:'1337X', link:'https://1337x.to/search/' + ywm + '/1/',selector:'table.table-list.table.table-responsive.table-striped td.coll-1.name'},
  738. {name:'BT-Scene', link:'https://bt-scene.cc/results_.php?q=' + ywm,selector:'table.tor td.tname'},
  739. {name:'iDope', link:'https://idope.se/torrent-list/' + ywm,selector:'#div2child div.resultdiv'},
  740. {name:'ISOHunt', link:'https://isohunt2.net/torrent/?ihq=' + ywm,selector:'#serps td.title-row'},
  741. {name:'KickAss', link:'https://katcr.co/katsearch/page/1/' + ywm,selector:'div.table--responsive_vertical div.torrents_table__torrent_name'},
  742. {name:'Lime', link:'https://www.limetorrents.cc/search/all/' + ywm,selector:'table.table2 div.tt-name'},
  743. {name:'RARBG', link:'http://rarbg.is/torrents.php?search=' + imdb_id,selector:'table.lista2t tr.lista2'},
  744. {name:'TorLock', link:'https://www.torlock2.com/all/torrents/' + ywm.replace(/ /g,"-") +'.html',selector:'table.table.table-striped.table-bordered.table-hover.table-condensed td.td'},
  745. {name:'WorldWide', link:'https://worldwidetorrents.me/torrents-search.php?search=' + ywm,selector:'div.w3-responsive td.w3-jose'},
  746. {name:'Zooqle', link:'https://zooqle.com/search?q=' + ywm,selector:'div.panel-body a.small'},
  747. {name:'海盗湾', link:'https://thepiratebay.org/search/' + ywm,selector:'#searchResult div.detName'},
  748. ]
  749. });
  750. }
  751.  
  752. function Exist_check(label) {
  753. let site = label.name;
  754. let psite = $(`a[data-name="${site}"]`);
  755.  
  756. function TagExist(link){
  757. $(psite).css("background-color", GM_getValue("tag_bcolor_exist","#e3f1ed"));
  758. $(psite).css("color", GM_getValue("tag_fcolor_exist","#3377aa"));
  759. $(psite).attr("title","资源存在");
  760. let storage_data = true;
  761. if (label.rewrite_href && label.rewrite_href === true) { // 重写链接
  762. storage_data = GM_getCacheValue(`${douban_id}_${site}`, link || $(psite).attr("href"),false);
  763. $(psite).attr("href",storage_data);
  764. }
  765. GM_setCacheValue(`${douban_id}_${site}`,storage_data,86400 * 7 * 1e3,false);
  766. }
  767.  
  768. function TagNotExist() {
  769. $(psite).css("background-color", GM_getValue("tag_bcolor_not_exist","#f4eac2"));
  770. $(psite).css("color", GM_getValue("tag_fcolor_not_exist","#3377aa"));
  771. $(psite).attr("title","资源不存在");
  772. }
  773.  
  774. function TagNeedLogin() {
  775. $(psite).css("background-color", GM_getValue("tag_bcolor_need_login",""));
  776. $(psite).css("color", GM_getValue("tag_fcolor_need_login","#3377aa"));
  777. GM_setCacheValue(`need_login_${site}`,true, 86400 * 1e3);
  778. $(psite).click(function () {
  779. GM_deletedCacheValue(`need_login_${site}`);
  780. });
  781. $(psite).attr("title","站点需要登陆");
  782. }
  783.  
  784. function TagError() {
  785. $(psite).css("background-color", GM_getValue("tag_bcolor_error",""));
  786. $(psite).css("color", GM_getValue("tag_fcolor_error","#3377aa"));
  787. $(psite).attr("title", "遇到问题");
  788. }
  789.  
  790.  
  791. // 这里假定有这个资源的就一直都有,直接使用第一次请求成功的时候缓存信息
  792. if (GM_getCacheValue(`${douban_id}_${site}`, false)) {
  793. TagExist();
  794. return;
  795. }
  796.  
  797. // 如果前次检查到这个站点需要登陆
  798. if (GM_getCacheValue(`need_login_${site}`, false)) {
  799. TagNeedLogin();
  800. return;
  801. }
  802.  
  803. // 不然,则请求相关信息
  804. $(psite).attr("title", "正在请求信息中");
  805. GM_xmlhttpRequest({
  806. method: label.method || "GET",
  807. url: label.ajax || label.link,
  808. data: label.data,
  809. headers: label.headers,
  810. onload: function (res) {
  811. if (/login|verify|checkpoint|returnto/ig.test(res.finalUrl)) {
  812. TagNeedLogin(); // 检查最终的URL看是不是需要登陆
  813. } else if (/refresh: \d+; url=.+login.+/ig.test(res.responseHeaders)){
  814. TagNeedLogin(); // 检查responseHeader有没有重定向
  815. } else {
  816. let responseText = res.responseText;
  817. // if (label.name==="AT") {console.log(label.name);console.log(res.finalUrl);console.log(res.responseHeaders);console.log(res.responseText);}
  818. if (typeof responseText === "undefined") {
  819. TagNeedLogin(); // 检查最终的Text,如果什么都没有也可能说明需要登陆
  820. } else if (responseText.length <800 && /login/.test(responseText)) {
  821. TagNeedLogin(); // 对Text进行检查,断言“过短,且中间出现login字段”即说明可能需要登陆
  822. } else { // 开始解析返回信息
  823. try {
  824. TagNotExist(); // 先断言不存在
  825. if (label.type && label.type === "json") { // 如果前面定义了返回类型是 "json"
  826. let par = JSON.parse(responseText);
  827. if (eval("par." + label.selector)) {
  828. TagExist();
  829. }
  830. } else { // 否则默认label.type的默认值为 html
  831. let doc = (new DOMParser()).parseFromString(res.responseText, 'text/html');
  832. let body = doc.querySelector("body");
  833. // 因为jQuery的选择器丰富,故这里不用 dom.querySelector() 而用 jQuery.find()
  834. if (label.selector_need_login && $(body).find(label.selector_need_login).length){
  835. TagNeedLogin(); // 如果存在selector_need_login选择器,则先判断是否存在以确定是否需要登录
  836. } else if ($(body).find(label.selector || "table.torrents:last > tbody > tr:gt(0)").length) {
  837. TagExist(res.finalUrl); // 最后使用selector选择器判断资源是否存在
  838. }
  839. }
  840. } catch (e) {
  841. TagError();
  842. }
  843. }
  844. }
  845. },
  846. onerror: function () {
  847. TagError();
  848. }
  849. });
  850. }
  851.  
  852. function site_exist_status() {
  853. for (let i = 0; i < site_map.length; i++) {
  854. let map_dic = site_map[i];
  855. if (GM_getCacheValue("delete_site_" + map_dic.name,false)) {
  856. continue;
  857. }
  858. $('#content div.tags').before(`<div class="c-aside name-offline" data-id="${i}"><h2><i>${map_dic.name}</i>· · · · · ·</h2><div class=c-aside-body style="padding: 0 12px;"> <ul class=bs > </ul> </div> </div>`);
  859.  
  860. let in_site_html = $(`div[data-id='${i}'] ul.bs`);
  861. for (let j = 0; j < map_dic.label.length; j++) {
  862. let label = map_dic.label[j];
  863. if (GM_getCacheValue("delete_site_" + label.name,false)) {
  864. continue;
  865. }
  866. in_site_html.append(`<a href="${label.link}" data-name="${label.name}" target="_blank" rel="nofollow" class="name-offline">${label.name}</a>`);
  867. Exist_check(label)
  868. }
  869. }
  870. }
  871. site_exist_status();
  872. });
  873.  
  874. }
  875.  
  876. else if (location.href.startwith('https://music.douban.com/subject/')) {
  877. // 定义基础方法
  878. function getDoc(url, meta, callback) {
  879. GM_xmlhttpRequest({
  880. method: 'GET',
  881. url: url,
  882. headers: {
  883. 'User-agent': window.navigator.userAgent,
  884. 'Content-type': null
  885. },
  886. onload: function (responseDetail) {
  887. if (responseDetail.status === 200) {
  888. let doc = (new DOMParser).parseFromString(responseDetail.responseText, 'text/html');
  889. callback(doc, responseDetail, meta);
  890. }
  891. }
  892. });
  893. }
  894. function getJSON(url, callback) {
  895. GM_xmlhttpRequest({
  896. method: 'GET',
  897. url: url,
  898. headers: {
  899. 'Accept': 'application/json'
  900. },
  901. onload: function (response) {
  902. if (response.status >= 200 && response.status < 400) {
  903. callback(JSON.parse(response.responseText), url);
  904. } else {
  905. callback(false, url);
  906. }
  907. }
  908. });
  909. }
  910.  
  911. let cache_prefix = "cache_";
  912.  
  913. function GM_deletedCacheValue(name) {
  914. GM_deleteValue(name);
  915. GM_deleteValue(cache_prefix + name);
  916. }
  917.  
  918. function GM_setCacheValue (name,value,expire,json_parser) {
  919. GM_setValue(name,json_parser ? JSON.stringify(value) : value);
  920. GM_setValue(cache_prefix + name,json_parser ? JSON.stringify(Date.now() + expire) : (Date.now() + expire));
  921. }
  922.  
  923. function GM_getCacheValue (name,defaultValue,json_parser) {
  924. let expire_timestamp = parseInt(GM_getValue(cache_prefix + name));
  925. if (expire_timestamp < Date.now()) {
  926. GM_deletedCacheValue(name);
  927. }
  928.  
  929. return json_parser ? JSON.parse(GM_getValue(name,defaultValue)): GM_getValue(name,defaultValue);
  930. }
  931.  
  932. function GM_clearExpiredCacheValue(force) {
  933. let cache_key = GM_listValues().filter(function (key) {
  934. return key.includes(cache_prefix)
  935. });
  936. for (let i=0;i< cache_key.length;i++) {
  937. let name = cache_key[i].slice(cache_prefix.length);
  938. let expired_timestamp = GM_getValue(cache_prefix + name);
  939. if(force || expired_timestamp < Date.now()) {
  940. GM_deletedCacheValue(name);
  941. }
  942. }
  943. }
  944.  
  945. GM_clearExpiredCacheValue(false);
  946.  
  947. let _version = GM_getValue("version","完整版");
  948.  
  949. if (typeof GM_registerMenuCommand !== "undefined") {
  950.  
  951. function changeVersionConfirm() {
  952. if (confirm(`你当前版本是 ${_version},是否进行切换?`)) {
  953. GM_setValue("version",_version === "完整版" ? "轻量版" : "完整版");
  954. }
  955. }
  956. GM_registerMenuCommand("脚本功能切换",changeVersionConfirm);
  957.  
  958. function deleteSitePrompt() {
  959. let delete_site_prefix = "delete_site_";
  960. let name=prompt("请输入你不想看到的站点名称,请注意,除非重装脚本,否则该操作不可撤销","");
  961. if (name!=null && name!=="") {
  962. if (GM_getValue(delete_site_prefix + name,false)) {
  963. GM_deleteValue(delete_site_prefix + name);
  964. } else { // 二次输入恢复
  965. GM_setValue(delete_site_prefix + name,true);
  966. }
  967. }
  968. }
  969. GM_registerMenuCommand("删除不想显示的站",deleteSitePrompt);
  970.  
  971. function changeTagBColor() {
  972. let now_bcolor_list = [GM_getValue("tag_bcolor_exist","#e3f1ed"),GM_getValue("tag_bcolor_not_exist","#f4eac2"),GM_getValue("tag_bcolor_need_login",""),GM_getValue("tag_bcolor_error","")];
  973. let name = prompt("请依次输入代表'资源存在','资源不存在','站点需要登陆','站点解析错误'颜色的Hex值,并用英文逗号分割。当前值为:" , `${now_bcolor_list.join(',')}`);
  974. if (name!=null && name!=="") {
  975. try {
  976. let bcolor_list = name.split(",");
  977. GM_setValue("tag_bcolor_exist",bcolor_list[0] || "#e3f1ed");
  978. GM_setValue("tag_bcolor_not_exist",bcolor_list[1] || "#f4eac2");
  979. GM_setValue("tag_bcolor_need_login",bcolor_list[2] || "");
  980. GM_setValue("tag_bcolor_error",bcolor_list[3] || "");
  981. } catch (e) {
  982. alert("解析输入出错");
  983. }
  984. }
  985. }
  986. GM_registerMenuCommand("更改标签背景色",changeTagBColor);
  987.  
  988. function changeTagFColor() {
  989. let now_fcolor_list = [GM_getValue("tag_fcolor_exist","#3377aa"),GM_getValue("tag_fcolor_not_exist","#3377aa"),GM_getValue("tag_fcolor_need_login","#3377aa"),GM_getValue("tag_fcolor_error","#3377aa")];
  990. let name = prompt("请依次输入代表'资源存在','资源不存在','站点需要登陆','站点解析错误'颜色的Hex值,并用英文逗号分割。当前值为:" , `${now_fcolor_list.join(',')}`);
  991. if (name!=null && name!=="") {
  992. try {
  993. let fcolor_list = name.split(",");
  994. GM_setValue("tag_fcolor_exist",fcolor_list[0] || "#3377aa");
  995. GM_setValue("tag_fcolor_not_exist",fcolor_list[1] || "#3377aa");
  996. GM_setValue("tag_fcolor_need_login",fcolor_list[2] || "#3377aa");
  997. GM_setValue("tag_fcolor_error",fcolor_list[3] || "#3377aa");
  998. } catch (e) {
  999. alert("解析输入出错");
  1000. }
  1001. }
  1002. }
  1003. GM_registerMenuCommand("更改标签文字色",changeTagFColor);
  1004.  
  1005. function forceCacheClear() {
  1006. if (confirm("清空所有缓存信息(包括资源存在情况、登陆情况、imdb250等)")) {
  1007. GM_clearExpiredCacheValue(true);
  1008. }
  1009. }
  1010. GM_registerMenuCommand("清空脚本缓存",forceCacheClear);
  1011.  
  1012. }
  1013.  
  1014.  
  1015. $(document).ready(function () {
  1016. // 脚本对页面进行预处理
  1017. if($('#info span.pl:contains("又名")').length === 0){
  1018. $('#info').append('<div style="display: none"><span class="pl">又名:</span>啥也没有<br></div>');
  1019. }
  1020.  
  1021. if($('div#info a[href^=\'http://www.imdb.com/title/tt\']').length === 0){
  1022. $('#info').append('<div style="display: none"><span class="pl">IMDb链接:</span><a href="http://www.imdb.com/title/tt9999999" target="_blank" rel="nofollow">tt9999999</a><br></div>');
  1023. }
  1024.  
  1025. if ($('#mainpic p.gact').length === 0) {
  1026. $("#mainpic").append("<p class=\"gact\"></p>")
  1027. }
  1028.  
  1029. let interest_sectl_selector = $('#interest_sectl');
  1030. interest_sectl_selector.after($('div.grid-16-8 div.related-info'));
  1031. interest_sectl_selector.attr('style', 'float:right');
  1032. $('div.related-info').attr('style', 'width:480px;float:left');
  1033.  
  1034. $("div#info").append("<span class=\"pl\">生成信息: </span><a id='movieinfogen' href='javascript:void(0);'>movieinfo</a>");
  1035. let movieinfo_html = $("<div class='c-aside' style='float:left;margin-top:20px;width: 470px;display: none' id='movieinfo_div'><h2><i>电影简介</i>· · · · · · </h2><a href='javascript:void(0);' id='copy_movieinfo'>点击复制</a><div class=\"c-aside-body\" style=\"padding: 0 12px;\" id='movieinfo'></div></div>");
  1036. if ($("#movieinfo").length === 0) {
  1037. $("div.related-info").before(movieinfo_html);
  1038. $("a#copy_movieinfo").click(function() {
  1039. let movieinfo_html = $("#movieinfo").html();
  1040. let movieclip = movieinfo_html.replace(/<br>/ig,"\n")
  1041. .replace(/<a [^>]*>/g,"").replace(/<\/a>/g,"");
  1042. GM_setClipboard(movieclip);
  1043. $(this).text("复制成功");
  1044. })
  1045. }
  1046.  
  1047. // 查看原图
  1048. let posterAnchor = document.querySelector('#mainpic > a > img');
  1049. if (posterAnchor) {
  1050. let postersUrl = posterAnchor.getAttribute("src");
  1051. let rawUrl = postersUrl.replace(/photo\/s_ratio_poster\/public\/(p\d+).+$/,"photo/raw/public/$1.jpg");
  1052. $('#mainpic p.gact').after(`<a target="_blank" rel="nofollow" href="${rawUrl}">查看原图</a>`);
  1053. }
  1054.  
  1055. // Movieinfo信息生成相关
  1056. let poster;
  1057. let this_title, trans_title, aka;
  1058. let year, region, genre,language,playdate;
  1059. let imdb_link, imdb_id, imdb_average_rating, imdb_votes, imdb_rating;
  1060. let douban_link, douban_id, douban_average_rating, douban_votes, douban_rating;
  1061. let episodes, duration;
  1062. let director, writer, cast;
  1063. let tags,introduction,awards;
  1064.  
  1065. function descriptionGenerator() {
  1066. let descr = "";
  1067. descr += poster ? `[img]${poster}[/img]\n\n` : "";
  1068. descr += (trans_title && !trans_title.match(/啥也没有/)) ? `◎译  名 ${trans_title}\n` : "";
  1069. descr += this_title ? `◎片  名 ${this_title}\n` : "";
  1070. descr += year ? `◎年  代 ${year.trim()}\n` : "";
  1071. descr += region ? `◎产  地 ${region}\n` : "";
  1072. descr += genre ? `◎类  别 ${genre}\n` : "";
  1073. descr += language ? `◎语  言 ${language}\n` : "";
  1074. descr += playdate ? `◎上映日期 ${playdate}\n` : "";
  1075. descr += imdb_rating ? `◎IMDb评分 ${imdb_rating}\n` : ""; // 注意如果长时间没能请求完成imdb信息,则该条不显示
  1076. descr += (imdb_link && !imdb_link.match(/9999999/)) ? `◎IMDb链接 ${imdb_link}\n` : "";
  1077. descr += douban_rating ? `◎豆瓣评分 ${douban_rating}\n` : "";
  1078. descr += douban_link ? `◎豆瓣链接 ${douban_link}\n` : "";
  1079. descr += episodes ? `◎集  数 ${episodes}\n` : "";
  1080. descr += duration ? `◎片  长 ${duration}\n` : "";
  1081. descr += director ? `◎导  演 ${director}\n` : "";
  1082. descr += writer ? `◎编  剧 ${writer}\n` : "";
  1083. descr += cast ? `◎主  演 ${cast.replace(/\n/g, '\n' + ' '.repeat(4) + '  ').trim()}\n` : "";
  1084. descr += tags ? `\n◎标  签 ${tags}\n` : "";
  1085. descr += introduction ? `\n◎简  介\n\n  ${introduction.replace(/\n/g, '\n' + ' '.repeat(2))}\n` : "";
  1086. descr += awards ? `\n◎获奖情况\n\n  ${awards.replace(/\n/g, '\n' + ' '.repeat(2))}\n` : "";
  1087. movieinfo_html.find("div#movieinfo").html(descr.replace(/\n/ig,"<br>"));
  1088. }
  1089. $("a#movieinfogen").click(function() {
  1090. descriptionGenerator();
  1091. $("#movieinfo_div").toggle();
  1092. });
  1093.  
  1094. let fetch = function (anchor) {
  1095. return anchor[0].nextSibling.nodeValue.trim();
  1096. };
  1097.  
  1098. // 从页面中解析信息并请求imdb等第三方数据
  1099. let chinese_title = document.title.replace('(豆瓣)','').trim();
  1100. let foreign_title = $('#content h1>span[property="v:itemreviewed"]').text().replace(chinese_title, '').trim();
  1101. let aka_anchor = $('#info span.pl:contains("又名")');
  1102. if (aka_anchor[0]) {
  1103. aka = fetch(aka_anchor).split(' / ').sort(function (a, b) {//首字(母)排序
  1104. return a.localeCompare(b);
  1105. }).join('/');
  1106. }
  1107. if (foreign_title) {
  1108. trans_title = chinese_title + (aka ? ('/' + aka) : '');
  1109. this_title = foreign_title;
  1110. } else {
  1111. trans_title = aka ? aka : '';
  1112. this_title = chinese_title;
  1113. }
  1114. year = ' ' + $('#content > h1 > span.year').text().substr(1, 4);
  1115.  
  1116. let regions_anchor = $('#info span.pl:contains("制片国家/地区")'); //产地
  1117. if (regions_anchor[0]) {
  1118. region = fetch(regions_anchor).split(' / ').join('/');
  1119. }
  1120.  
  1121. genre = $('#info span[property="v:genre"]').map(function () { //类别
  1122. return $(this).text().trim();
  1123. }).toArray().join('/');
  1124.  
  1125. let language_anchor = $('#info span.pl:contains("语言")'); //语言
  1126. if (language_anchor[0]) {
  1127. language = fetch(language_anchor).split(' / ').join('/');
  1128. }
  1129.  
  1130. playdate = $('#info span[property="v:initialReleaseDate"]').map(function () { //上映日期
  1131. return $(this).text().trim();
  1132. }).toArray().sort(function (a, b) {//按上映日期升序排列
  1133. return new Date(a) - new Date(b);
  1134. }).join('/');
  1135.  
  1136.  
  1137. $("#loading_more_rate").hide();
  1138. });
  1139. }
  1140.  
  1141. douban_link = 'https://' + location.href.match(/movie.douban.com\/subject\/\d+\//); //豆瓣链接
  1142. douban_id = location.href.match(/(\d{7,8})/g);
  1143. //集数
  1144. let episodes_anchor = $('#info span.pl:contains("集数")');
  1145. if (episodes_anchor[0]) {
  1146. episodes = fetch(episodes_anchor);
  1147. }
  1148. //片长
  1149. let duration_anchor = $('#info span.pl:contains("单集片长")');
  1150. if (duration_anchor[0]) {
  1151. duration = fetch(duration_anchor);
  1152. } else {
  1153. duration = $('#info span[property="v:runtime"]').text().trim();
  1154. }
  1155.  
  1156. getDoc(douban_link + 'awards/',null,function (doc) {
  1157. awards = $('#content>div>div.article',doc).html()
  1158. .replace(/[ \n]/g, '')
  1159. .replace(/<\/li><li>/g, '</li> <li>')
  1160. .replace(/<\/a><span/g, '</a> <span')
  1161. .replace(/<(div|ul)[^>]*>/g, '\n')
  1162. .replace(/<[^>]+>/g, '')
  1163. .replace(/&nbsp;/g, ' ')
  1164. .replace(/ +\n/g, '\n')
  1165. .trim();
  1166. }); // 该影片的评奖信息
  1167. getJSON('https://api.douban.com/v2/movie/' + douban_id,function (data1) {
  1168. douban_average_rating = data1.rating.average || 0;
  1169. douban_votes = data1.rating.numRaters.toLocaleString() || 0;
  1170. douban_rating = douban_average_rating + '/10 from ' + douban_votes + ' users';
  1171. introduction = data1.summary.replace(/^None$/g, '暂无相关剧情介绍');
  1172. poster = data1.image.replace(/s(_ratio_poster|pic)/g, 'l');
  1173. director = data1.attrs.director ? data1.attrs.director.join(' / ') : '';
  1174. writer = data1.attrs.writer ? data1.attrs.writer.join(' / ') : '';
  1175. cast = data1.attrs.cast ? data1.attrs.cast.join('\n') : '';
  1176. tags = data1.tags.map(function (member) {
  1177. return member.name;
  1178. }).join(' | ');
  1179. }); //豆瓣评分,简介,海报,导演,编剧,演员,标签
  1180.  
  1181. // 获取电影英文名
  1182. let eng_title = [this_title, trans_title].join("/").split("/").filter(function (arr) {
  1183. return /([a-zA-Z]){2,}/.test(arr);
  1184. })[0] || "";
  1185.  
  1186. // 剧集修正季数名
  1187. eng_title = eng_title.match(/Season\s\d\d/) ? eng_title.replace(/Season\s/, "S") : eng_title.replace(/Season\s/, "S0");
  1188. eng_title = eng_title.replace(/[:,!\-]/g, "").replace(/ [^a-z0-9]+$/,"");
  1189. let eng_title_clean = eng_title.replace(/ S\d\d*$/, "");
  1190.  
  1191. // 电影+年份 (只有电影才搜索并赋值年份)
  1192. let is_movie = $('a.bn-sharing').attr('data-type').match(/电影/);
  1193. let encode_year = is_movie ? year.replace(/ /,"_") : "";
  1194. let nian = is_movie ? year : "";
  1195. let encode_eng_title = (eng_title || "").replace(/ /g,"_");
  1196. let ptzimu = encode_eng_title + encode_year;
  1197. chinese_title = chinese_title.replace(/[:,]/," ");
  1198. let gtitle = encodeToGb2312(chinese_title,true);
  1199. let ywm = eng_title + nian;
  1200. let zwm = chinese_title + nian;
  1201.  
  1202. // get Chinese title
  1203. let title = encodeURI($('#content > h1 > span')[0].textContent.split(' ').shift().replace(/[:,]/," "));
  1204.  
  1205. let site_map = [];
  1206.  
  1207. /** label对象键值说明:
  1208. * name: String 站点名称,请注意该站点名称在不同的site_map中也应该唯一,以免脚本后续判断出错
  1209. * method: String 搜索请求方式,默认值为 "GET"
  1210. * link: String 构造好的请求页面链接,作为label的href属性填入,用户应该能直接点开这个页面。
  1211. * ajax: String 如果站点使用ajax的形式加载页面,则需要传入该值作为实际请求的链接,即优先级比link更高。
  1212. * type: String 返回结果类型,脚本默认按html页面解析;只有当传入值为"json"时,脚本按JSON格式解析
  1213. * selector: String 搜索成功判断结果,默认值为 "table.torrents:last > tbody > tr:gt(0)" (适用于国内多数NexusPHP构架的站点)
  1214. * 如果type为"page"(默认)时,为一个(jQuery)CSS选择器,
  1215. * 如果type为"json"时,为一个具体的判断式。
  1216. * selector_need_login 搜索需要登录的选择器,仅在type为默认时有用,其余用法同Selector一致。
  1217. * selector_not_exit 搜索资源不存在的选择器,仅在type为默认时有用,其余用法同Selector一致。
  1218. * data: String 作为请求的主体发送的内容,默认为空即可
  1219. * headers: Object 修改默认请求头,(防止某些站点有referrer等请求头检查
  1220. * rewrite_href: Boolean 如果站点最终搜索显示的页面与实际使用搜索页面(特别是使用post进行交互的站点)不一致,
  1221. * 设置为true能让脚本存储最终url,并改写label使用的href属性
  1222. *
  1223. * 注意: 1. 如果某键有默认值,则传入值均会覆盖默认值
  1224. * 2. 关于请求方法请参考:https://github.com/scriptish/scriptish/wiki/GM_xmlhttpRequest
  1225. * */
  1226.  
  1227. if (_version === "完整版") {
  1228. let neizhan = imdb_id.match(/9999999/) ? ('/subject/' + douban_id) : imdb_id; // PT内站 智能判定是用IMDB ID还是豆瓣ID
  1229. let npid = imdb_id.match(/9999999/) ? ('douban=' + douban_id) : ('imdb=' + imdb_id); // NPUBITS 智能判定是用IMDB ID还是豆瓣ID
  1230. let ttgid = imdb_id.match(/9999999/) ? (zwm) : ( 'IMDB' + imdb_id.slice(2)); // TTG 智能判定是用IMDB ID还是中文名
  1231. let zxid = imdb_id.match(/9999999/) ? (zwm) : imdb_id; // ZX 智能判定是用IMDB ID还是中文名
  1232.  
  1233. site_map.push({
  1234. name: "PT内站",
  1235. label: [
  1236. {name: "BTSchool", link: 'http://pt.btschool.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,/* selector: "table.torrents:last > tbody > tr:gt(0)"}, */},
  1237. {name: "BYRBT", link: 'https://bt.byr.cn/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1238. {name: "CCFBits", link: 'http://www.ccfbits.org/browse.php?fullsearch=1&notnewword=1&search=' + neizhan, selector: "table.mainouter > tbody > tr:last > td > table:nth-child(10) > tbody > tr:gt(0)"},
  1239. {name: "CHDBits", link: 'https://chdbits.co/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1240. {name: "CMCT", link: 'https://hdcmct.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1241. {name: "GZTown", link: 'https://pt.gztown.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1242. {name: "FRDS", link: 'http://pt.keepfrds.com/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1243. {name: "HDChina", link: 'https://hdchina.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrent_list:last > tbody > tr:gt(0)"},
  1244. {name: "HDCity", link: 'https://hdcity.city/pt?incldead=1&search_area=1&notnewword=1&iwannaseethis=' + neizhan, selector: "center > div > div > div.text"},
  1245. {name: "HDHome", link: 'https://hdhome.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1246. {name: "HDSky", link: 'https://hdsky.me/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1247. {name: "HDStreet", link: 'https://hdstreet.club/torrents.php?incldead=1&search_area=4&notnewword=1&search=' + douban_id,},
  1248. {name: "HDTime", link: 'https://hdtime.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1249. {name: "HDU", link: 'http://pt.upxin.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1250. {name: "Hyperay", link: 'https://hyperay.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrents > tbody > tr.nonstick_outer_bg"},
  1251. {name: "JoyHD", link: 'https://www.joyhd.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1252. {name: "MTeam", link: 'https://tp.m-team.cc/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1253. {name: "NPUBITS", link: 'https://npupt.com/torrents.php?incldead=1&search_area=1&notnewword=1&' + npid, selector: "#torrents_table > tbody > tr:gt(0)"},
  1254. {name: "NWSUAF", link: 'https://pt.nwsuaf6.edu.cn/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1255. {name: "NYPT", link: 'https://nanyangpt.com/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrents:last > tbody > tr"},
  1256. {name: "OpenCD", link: 'https://open.cd/torrents.php?incldead=1&search_area=0&notnewword=1&search=' + chinese_title, selector: "table.torrents:last > tbody > tr:gt(0)"},
  1257. {name: "OurBits", link: 'https://ourbits.club/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1258. {name: "OurDiSC", link: 'http://bt.ourdisc.net/browse.php?incldead=0&search=' + chinese_title, selector: "table[width='100%'][border='0'][cellspacing='0'][cellpadding='10'] i"},
  1259. {name: "PlayPT", link: 'http://pt.playpt123.org/play.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1260. {name: "SJTU", link: 'https://pt.sjtu.edu.cn/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrents:last > tbody > tr"},
  1261. {name: "SS", link: 'https://skyeysnow.com/forum.php?mod=torrents&notnewword=1&search=' + chinese_title + year, selector: "table.torrents > tbody > tr:gt(0)"},
  1262. {name: "TCCF", link: 'https://et8.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1263. {name: "TLFBits", link: 'http://pt.eastgame.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1264. {name: "TTG", link: 'https://totheglory.im/browse.php?c=M&notnewword=1&search_field=' + ttgid, selector: "table#torrent_table:last > tbody > tr:gt(0)"},
  1265. {name: "U2", link: 'https://u2.dmhy.org/torrents.php?incldead=1&search_area=0&notnewword=1&search=' + chinese_title + year,},
  1266. {name: "WHUPT", link: 'https://pt.whu.edu.cn/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrents:last > tbody > tr"},
  1267. {name: "ZX", link: 'http://pt.zhixing.bjtu.edu.cn/search/x' + zxid + '-notnewword=1/', selector: "table.torrenttable > tbody > tr:gt(1)"},
  1268. ]
  1269. });
  1270. if(!imdb_id.match(/9999999/)){
  1271. site_map.push({
  1272. name: "PT外站",
  1273. label:[
  1274. {name: "AB", link: 'https://animebytes.tv/torrents.php?searchstr=' + ywm, selector: "div.thin > div.group_cont"},
  1275. {name: "ADC", link: 'http://asiandvdclub.org/browse.php?descr=1&btnSubmit=Search%21&search=' + imdb_id, selector: "table.torrenttable:last > tbody > tr"},
  1276. {name: "AOX", link: 'https://aox.to/index.php?page=torrents&options=4&search=' + imdb_id, selector: "table.table.table-bordered:last > tbody > tr:gt(0)"},
  1277. {name: "Apollo", link: 'https://apollo.rip/torrents.php?searchstr=' + eng_title, selector:"#torrent_table:last > tbody > tr.group_torrent:gt(0)"},
  1278. {name: "AR", link: 'https://alpharatio.cc/torrents.php?searchstr=' + ywm, selector:"#torrent_table > tbody > tr:gt(0)"},
  1279. {name: "AT", link: 'https://animetorrents.me/torrents.php?search=' + eng_title, ajax: 'https://animetorrents.me/ajax/torrents_data.php?total=1&search=' + eng_title + '&SearchSubmit=&page=1' , headers:{"x-requested-with": "XMLHttpRequest"}, rewrite_href:false, selector:'table.dataTable > tbody > tr:nth-child(2)', selector_need_login:"h1.headline strong:contains('Access Denied!')"},
  1280. {name: "AVZ", link: 'https://avistaz.to/torrents?in=1&search=' + ywm, selector:"table.table-condensed.table-striped.table-bordered:last > tbody > tr:gt(0)"},
  1281. {name: "BakaBT", link: 'https://bakabt.me/browse.php?q=' + ywm, selector:"table.torrents > tbody > tr:gt(0)", selector_need_login:"#loginForm"},
  1282. {name: "BHD", link: 'https://beyond-hd.me/browse.php?incldead=0&search=' + imdb_id, selector:"table.tb_detail.grey.torrenttable:last > tbody > tr:gt(0)"},
  1283. {name: "CC", link: 'http://www.cartoonchaos.org/index.php?page=torrents&options=0&active=1&search=' + ywm, selector:"table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(2) > td > table > tbody > tr:gt(0)"},
  1284. {name: "HDF", link: 'https://hdf.world/torrents.php?searchstr=' + ywm, selector:"#torrent_table > tbody > tr:gt(0)"},
  1285. {name: "HDME", link: 'http://hdme.eu/browse.php?incldead=1&blah=1&search=' + imdb_id, selector:"table:nth-child(13) > tbody > tr"},
  1286. {name: "HDMonkey", link: 'https://hdmonkey.org/torrents-search.php?incldead=0&search=' + ywm, selector: "table.ttable_headinner > tbody > tr:gt(0)"},
  1287. {name: "HDS", link: 'https://hd-space.org/index.php?page=torrents&active=1&options=2&search=' + imdb_id, selector: "table.lista:last > tbody > tr:gt(0)"},
  1288. {name: "HDT", link: 'https://hd-torrents.org/torrents.php?active=1&options=2&search=' + imdb_id, selector: "table.mainblockcontenttt b"},
  1289. //{name: "ILC", link: 'http://www.iloveclassics.com/browse.php?searchin=2&search=' + imdb_id, selector: "#hover-over > tbody > tr.table_col1:gt(0)"},
  1290. {name: "IPT", link: 'https://iptorrents.com/t?qf=all&q=' + imdb_id, selector: "#torrents td.ac"},
  1291. {name: "JPOP", link: 'https://jpopsuki.eu/torrents.php?searchstr=' + eng_title, selector: "#torrent_table > tbody > tr:gt(0)"},
  1292. {name: "NetHD", link: 'http://nethd.org/torrents.php?incldead=1&search_area=4&search=' + imdb_id, selector: "table.table.table-bordered.torrent > tbody > tr:gt(1)"},
  1293. {name: "PHD", link: 'https://privatehd.to/torrents?in=1&search=' + ywm, selector: "table.table-condensed.table-striped.table-bordered:first > tbody > tr:gt(0)"},
  1294. {name: "PTF", link: 'http://ptfiles.net/browse.php?incldead=0&title=0&search=' + ywm, selector: "#tortable > tbody > tr.rowhead:gt(0)"},
  1295. {name: "Red", link: 'https://redacted.ch/torrents.php?searchstr=' + eng_title, selector: "#torrent_table > tbody > tr.group_torrent:gt(0)"},
  1296. {name: "SC", link: 'https://secret-cinema.pw/torrents.php?cataloguenumber=' + imdb_id, selector: "div.torrent_card"},
  1297. {name: "Speed", link: 'https://speed.cd/browse.php?d=on&search=' + imdb_id, selector: "div.boxContent > table:first >tbody > tr:gt(0)"},
  1298. {name: "TD", link: 'https://www.torrentday.com/t?q=' + imdb_id, selector: "#torrentTable td.torrentNameInfo"},
  1299. {name: "TS", link: 'https://www.torrentseeds.org/browse.php?searchin=title&incldead=0&search=%22' +eng_title +year + '%22', selector: "table.table.table-bordered > tbody > tr.browse_color:gt(0)"},
  1300. {name: "TT", link: 'https://revolutiontt.me/browse.php?search=' + imdb_id, selector: "table#torrents-table > tbody > tr:gt(0)"},
  1301. {name:"TL",type:"json",link:"https://www.torrentleech.org/torrents/browse/index/query/" + eng_title + year, ajax: "https://www.torrentleech.org/torrents/browse/list/query/" + eng_title + year, selector:"numFound > 0"},
  1302. {name: "UHD",link: 'https://uhdbits.org/torrents.php?searchstr=' + imdb_id, selector: "table.torrent_table > tbody > tr.group"},
  1303. {name: "Waffles", link: 'https://waffles.ch/browse.php?q=' + eng_title, selector: "#browsetable:last > tbody > tr:gt(0)"},
  1304. {name: "WOP", link: 'http://worldofp2p.net/browse.php?incldead=0&searchin=descr&search=' + imdb_id, selector: "table.yenitorrenttable:last > tbody > tr:gt(0)"},
  1305. ]
  1306. });
  1307. site_map.push({
  1308. name: "NZB资源",
  1309. label:[
  1310. {name: "DOGnzb", link: 'https://dognzb.cr/search?q=' + ywm,selector: "#featurebox > table > tbody > tr > td > table > tbody > tr.odd:gt(0)"},
  1311. {name: "LuluNZB", link: 'https://lulunzb.com/search/' + ywm, selector: "#browsetable > tbody > tr:gt(0)", selector_need_login:"div.login-box"},
  1312. {name: "Miatrix",link: 'https://www.miatrix.com/search/' + ywm,selector: "#browsetable > tbody > tr:gt(0)"},
  1313. {name: "NewzTown",link: 'https://newztown.co.za/search/' + ywm,selector: "#browsetable > tbody > tr:gt(0)"},
  1314. {name: "NZBCat",link: 'https://nzb.cat/search/' + ywm,selector: "#browsetable > tbody > tr:gt(0)"},
  1315. {name: "NZBgeek",link: 'https://nzbgeek.info/geekseek.php?moviesgeekseek=1&browsecategory=&browseincludewords=' + ywm,selector: "table > tbody > tr.HighlightTVRow2:gt(0)", selector_need_login:"input[value='do_login']"},
  1316. {name: "NZBP", link: 'https://nzbplanet.net/search/' + ywm, selector: "#browsetable > tbody > tr:gt(0)"},
  1317. {name: "Oznzb", link: 'https://www.oznzb.com/search/' + ywm, selector: "#browsetable > tbody > tr.ratingReportContainer:gt(0)", selector_need_login:"#login"},
  1318. {name: "SNZB", link: 'https://simplynzbs.com/search/' + ywm, selector: "#browsetable > tbody > tr:gt(0)"},
  1319. ]
  1320. });
  1321. }
  1322. if (ptzimu.trim().length > 0) {
  1323. site_map.push({
  1324. name: "PT字幕",
  1325. label:[
  1326. {name:"BYRBT®", link: "https://bt.byr.cn/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table:last > tbody > tr:gt(1)"},
  1327. {name:"CHDBits®", link: "https://chdbits.co/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table:last > tbody > tr:gt(1)"},
  1328. {name:"CMCT®", link: "https://hdcmct.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table:last > tbody > tr:gt(1)"},
  1329. {name:"FRDS®", link: "http://pt.keepfrds.com/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  1330. {name:"HDChina®", link: "https://hdchina.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table.uploaded_sub_list > tbody > tr:gt(1)"},
  1331. {name:"HDCity®", link: "https://hdcity.city/subtitles?notnewword=1&search=" + ptzimu, selector: "center > div:nth-child(1) > table > tbody > tr:nth-child(2)"},
  1332. {name:"HDHome®", link: "https://hdhome.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table:last > tbody > tr:gt(1)"},
  1333. {name:"HDSky®", link: "https://hdsky.me/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table:last > tbody > tr:gt(1)"},
  1334. {name:"HDTime®", link: "https://hdtime.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='100%'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr"},
  1335. {name:"HDU®", link: "http://pt.upxin.net/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  1336. {name:"Hyperay®", link: "https://hyperay.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  1337. {name:"JoyHD®", link: "https://www.joyhd.net/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  1338. {name:"MTeam®", link: "https://tp.m-team.cc/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table.table-subtitle-list:last > tbody > tr"},
  1339. {name:"NPUBITS®", link: "https://npupt.com/subtitles.php?notnewword=1&search=" + ptzimu, selector: "#main > table > tbody > tr:nth-child(2)"},
  1340. {name:"NYPT®", link: "https://nanyangpt.com/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  1341. {name:"OurBits®", link: "https://ourbits.club/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  1342. {name:"SJTU®", link: "https://pt.sjtu.edu.cn/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  1343. {name:"TCCF®", link: "https://et8.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  1344. {name:"TLFBits®", link: "http://pt.eastgame.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  1345. {name:"U2®", link: "https://u2.dmhy.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  1346. {name:"WHUPT®", link: "https://pt.whu.edu.cn/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table.no-vertical-line:last > tbody > tr"},
  1347. ]
  1348. });
  1349. }
  1350. }
  1351.  
  1352. site_map.push({
  1353. name: "中文字幕",
  1354. label:[
  1355. {name:'字幕库', link:'http://www.zimuku.cn/search?q=' + title,selector:'div.box.clearfix div.item.prel.clearfix'},
  1356. {name:'字幕天堂',method:"post", link:'http://www.zmtiantang.com/e/search/',data:`keyboard=${title}&show=title&classid=1,3&tempid=1`,headers:{"Content-Type": "application/x-www-form-urlencoded"},rewrite_href:true,selector:'table.data > tbody > tr:nth-child(2)'},
  1357. {name:'字幕组', link:'http://www.zimuzu.tv/search/index?type=subtitle&keyword=' + title,selector:".search-result li"},
  1358. {name:'sub HD', link:'http://subhd.com/search/' + title,selector:"div.col-md-9 div.box"},
  1359. {name:'伪射手', link:'http://assrt.net/sub/?searchword=' + title,selector:"div.body div.subitem"},
  1360. {name:'163字幕', link:'http://www.163sub.com/Search?id=' + title,selector:"#main_narrow_bd div.subs_list"},
  1361. {name:'电波字幕', link:'http://dbfansub.com/?s=' + title,selector:"div.panel-body article.panel.panel-default.archive"},
  1362. {name:'字幕社', link:'https://www.zimushe.com/search.php?keywords=' + title,selector:"div.wrap-l li"},
  1363. {name:'中文字幕网', link:'http://www.zimuzimu.com/so_zimu.php?title=' + title,selector:"table.sublist a.othersub"},
  1364. {name:'r3sub', link:'https://r3sub.com/search.php?s=' + title,selector:"div.col-sm-8.col-md-9.col-lg-8 div.movie.movie--preview.ddd"},
  1365. {name:'HDZIMU', link:'http://www.hdzimu.com/?s=' + title,selector:'div.post-warp div.post-box'},
  1366. {name:'M1080', link:'http://zimu.m1080.com/search.asp?a=&s=' + title,selector:"table td"},
  1367. {name:'OpenSub', link:'https://www.opensubtitles.org/zh/search/sublanguageid-chi,zht,zhe,eng/imdbid-' + imdb_id,selector:"#search_results tr.change"},
  1368. ]
  1369. });
  1370.  
  1371. if(!imdb_id.match(/9999999/)){
  1372. site_map.push({
  1373. name: "英文字幕",
  1374. label:[
  1375. {name:'Addic7ed', link:'http://www.addic7ed.com/search.php?search=' + eng_title_clean + year,selector:"table.tabel tr"},
  1376. {name:'Podnapisi', link:'https://www.podnapisi.net/zh/subtitles/search/?language=zh&language=en&keywords=' + eng_title_clean + '&' + year + '-' + year,selector:"table tr.subtitle-entry"},
  1377. {name:'Subscene', link:'https://subscene.com/subtitles/release?r=true&q=' + ywm,selector:"table td.a1"},
  1378. {name:'TVsubs', link:'http://tvsubs.net/search.php?q=' + eng_title_clean,selector:"div.cont li"},
  1379. {name:'TVsubtitles', link:'http://www.tvsubtitles.net/search.php?q=' + eng_title_clean,selector:"div.left_articles li"},
  1380. {name:'YIFY', link:'http://www.yifysubtitles.com/search?q=' + eng_title_clean,selector:"div.col-sm-12 div.col-xs-12"},
  1381. ]
  1382. });
  1383. }
  1384.  
  1385. site_map.push({
  1386. name: "在线视频",
  1387. label:[
  1388. {name:'Neets', link:'http://neets.cc/search?key=' + title,selector:'#search_li_box div.search_li.clearfix'},
  1389. {name:'爱奇艺视频', link:'https://so.iqiyi.com/so/q_' + title,selector:"div.mod_result a.info_play_btn"},
  1390. {name:'次元壁', link:'http://www.ciyuan.bi/Search?keyword=' + title,selector:'div.search_left_container div.search_list_box_right'},
  1391. {name:'哈哩哈哩', link:'http://www.halihali.cc/search/?wd=' + title,selector:'#contents div.info'},
  1392. {name:'搜狐视频', link:'https://so.tv.sohu.com/mts?wd=' + title,selector:'div.wrap.cfix div.cfix.resource'},
  1393. {name:'腾讯视频', link:'https://v.qq.com/x/search/?q=' + title,selector:'div.wrapper_main div._infos'},
  1394. {name:'优酷视频', link:'http://www.soku.com/search_video/q_' + title,selector:'div.DIR div.s_info'},
  1395. {name:'AAQQS', link:'http://aaxxy.com/vod-search-pg-1-wd-' + title + '.html',selector:'#find-focus li'},
  1396. {name:'Q2电影网', link:'http://www.q2002.com/search?wd=' + title,selector:'div.container div.movie-item'},
  1397. {name:'魔力电影网', link:'http://www.magbt.net/search.php?searchword=' + title,selector:'#content li.listfl'},
  1398. {name:'小朱视频', link:'http://noad.zhuchaoli.club/search/' + title + '.html',selector:'div.b-listtab-main li.item'},
  1399. {name:'9ANIME', link:'https://www4.9anime.is/search?keyword=' + eng_title,selector:"div.film-list a.name"},
  1400. ]
  1401. });
  1402.  
  1403. site_map.push({
  1404. name: "电影资源",
  1405. label:[
  1406. {name:'52 Movie', link:'http://www.52movieba.com/search.htm?keyword=' + title,selector:'table.table.table-hover.threadlist tr.thread.tap'},
  1407. {name:'97电影网', link:'http://www.id97.com/search?q=' + title,selector:'div.container div.col-xs-7'},
  1408. {name:'爱下电影网', link:'http://www.aixia.cc/plus/search.php?searchtype=titlekeyword&q=' + title,selector:'div.con li'},
  1409. {name:'比特大雄', link:'https://www.btdx8.com/?s=' + title,selector:'#content div.post.clearfix'},
  1410. {name:'比特影视', link:'https://www.bteye.com/search/' + title,selector:'#main div.item'},
  1411. {name:'电影巴士', link:'http://www.dy8c.com/?s=' + title,selector:'#content div.post-box'},
  1412. {name:'电影首发站', link:'http://www.dysfz.cc/key/' + title + '/',selector:'.movie-list li'},
  1413. {name:'电影天堂', method:"post", link:'https://www.dy2018.com/e/search/index.php',data:`show=title%2Csmalltext&tempid=1&keyboard=${gtitle}&Submit=%C1%A2%BC%B4%CB%D1%CB%F7`,headers:{"Content-Type": "application/x-www-form-urlencoded"},rewrite_href:true, selector:'div.co_content8 table'},
  1414. {name:'嘎嘎影视', link:'http://www.gagays.xyz/movie/search?req%5Bkw%5D=' + title,selector:'#movie-sub-cont-db div.large-movie-detail'},
  1415. {name:'高清MP4', link:'http://www.99tvs.com/?s=' + title,selector:'#post_container li'},
  1416. {name:'高清电台', link:'https://gaoqing.fm/s.php?q=' + title,selector:'#result1 div.row'},
  1417. {name:'高清控', link:'http://www.gaoqingkong.com/?s=' + title,selector:'#post_container div.post_hover'},
  1418. {name:'户户盘', method:"post", link:'http://huhupan.com/e/search/index.php',data:`keyboard=${title}&show=title&tempid=1&tbname=news&mid=1&depost=search`,headers:{"Content-Type": "application/x-www-form-urlencoded"},rewrite_href:true, selector:'div.main h2'},
  1419. {name:'蓝光网', link:'http://www.languang.co/?s=' + title,selector:'div.mi_cont li'},
  1420. {name:'迷你MP4', link:'http://www.minimp4.com/search?q=' + title,selector:'div.container div.col-xs-7'},
  1421. {name:'胖鸟电影', link:'http://www.pniao.com/Mov/so/' + title,selector:'div.mainContainer div.movieFlag.eachOne'},
  1422. {name:'人生05', link:'http://www.rs05.com/search.php?s=' + title,selector:'#movielist li'},
  1423. {name:'云播网', link:'http://www.yunbowang.cn/index.php?m=vod-search&wd=' + title,selector:'div.container div.col-xs-7'},
  1424. {name:'中国高清网', link:'http://gaoqing.la/?s=' + title,selector:'div.mainleft div.post_hover'},
  1425. {name:'最新影视站', link:'http://www.zxysz.com/?s=' + title,selector:'#content li.p-item'},
  1426. ]
  1427. });
  1428.  
  1429. site_map.push({
  1430. name: "动漫内站",
  1431. label:[
  1432. {name:'ACG.RIP', link:'https://acg.rip/?term=' + title,selector:'tbody tr'},
  1433. {name:'ACG狗狗', link:'http://bt.acg.gg/search.php?keyword=' + title,selector:'tbody p.original.download'},
  1434. {name:'ACG搜', link:'http://www.acgsou.com/search.php?keyword=' + title,selector:'tbody span.bts_1'},
  1435. {name:'动漫花园', link:'https://share.dmhy.org/topics/list?keyword=' + title,selector:'tbody span.btl_1'},
  1436. {name:'爱恋动漫', link:'http://www.kisssub.org/search.php?keyword=' + title,selector:'tbody span.bts_1'},
  1437. {name:'喵搜', link:'https://nyaso.com/dong/' + title +'.html',selector:'tbody a.down'},
  1438. {name:'旋风动漫', link:'http://share.xfsub.com:88/search.php?keyword=' + title,selector:'#listTable span.bts_1'},
  1439. {name:'怡萱动漫', link:'http://www.yxdm.tv/search.html?title=' + title,selector:'div.main p.stars1'},
  1440. ]
  1441. });
  1442.  
  1443. if(!imdb_id.match(/9999999/)){
  1444. site_map.push({
  1445. name: "动漫外站",
  1446. label:[
  1447. {name:'AniDex', link:'https://anidex.info/?q=' + eng_title,selector:'div.table-responsive tr'},
  1448. {name:'AniRena', link:'https://www.anirena.com/?s=' + eng_title,selector:'#content table'},
  1449. {name:'AniTosho', link:'https://animetosho.org/search?q=' + eng_title,selector:'#content div.home_list_entry'},
  1450. {name:'Nyaa', link:'https://nyaa.si/?q=' + eng_title,selector:'div.table-responsive tr.default'},
  1451. {name:'ニャパンツ', link:'https://nyaa.pantsu.cat/search?c=_&q=' + eng_title,selector:'#torrentListResults tr.torrent-info'},
  1452. {name:'东京図书馆', link:'https://www.tokyotosho.info/search.php?terms=' + eng_title,selector:'table.listing td.desc-top'},
  1453. ]
  1454. });
  1455. }
  1456.  
  1457. site_map.push({
  1458. name: "美剧资源",
  1459. label:[
  1460. {name:'人人影视', link:'http://www.zimuzu.tv/search?type=resource&keyword=' + title,selector:"div.search-result > ul > li"},
  1461. {name:'人人美剧', link:'http://www.yyetss.com/Search/index/s_keys/' + title,selector:'div.row div.col-xs-3'},
  1462. {name:'天天美剧', link:'http://www.ttmeiju.vip/index.php/search/index.html?keyword=' + title,selector:'table.latesttable tr.Scontent1'},
  1463. {name:'爱美剧', link:'https://22v.net/search/' + title,selector:'div.movie span'},
  1464. {name:'天天看美剧', link:'http://www.msj1.com/?s=' + title,selector:'div.cat_list div.art_show_top'},
  1465. {name:'美剧粉', link:'http://www.itvfans.com/?s=' + title,selector:'#main-wrap-left div.home-blog-entry-text'},
  1466. ]
  1467. });
  1468.  
  1469. site_map.push({
  1470. name: "BT内站",
  1471. label:[
  1472. {name:'BT吧', link:'http://www.btba.com.cn/search?keyword=' + title,selector:'div.left li'},
  1473. {name:'BT蚂蚁', link:'https://www.btmyi.com/search.html?kw=' + title,selector:"div.row h5.item-title"},
  1474. {name:'BT天堂', link:'http://www.bttt.la/s.php?q=' + title,selector:'div.ml div.title'},
  1475. {name:'BT之家', link:'http://www.btbtt.co/search-index-keyword-' + title + '.htm',selector:'#threadlist table'},
  1476. {name:'RARBT', link:'http://www.rarbt.com/index.php/search/index.html?search=' + title,selector:'div.ml div.title'},
  1477. {name:'查片源', link:'https://www.chapianyuan.com/?keyword=' + title,selector:'div.block li'},
  1478. {name:'磁力猫', link:'http://www.cilimao.me/search?word=' + title,selector:'#Search__content_left___2MajJ div.MovieCard__content___3kv1W'}, // TODO check
  1479. {name:'磁力站', link:'http://oabt004.com/index/index?c=&k=' + title,selector:'div.link-list-wrapper ul.link-list'},
  1480. {name:'光影资源', link:'http://www.etdown.net/index.php?keyword=' + title,selector:'tbody.list_4 tr'},
  1481. {name:'我爱P2P', link:'http://www.woaip2p.net/topic/list?categoryId=0&title=' + title,selector:'tbody td.word-break'},
  1482. {name:'小浣熊下载', link:'https://www.xiaohx.org/search?key=' + title,selector:'div.search_right li'},
  1483. {name:'一站搜', link:'http://v.yizhansou.com/search?kw=' + title,selector:'table td.st'},
  1484. ]
  1485. });
  1486.  
  1487. if(!imdb_id.match(/9999999/)){
  1488. site_map.push({
  1489. name: "BT外站",
  1490. label:[
  1491. {name:'1337X', link:'https://1337x.to/search/' + ywm + '/1/',selector:'table.table-list.table.table-responsive.table-striped td.coll-1.name'},
  1492. {name:'BT-Scene', link:'https://bt-scene.cc/results_.php?q=' + ywm,selector:'table.tor td.tname'},
  1493. {name:'iDope', link:'https://idope.se/torrent-list/' + ywm,selector:'#div2child div.resultdiv'},
  1494. {name:'ISOHunt', link:'https://isohunt2.net/torrent/?ihq=' + ywm,selector:'#serps td.title-row'},
  1495. {name:'KickAss', link:'https://katcr.co/katsearch/page/1/' + ywm,selector:'div.table--responsive_vertical div.torrents_table__torrent_name'},
  1496. {name:'Lime', link:'https://www.limetorrents.cc/search/all/' + ywm,selector:'table.table2 div.tt-name'},
  1497. {name:'RARBG', link:'http://rarbg.is/torrents.php?search=' + imdb_id,selector:'table.lista2t tr.lista2'},
  1498. {name:'TorLock', link:'https://www.torlock2.com/all/torrents/' + ywm.replace(/ /g,"-") +'.html',selector:'table.table.table-striped.table-bordered.table-hover.table-condensed td.td'},
  1499. {name:'WorldWide', link:'https://worldwidetorrents.me/torrents-search.php?search=' + ywm,selector:'div.w3-responsive td.w3-jose'},
  1500. {name:'Zooqle', link:'https://zooqle.com/search?q=' + ywm,selector:'div.panel-body a.small'},
  1501. {name:'海盗湾', link:'https://thepiratebay.org/search/' + ywm,selector:'#searchResult div.detName'},
  1502. ]
  1503. });
  1504. }
  1505.  
  1506. function Exist_check(label) {
  1507. let site = label.name;
  1508. let psite = $(`a[data-name="${site}"]`);
  1509.  
  1510. function TagExist(link){
  1511. $(psite).css("background-color", GM_getValue("tag_bcolor_exist","#e3f1ed"));
  1512. $(psite).css("color", GM_getValue("tag_fcolor_exist","#3377aa"));
  1513. $(psite).attr("title","资源存在");
  1514. let storage_data = true;
  1515. if (label.rewrite_href && label.rewrite_href === true) { // 重写链接
  1516. storage_data = GM_getCacheValue(`${douban_id}_${site}`, link || $(psite).attr("href"),false);
  1517. $(psite).attr("href",storage_data);
  1518. }
  1519. GM_setCacheValue(`${douban_id}_${site}`,storage_data,86400 * 7 * 1e3,false);
  1520. }
  1521.  
  1522. function TagNotExist() {
  1523. $(psite).css("background-color", GM_getValue("tag_bcolor_not_exist","#f4eac2"));
  1524. $(psite).css("color", GM_getValue("tag_fcolor_not_exist","#3377aa"));
  1525. $(psite).attr("title","资源不存在");
  1526. }
  1527.  
  1528. function TagNeedLogin() {
  1529. $(psite).css("background-color", GM_getValue("tag_bcolor_need_login",""));
  1530. $(psite).css("color", GM_getValue("tag_fcolor_need_login","#3377aa"));
  1531. GM_setCacheValue(`need_login_${site}`,true, 86400 * 1e3);
  1532. $(psite).click(function () {
  1533. GM_deletedCacheValue(`need_login_${site}`);
  1534. });
  1535. $(psite).attr("title","站点需要登陆");
  1536. }
  1537.  
  1538. function TagError() {
  1539. $(psite).css("background-color", GM_getValue("tag_bcolor_error",""));
  1540. $(psite).css("color", GM_getValue("tag_fcolor_error","#3377aa"));
  1541. $(psite).attr("title", "遇到问题");
  1542. }
  1543.  
  1544.  
  1545. // 这里假定有这个资源的就一直都有,直接使用第一次请求成功的时候缓存信息
  1546. if (GM_getCacheValue(`${douban_id}_${site}`, false)) {
  1547. TagExist();
  1548. return;
  1549. }
  1550.  
  1551. // 如果前次检查到这个站点需要登陆
  1552. if (GM_getCacheValue(`need_login_${site}`, false)) {
  1553. TagNeedLogin();
  1554. return;
  1555. }
  1556.  
  1557. // 不然,则请求相关信息
  1558. $(psite).attr("title", "正在请求信息中");
  1559. GM_xmlhttpRequest({
  1560. method: label.method || "GET",
  1561. url: label.ajax || label.link,
  1562. data: label.data,
  1563. headers: label.headers,
  1564. onload: function (res) {
  1565. if (/login|verify|checkpoint|returnto/ig.test(res.finalUrl)) {
  1566. TagNeedLogin(); // 检查最终的URL看是不是需要登陆
  1567. } else if (/refresh: \d+; url=.+login.+/ig.test(res.responseHeaders)){
  1568. TagNeedLogin(); // 检查responseHeader有没有重定向
  1569. } else {
  1570. let responseText = res.responseText;
  1571. // if (label.name==="AT") {console.log(label.name);console.log(res.finalUrl);console.log(res.responseHeaders);console.log(res.responseText);}
  1572. if (typeof responseText === "undefined") {
  1573. TagNeedLogin(); // 检查最终的Text,如果什么都没有也可能说明需要登陆
  1574. } else if (responseText.length <800 && /login/.test(responseText)) {
  1575. TagNeedLogin(); // 对Text进行检查,断言“过短,且中间出现login字段”即说明可能需要登陆
  1576. } else { // 开始解析返回信息
  1577. try {
  1578. TagNotExist(); // 先断言不存在
  1579. if (label.type && label.type === "json") { // 如果前面定义了返回类型是 "json"
  1580. let par = JSON.parse(responseText);
  1581. if (eval("par." + label.selector)) {
  1582. TagExist();
  1583. }
  1584. } else { // 否则默认label.type的默认值为 html
  1585. let doc = (new DOMParser()).parseFromString(res.responseText, 'text/html');
  1586. let body = doc.querySelector("body");
  1587. // 因为jQuery的选择器丰富,故这里不用 dom.querySelector() 而用 jQuery.find()
  1588. if (label.selector_need_login && $(body).find(label.selector_need_login).length){
  1589. TagNeedLogin(); // 如果存在selector_need_login选择器,则先判断是否存在以确定是否需要登录
  1590. } else if ($(body).find(label.selector || "table.torrents:last > tbody > tr:gt(0)").length) {
  1591. TagExist(res.finalUrl); // 最后使用selector选择器判断资源是否存在
  1592. }
  1593. }
  1594. } catch (e) {
  1595. TagError();
  1596. }
  1597. }
  1598. }
  1599. },
  1600. onerror: function () {
  1601. TagError();
  1602. }
  1603. });
  1604. }
  1605.  
  1606. function site_exist_status() {
  1607. for (let i = 0; i < site_map.length; i++) {
  1608. let map_dic = site_map[i];
  1609. if (GM_getCacheValue("delete_site_" + map_dic.name,false)) {
  1610. continue;
  1611. }
  1612. $('#content div.tags').before(`<div class="c-aside name-offline" data-id="${i}"><h2><i>${map_dic.name}</i>· · · · · ·</h2><div class=c-aside-body style="padding: 0 12px;"> <ul class=bs > </ul> </div> </div>`);
  1613.  
  1614. let in_site_html = $(`div[data-id='${i}'] ul.bs`);
  1615. for (let j = 0; j < map_dic.label.length; j++) {
  1616. let label = map_dic.label[j];
  1617. if (GM_getCacheValue("delete_site_" + label.name,false)) {
  1618. continue;
  1619. }
  1620. in_site_html.append(`<a href="${label.link}" data-name="${label.name}" target="_blank" rel="nofollow" class="name-offline">${label.name}</a>`);
  1621. Exist_check(label)
  1622. }
  1623. }
  1624. }
  1625. site_exist_status();
  1626. });
  1627.  
  1628. }
  1629.  
  1630. else if (location.href.startwith('https://book.douban.com/subject/')) {
  1631. // 定义基础方法
  1632. function getDoc(url, meta, callback) {
  1633. GM_xmlhttpRequest({
  1634. method: 'GET',
  1635. url: url,
  1636. headers: {
  1637. 'User-agent': window.navigator.userAgent,
  1638. 'Content-type': null
  1639. },
  1640. onload: function (responseDetail) {
  1641. if (responseDetail.status === 200) {
  1642. let doc = (new DOMParser).parseFromString(responseDetail.responseText, 'text/html');
  1643. callback(doc, responseDetail, meta);
  1644. }
  1645. }
  1646. });
  1647. }
  1648. function getJSON(url, callback) {
  1649. GM_xmlhttpRequest({
  1650. method: 'GET',
  1651. url: url,
  1652. headers: {
  1653. 'Accept': 'application/json'
  1654. },
  1655. onload: function (response) {
  1656. if (response.status >= 200 && response.status < 400) {
  1657. callback(JSON.parse(response.responseText), url);
  1658. } else {
  1659. callback(false, url);
  1660. }
  1661. }
  1662. });
  1663. }
  1664.  
  1665. let cache_prefix = "cache_";
  1666.  
  1667. function GM_deletedCacheValue(name) {
  1668. GM_deleteValue(name);
  1669. GM_deleteValue(cache_prefix + name);
  1670. }
  1671.  
  1672. function GM_setCacheValue (name,value,expire,json_parser) {
  1673. GM_setValue(name,json_parser ? JSON.stringify(value) : value);
  1674. GM_setValue(cache_prefix + name,json_parser ? JSON.stringify(Date.now() + expire) : (Date.now() + expire));
  1675. }
  1676.  
  1677. function GM_getCacheValue (name,defaultValue,json_parser) {
  1678. let expire_timestamp = parseInt(GM_getValue(cache_prefix + name));
  1679. if (expire_timestamp < Date.now()) {
  1680. GM_deletedCacheValue(name);
  1681. }
  1682.  
  1683. return json_parser ? JSON.parse(GM_getValue(name,defaultValue)): GM_getValue(name,defaultValue);
  1684. }
  1685.  
  1686. function GM_clearExpiredCacheValue(force) {
  1687. let cache_key = GM_listValues().filter(function (key) {
  1688. return key.includes(cache_prefix)
  1689. });
  1690. for (let i=0;i< cache_key.length;i++) {
  1691. let name = cache_key[i].slice(cache_prefix.length);
  1692. let expired_timestamp = GM_getValue(cache_prefix + name);
  1693. if(force || expired_timestamp < Date.now()) {
  1694. GM_deletedCacheValue(name);
  1695. }
  1696. }
  1697. }
  1698.  
  1699. GM_clearExpiredCacheValue(false);
  1700.  
  1701. let _version = GM_getValue("version","完整版");
  1702.  
  1703. if (typeof GM_registerMenuCommand !== "undefined") {
  1704.  
  1705. function changeVersionConfirm() {
  1706. if (confirm(`你当前版本是 ${_version},是否进行切换?`)) {
  1707. GM_setValue("version",_version === "完整版" ? "轻量版" : "完整版");
  1708. }
  1709. }
  1710. GM_registerMenuCommand("脚本功能切换",changeVersionConfirm);
  1711.  
  1712. function deleteSitePrompt() {
  1713. let delete_site_prefix = "delete_site_";
  1714. let name=prompt("请输入你不想看到的站点名称,请注意,除非重装脚本,否则该操作不可撤销","");
  1715. if (name!=null && name!=="") {
  1716. if (GM_getValue(delete_site_prefix + name,false)) {
  1717. GM_deleteValue(delete_site_prefix + name);
  1718. } else { // 二次输入恢复
  1719. GM_setValue(delete_site_prefix + name,true);
  1720. }
  1721. }
  1722. }
  1723. GM_registerMenuCommand("删除不想显示的站",deleteSitePrompt);
  1724.  
  1725. function changeTagBColor() {
  1726. let now_bcolor_list = [GM_getValue("tag_bcolor_exist","#e3f1ed"),GM_getValue("tag_bcolor_not_exist","#f4eac2"),GM_getValue("tag_bcolor_need_login",""),GM_getValue("tag_bcolor_error","")];
  1727. let name = prompt("请依次输入代表'资源存在','资源不存在','站点需要登陆','站点解析错误'颜色的Hex值,并用英文逗号分割。当前值为:" , `${now_bcolor_list.join(',')}`);
  1728. if (name!=null && name!=="") {
  1729. try {
  1730. let bcolor_list = name.split(",");
  1731. GM_setValue("tag_bcolor_exist",bcolor_list[0] || "#e3f1ed");
  1732. GM_setValue("tag_bcolor_not_exist",bcolor_list[1] || "#f4eac2");
  1733. GM_setValue("tag_bcolor_need_login",bcolor_list[2] || "");
  1734. GM_setValue("tag_bcolor_error",bcolor_list[3] || "");
  1735. } catch (e) {
  1736. alert("解析输入出错");
  1737. }
  1738. }
  1739. }
  1740. GM_registerMenuCommand("更改标签背景色",changeTagBColor);
  1741.  
  1742. function changeTagFColor() {
  1743. let now_fcolor_list = [GM_getValue("tag_fcolor_exist","#3377aa"),GM_getValue("tag_fcolor_not_exist","#3377aa"),GM_getValue("tag_fcolor_need_login","#3377aa"),GM_getValue("tag_fcolor_error","#3377aa")];
  1744. let name = prompt("请依次输入代表'资源存在','资源不存在','站点需要登陆','站点解析错误'颜色的Hex值,并用英文逗号分割。当前值为:" , `${now_fcolor_list.join(',')}`);
  1745. if (name!=null && name!=="") {
  1746. try {
  1747. let fcolor_list = name.split(",");
  1748. GM_setValue("tag_fcolor_exist",fcolor_list[0] || "#3377aa");
  1749. GM_setValue("tag_fcolor_not_exist",fcolor_list[1] || "#3377aa");
  1750. GM_setValue("tag_fcolor_need_login",fcolor_list[2] || "#3377aa");
  1751. GM_setValue("tag_fcolor_error",fcolor_list[3] || "#3377aa");
  1752. } catch (e) {
  1753. alert("解析输入出错");
  1754. }
  1755. }
  1756. }
  1757. GM_registerMenuCommand("更改标签文字色",changeTagFColor);
  1758.  
  1759. function forceCacheClear() {
  1760. if (confirm("清空所有缓存信息(包括资源存在情况、登陆情况、imdb250等)")) {
  1761. GM_clearExpiredCacheValue(true);
  1762. }
  1763. }
  1764. GM_registerMenuCommand("清空脚本缓存",forceCacheClear);
  1765.  
  1766. }
  1767.  
  1768.  
  1769. $(document).ready(function () {
  1770. // 脚本对页面进行预处理
  1771. if($('#info span.pl:contains("又名")').length === 0){
  1772. $('#info').append('<div style="display: none"><span class="pl">又名:</span>啥也没有<br></div>');
  1773. }
  1774.  
  1775. if($('div#info a[href^=\'http://www.imdb.com/title/tt\']').length === 0){
  1776. $('#info').append('<div style="display: none"><span class="pl">IMDb链接:</span><a href="http://www.imdb.com/title/tt9999999" target="_blank" rel="nofollow">tt9999999</a><br></div>');
  1777. }
  1778.  
  1779. if ($('#mainpic p.gact').length === 0) {
  1780. $("#mainpic").append("<p class=\"gact\"></p>")
  1781. }
  1782.  
  1783. let interest_sectl_selector = $('#interest_sectl');
  1784. interest_sectl_selector.after($('div.grid-16-8 div.related-info'));
  1785. interest_sectl_selector.attr('style', 'float:right');
  1786. $('div.related-info').attr('style', 'width:480px;float:left');
  1787.  
  1788. $("div#info").append("<span class=\"pl\">生成信息: </span><a id='movieinfogen' href='javascript:void(0);'>movieinfo</a>");
  1789. let movieinfo_html = $("<div class='c-aside' style='float:left;margin-top:20px;width: 470px;display: none' id='movieinfo_div'><h2><i>电影简介</i>· · · · · · </h2><a href='javascript:void(0);' id='copy_movieinfo'>点击复制</a><div class=\"c-aside-body\" style=\"padding: 0 12px;\" id='movieinfo'></div></div>");
  1790. if ($("#movieinfo").length === 0) {
  1791. $("div.related-info").before(movieinfo_html);
  1792. $("a#copy_movieinfo").click(function() {
  1793. let movieinfo_html = $("#movieinfo").html();
  1794. let movieclip = movieinfo_html.replace(/<br>/ig,"\n")
  1795. .replace(/<a [^>]*>/g,"").replace(/<\/a>/g,"");
  1796. GM_setClipboard(movieclip);
  1797. $(this).text("复制成功");
  1798. })
  1799. }
  1800.  
  1801. // 查看原图
  1802. let posterAnchor = document.querySelector('#mainpic > a > img');
  1803. if (posterAnchor) {
  1804. let postersUrl = posterAnchor.getAttribute("src");
  1805. let rawUrl = postersUrl.replace(/photo\/s_ratio_poster\/public\/(p\d+).+$/,"photo/raw/public/$1.jpg");
  1806. $('#mainpic p.gact').after(`<a target="_blank" rel="nofollow" href="${rawUrl}">查看原图</a>`);
  1807. }
  1808.  
  1809. // Movieinfo信息生成相关
  1810. let poster;
  1811. let this_title, trans_title, aka;
  1812. let year, region, genre,language,playdate;
  1813. let imdb_link, imdb_id, imdb_average_rating, imdb_votes, imdb_rating;
  1814. let douban_link, douban_id, douban_average_rating, douban_votes, douban_rating;
  1815. let episodes, duration;
  1816. let director, writer, cast;
  1817. let tags,introduction,awards;
  1818.  
  1819. function descriptionGenerator() {
  1820. let descr = "";
  1821. descr += poster ? `[img]${poster}[/img]\n\n` : "";
  1822. descr += (trans_title && !trans_title.match(/啥也没有/)) ? `◎译  名 ${trans_title}\n` : "";
  1823. descr += this_title ? `◎片  名 ${this_title}\n` : "";
  1824. descr += year ? `◎年  代 ${year.trim()}\n` : "";
  1825. descr += region ? `◎产  地 ${region}\n` : "";
  1826. descr += genre ? `◎类  别 ${genre}\n` : "";
  1827. descr += language ? `◎语  言 ${language}\n` : "";
  1828. descr += playdate ? `◎上映日期 ${playdate}\n` : "";
  1829. descr += imdb_rating ? `◎IMDb评分 ${imdb_rating}\n` : ""; // 注意如果长时间没能请求完成imdb信息,则该条不显示
  1830. descr += (imdb_link && !imdb_link.match(/9999999/)) ? `◎IMDb链接 ${imdb_link}\n` : "";
  1831. descr += douban_rating ? `◎豆瓣评分 ${douban_rating}\n` : "";
  1832. descr += douban_link ? `◎豆瓣链接 ${douban_link}\n` : "";
  1833. descr += episodes ? `◎集  数 ${episodes}\n` : "";
  1834. descr += duration ? `◎片  长 ${duration}\n` : "";
  1835. descr += director ? `◎导  演 ${director}\n` : "";
  1836. descr += writer ? `◎编  剧 ${writer}\n` : "";
  1837. descr += cast ? `◎主  演 ${cast.replace(/\n/g, '\n' + ' '.repeat(4) + '  ').trim()}\n` : "";
  1838. descr += tags ? `\n◎标  签 ${tags}\n` : "";
  1839. descr += introduction ? `\n◎简  介\n\n  ${introduction.replace(/\n/g, '\n' + ' '.repeat(2))}\n` : "";
  1840. descr += awards ? `\n◎获奖情况\n\n  ${awards.replace(/\n/g, '\n' + ' '.repeat(2))}\n` : "";
  1841. movieinfo_html.find("div#movieinfo").html(descr.replace(/\n/ig,"<br>"));
  1842. }
  1843. $("a#movieinfogen").click(function() {
  1844. descriptionGenerator();
  1845. $("#movieinfo_div").toggle();
  1846. });
  1847.  
  1848. let fetch = function (anchor) {
  1849. return anchor[0].nextSibling.nodeValue.trim();
  1850. };
  1851.  
  1852. // 从页面中解析信息并请求imdb等第三方数据
  1853. let chinese_title = document.title.replace('(豆瓣)','').trim();
  1854. let foreign_title = $('#content h1>span[property="v:itemreviewed"]').text().replace(chinese_title, '').trim();
  1855. let aka_anchor = $('#info span.pl:contains("又名")');
  1856. if (aka_anchor[0]) {
  1857. aka = fetch(aka_anchor).split(' / ').sort(function (a, b) {//首字(母)排序
  1858. return a.localeCompare(b);
  1859. }).join('/');
  1860. }
  1861. if (foreign_title) {
  1862. trans_title = chinese_title + (aka ? ('/' + aka) : '');
  1863. this_title = foreign_title;
  1864. } else {
  1865. trans_title = aka ? aka : '';
  1866. this_title = chinese_title;
  1867. }
  1868. year = ' ' + $('#content > h1 > span.year').text().substr(1, 4);
  1869.  
  1870. let regions_anchor = $('#info span.pl:contains("制片国家/地区")'); //产地
  1871. if (regions_anchor[0]) {
  1872. region = fetch(regions_anchor).split(' / ').join('/');
  1873. }
  1874.  
  1875. genre = $('#info span[property="v:genre"]').map(function () { //类别
  1876. return $(this).text().trim();
  1877. }).toArray().join('/');
  1878.  
  1879. let language_anchor = $('#info span.pl:contains("语言")'); //语言
  1880. if (language_anchor[0]) {
  1881. language = fetch(language_anchor).split(' / ').join('/');
  1882. }
  1883.  
  1884. playdate = $('#info span[property="v:initialReleaseDate"]').map(function () { //上映日期
  1885. return $(this).text().trim();
  1886. }).toArray().sort(function (a, b) {//按上映日期升序排列
  1887. return new Date(a) - new Date(b);
  1888. }).join('/');
  1889.  
  1890.  
  1891. $("#loading_more_rate").hide();
  1892. });
  1893. }
  1894.  
  1895. douban_link = 'https://' + location.href.match(/movie.douban.com\/subject\/\d+\//); //豆瓣链接
  1896. douban_id = location.href.match(/(\d{7,8})/g);
  1897. //集数
  1898. let episodes_anchor = $('#info span.pl:contains("集数")');
  1899. if (episodes_anchor[0]) {
  1900. episodes = fetch(episodes_anchor);
  1901. }
  1902. //片长
  1903. let duration_anchor = $('#info span.pl:contains("单集片长")');
  1904. if (duration_anchor[0]) {
  1905. duration = fetch(duration_anchor);
  1906. } else {
  1907. duration = $('#info span[property="v:runtime"]').text().trim();
  1908. }
  1909.  
  1910. getDoc(douban_link + 'awards/',null,function (doc) {
  1911. awards = $('#content>div>div.article',doc).html()
  1912. .replace(/[ \n]/g, '')
  1913. .replace(/<\/li><li>/g, '</li> <li>')
  1914. .replace(/<\/a><span/g, '</a> <span')
  1915. .replace(/<(div|ul)[^>]*>/g, '\n')
  1916. .replace(/<[^>]+>/g, '')
  1917. .replace(/&nbsp;/g, ' ')
  1918. .replace(/ +\n/g, '\n')
  1919. .trim();
  1920. }); // 该影片的评奖信息
  1921. getJSON('https://api.douban.com/v2/movie/' + douban_id,function (data1) {
  1922. douban_average_rating = data1.rating.average || 0;
  1923. douban_votes = data1.rating.numRaters.toLocaleString() || 0;
  1924. douban_rating = douban_average_rating + '/10 from ' + douban_votes + ' users';
  1925. introduction = data1.summary.replace(/^None$/g, '暂无相关剧情介绍');
  1926. poster = data1.image.replace(/s(_ratio_poster|pic)/g, 'l');
  1927. director = data1.attrs.director ? data1.attrs.director.join(' / ') : '';
  1928. writer = data1.attrs.writer ? data1.attrs.writer.join(' / ') : '';
  1929. cast = data1.attrs.cast ? data1.attrs.cast.join('\n') : '';
  1930. tags = data1.tags.map(function (member) {
  1931. return member.name;
  1932. }).join(' | ');
  1933. }); //豆瓣评分,简介,海报,导演,编剧,演员,标签
  1934.  
  1935. // 获取电影英文名
  1936. let eng_title = [this_title, trans_title].join("/").split("/").filter(function (arr) {
  1937. return /([a-zA-Z]){2,}/.test(arr);
  1938. })[0] || "";
  1939.  
  1940. // 剧集修正季数名
  1941. eng_title = eng_title.match(/Season\s\d\d/) ? eng_title.replace(/Season\s/, "S") : eng_title.replace(/Season\s/, "S0");
  1942. eng_title = eng_title.replace(/[:,!\-]/g, "").replace(/ [^a-z0-9]+$/,"");
  1943. let eng_title_clean = eng_title.replace(/ S\d\d*$/, "");
  1944.  
  1945. // 电影+年份 (只有电影才搜索并赋值年份)
  1946. let is_movie = $('a.bn-sharing').attr('data-type').match(/电影/);
  1947. let encode_year = is_movie ? year.replace(/ /,"_") : "";
  1948. let nian = is_movie ? year : "";
  1949. let encode_eng_title = (eng_title || "").replace(/ /g,"_");
  1950. let ptzimu = encode_eng_title + encode_year;
  1951. chinese_title = chinese_title.replace(/[:,]/," ");
  1952. let gtitle = encodeToGb2312(chinese_title,true);
  1953. let ywm = eng_title + nian;
  1954. let zwm = chinese_title + nian;
  1955.  
  1956. // get Chinese title
  1957. let title = encodeURI($('#content > h1 > span')[0].textContent.split(' ').shift().replace(/[:,]/," "));
  1958.  
  1959. let site_map = [];
  1960.  
  1961. /** label对象键值说明:
  1962. * name: String 站点名称,请注意该站点名称在不同的site_map中也应该唯一,以免脚本后续判断出错
  1963. * method: String 搜索请求方式,默认值为 "GET"
  1964. * link: String 构造好的请求页面链接,作为label的href属性填入,用户应该能直接点开这个页面。
  1965. * ajax: String 如果站点使用ajax的形式加载页面,则需要传入该值作为实际请求的链接,即优先级比link更高。
  1966. * type: String 返回结果类型,脚本默认按html页面解析;只有当传入值为"json"时,脚本按JSON格式解析
  1967. * selector: String 搜索成功判断结果,默认值为 "table.torrents:last > tbody > tr:gt(0)" (适用于国内多数NexusPHP构架的站点)
  1968. * 如果type为"page"(默认)时,为一个(jQuery)CSS选择器,
  1969. * 如果type为"json"时,为一个具体的判断式。
  1970. * selector_need_login 搜索需要登录的选择器,仅在type为默认时有用,其余用法同Selector一致。
  1971. * selector_not_exit 搜索资源不存在的选择器,仅在type为默认时有用,其余用法同Selector一致。
  1972. * data: String 作为请求的主体发送的内容,默认为空即可
  1973. * headers: Object 修改默认请求头,(防止某些站点有referrer等请求头检查
  1974. * rewrite_href: Boolean 如果站点最终搜索显示的页面与实际使用搜索页面(特别是使用post进行交互的站点)不一致,
  1975. * 设置为true能让脚本存储最终url,并改写label使用的href属性
  1976. *
  1977. * 注意: 1. 如果某键有默认值,则传入值均会覆盖默认值
  1978. * 2. 关于请求方法请参考:https://github.com/scriptish/scriptish/wiki/GM_xmlhttpRequest
  1979. * */
  1980.  
  1981. if (_version === "完整版") {
  1982. let neizhan = imdb_id.match(/9999999/) ? ('/subject/' + douban_id) : imdb_id; // PT内站 智能判定是用IMDB ID还是豆瓣ID
  1983. let npid = imdb_id.match(/9999999/) ? ('douban=' + douban_id) : ('imdb=' + imdb_id); // NPUBITS 智能判定是用IMDB ID还是豆瓣ID
  1984. let ttgid = imdb_id.match(/9999999/) ? (zwm) : ( 'IMDB' + imdb_id.slice(2)); // TTG 智能判定是用IMDB ID还是中文名
  1985. let zxid = imdb_id.match(/9999999/) ? (zwm) : imdb_id; // ZX 智能判定是用IMDB ID还是中文名
  1986.  
  1987. site_map.push({
  1988. name: "PT内站",
  1989. label: [
  1990. {name: "BTSchool", link: 'http://pt.btschool.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,/* selector: "table.torrents:last > tbody > tr:gt(0)"}, */},
  1991. {name: "BYRBT", link: 'https://bt.byr.cn/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1992. {name: "CCFBits", link: 'http://www.ccfbits.org/browse.php?fullsearch=1&notnewword=1&search=' + neizhan, selector: "table.mainouter > tbody > tr:last > td > table:nth-child(10) > tbody > tr:gt(0)"},
  1993. {name: "CHDBits", link: 'https://chdbits.co/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1994. {name: "CMCT", link: 'https://hdcmct.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1995. {name: "GZTown", link: 'https://pt.gztown.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1996. {name: "FRDS", link: 'http://pt.keepfrds.com/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  1997. {name: "HDChina", link: 'https://hdchina.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrent_list:last > tbody > tr:gt(0)"},
  1998. {name: "HDCity", link: 'https://hdcity.city/pt?incldead=1&search_area=1&notnewword=1&iwannaseethis=' + neizhan, selector: "center > div > div > div.text"},
  1999. {name: "HDHome", link: 'https://hdhome.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  2000. {name: "HDSky", link: 'https://hdsky.me/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  2001. {name: "HDStreet", link: 'https://hdstreet.club/torrents.php?incldead=1&search_area=4&notnewword=1&search=' + douban_id,},
  2002. {name: "HDTime", link: 'https://hdtime.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  2003. {name: "HDU", link: 'http://pt.upxin.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  2004. {name: "Hyperay", link: 'https://hyperay.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrents > tbody > tr.nonstick_outer_bg"},
  2005. {name: "JoyHD", link: 'https://www.joyhd.net/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  2006. {name: "MTeam", link: 'https://tp.m-team.cc/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  2007. {name: "NPUBITS", link: 'https://npupt.com/torrents.php?incldead=1&search_area=1&notnewword=1&' + npid, selector: "#torrents_table > tbody > tr:gt(0)"},
  2008. {name: "NWSUAF", link: 'https://pt.nwsuaf6.edu.cn/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  2009. {name: "NYPT", link: 'https://nanyangpt.com/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrents:last > tbody > tr"},
  2010. {name: "OpenCD", link: 'https://open.cd/torrents.php?incldead=1&search_area=0&notnewword=1&search=' + chinese_title, selector: "table.torrents:last > tbody > tr:gt(0)"},
  2011. {name: "OurBits", link: 'https://ourbits.club/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  2012. {name: "OurDiSC", link: 'http://bt.ourdisc.net/browse.php?incldead=0&search=' + chinese_title, selector: "table[width='100%'][border='0'][cellspacing='0'][cellpadding='10'] i"},
  2013. {name: "PlayPT", link: 'http://pt.playpt123.org/play.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  2014. {name: "SJTU", link: 'https://pt.sjtu.edu.cn/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrents:last > tbody > tr"},
  2015. {name: "SS", link: 'https://skyeysnow.com/forum.php?mod=torrents&notnewword=1&search=' + chinese_title + year, selector: "table.torrents > tbody > tr:gt(0)"},
  2016. {name: "TCCF", link: 'https://et8.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  2017. {name: "TLFBits", link: 'http://pt.eastgame.org/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan,},
  2018. {name: "TTG", link: 'https://totheglory.im/browse.php?c=M&notnewword=1&search_field=' + ttgid, selector: "table#torrent_table:last > tbody > tr:gt(0)"},
  2019. {name: "U2", link: 'https://u2.dmhy.org/torrents.php?incldead=1&search_area=0&notnewword=1&search=' + chinese_title + year,},
  2020. {name: "WHUPT", link: 'https://pt.whu.edu.cn/torrents.php?incldead=1&search_area=1&notnewword=1&search=' + neizhan, selector: "table.torrents:last > tbody > tr"},
  2021. {name: "ZX", link: 'http://pt.zhixing.bjtu.edu.cn/search/x' + zxid + '-notnewword=1/', selector: "table.torrenttable > tbody > tr:gt(1)"},
  2022. ]
  2023. });
  2024. if(!imdb_id.match(/9999999/)){
  2025. site_map.push({
  2026. name: "PT外站",
  2027. label:[
  2028. {name: "AB", link: 'https://animebytes.tv/torrents.php?searchstr=' + ywm, selector: "div.thin > div.group_cont"},
  2029. {name: "ADC", link: 'http://asiandvdclub.org/browse.php?descr=1&btnSubmit=Search%21&search=' + imdb_id, selector: "table.torrenttable:last > tbody > tr"},
  2030. {name: "AOX", link: 'https://aox.to/index.php?page=torrents&options=4&search=' + imdb_id, selector: "table.table.table-bordered:last > tbody > tr:gt(0)"},
  2031. {name: "Apollo", link: 'https://apollo.rip/torrents.php?searchstr=' + eng_title, selector:"#torrent_table:last > tbody > tr.group_torrent:gt(0)"},
  2032. {name: "AR", link: 'https://alpharatio.cc/torrents.php?searchstr=' + ywm, selector:"#torrent_table > tbody > tr:gt(0)"},
  2033. {name: "AT", link: 'https://animetorrents.me/torrents.php?search=' + eng_title, ajax: 'https://animetorrents.me/ajax/torrents_data.php?total=1&search=' + eng_title + '&SearchSubmit=&page=1' , headers:{"x-requested-with": "XMLHttpRequest"}, rewrite_href:false, selector:'table.dataTable > tbody > tr:nth-child(2)', selector_need_login:"h1.headline strong:contains('Access Denied!')"},
  2034. {name: "AVZ", link: 'https://avistaz.to/torrents?in=1&search=' + ywm, selector:"table.table-condensed.table-striped.table-bordered:last > tbody > tr:gt(0)"},
  2035. {name: "BakaBT", link: 'https://bakabt.me/browse.php?q=' + ywm, selector:"table.torrents > tbody > tr:gt(0)", selector_need_login:"#loginForm"},
  2036. {name: "BHD", link: 'https://beyond-hd.me/browse.php?incldead=0&search=' + imdb_id, selector:"table.tb_detail.grey.torrenttable:last > tbody > tr:gt(0)"},
  2037. {name: "CC", link: 'http://www.cartoonchaos.org/index.php?page=torrents&options=0&active=1&search=' + ywm, selector:"table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(2) > td > table > tbody > tr:gt(0)"},
  2038. {name: "HDF", link: 'https://hdf.world/torrents.php?searchstr=' + ywm, selector:"#torrent_table > tbody > tr:gt(0)"},
  2039. {name: "HDME", link: 'http://hdme.eu/browse.php?incldead=1&blah=1&search=' + imdb_id, selector:"table:nth-child(13) > tbody > tr"},
  2040. {name: "HDMonkey", link: 'https://hdmonkey.org/torrents-search.php?incldead=0&search=' + ywm, selector: "table.ttable_headinner > tbody > tr:gt(0)"},
  2041. {name: "HDS", link: 'https://hd-space.org/index.php?page=torrents&active=1&options=2&search=' + imdb_id, selector: "table.lista:last > tbody > tr:gt(0)"},
  2042. {name: "HDT", link: 'https://hd-torrents.org/torrents.php?active=1&options=2&search=' + imdb_id, selector: "table.mainblockcontenttt b"},
  2043. //{name: "ILC", link: 'http://www.iloveclassics.com/browse.php?searchin=2&search=' + imdb_id, selector: "#hover-over > tbody > tr.table_col1:gt(0)"},
  2044. {name: "IPT", link: 'https://iptorrents.com/t?qf=all&q=' + imdb_id, selector: "#torrents td.ac"},
  2045. {name: "JPOP", link: 'https://jpopsuki.eu/torrents.php?searchstr=' + eng_title, selector: "#torrent_table > tbody > tr:gt(0)"},
  2046. {name: "NetHD", link: 'http://nethd.org/torrents.php?incldead=1&search_area=4&search=' + imdb_id, selector: "table.table.table-bordered.torrent > tbody > tr:gt(1)"},
  2047. {name: "PHD", link: 'https://privatehd.to/torrents?in=1&search=' + ywm, selector: "table.table-condensed.table-striped.table-bordered:first > tbody > tr:gt(0)"},
  2048. {name: "PTF", link: 'http://ptfiles.net/browse.php?incldead=0&title=0&search=' + ywm, selector: "#tortable > tbody > tr.rowhead:gt(0)"},
  2049. {name: "Red", link: 'https://redacted.ch/torrents.php?searchstr=' + eng_title, selector: "#torrent_table > tbody > tr.group_torrent:gt(0)"},
  2050. {name: "SC", link: 'https://secret-cinema.pw/torrents.php?cataloguenumber=' + imdb_id, selector: "div.torrent_card"},
  2051. {name: "Speed", link: 'https://speed.cd/browse.php?d=on&search=' + imdb_id, selector: "div.boxContent > table:first >tbody > tr:gt(0)"},
  2052. {name: "TD", link: 'https://www.torrentday.com/t?q=' + imdb_id, selector: "#torrentTable td.torrentNameInfo"},
  2053. {name: "TS", link: 'https://www.torrentseeds.org/browse.php?searchin=title&incldead=0&search=%22' +eng_title +year + '%22', selector: "table.table.table-bordered > tbody > tr.browse_color:gt(0)"},
  2054. {name: "TT", link: 'https://revolutiontt.me/browse.php?search=' + imdb_id, selector: "table#torrents-table > tbody > tr:gt(0)"},
  2055. {name:"TL",type:"json",link:"https://www.torrentleech.org/torrents/browse/index/query/" + eng_title + year, ajax: "https://www.torrentleech.org/torrents/browse/list/query/" + eng_title + year, selector:"numFound > 0"},
  2056. {name: "UHD",link: 'https://uhdbits.org/torrents.php?searchstr=' + imdb_id, selector: "table.torrent_table > tbody > tr.group"},
  2057. {name: "Waffles", link: 'https://waffles.ch/browse.php?q=' + eng_title, selector: "#browsetable:last > tbody > tr:gt(0)"},
  2058. {name: "WOP", link: 'http://worldofp2p.net/browse.php?incldead=0&searchin=descr&search=' + imdb_id, selector: "table.yenitorrenttable:last > tbody > tr:gt(0)"},
  2059. ]
  2060. });
  2061. site_map.push({
  2062. name: "NZB资源",
  2063. label:[
  2064. {name: "DOGnzb", link: 'https://dognzb.cr/search?q=' + ywm,selector: "#featurebox > table > tbody > tr > td > table > tbody > tr.odd:gt(0)"},
  2065. {name: "LuluNZB", link: 'https://lulunzb.com/search/' + ywm, selector: "#browsetable > tbody > tr:gt(0)", selector_need_login:"div.login-box"},
  2066. {name: "Miatrix",link: 'https://www.miatrix.com/search/' + ywm,selector: "#browsetable > tbody > tr:gt(0)"},
  2067. {name: "NewzTown",link: 'https://newztown.co.za/search/' + ywm,selector: "#browsetable > tbody > tr:gt(0)"},
  2068. {name: "NZBCat",link: 'https://nzb.cat/search/' + ywm,selector: "#browsetable > tbody > tr:gt(0)"},
  2069. {name: "NZBgeek",link: 'https://nzbgeek.info/geekseek.php?moviesgeekseek=1&browsecategory=&browseincludewords=' + ywm,selector: "table > tbody > tr.HighlightTVRow2:gt(0)", selector_need_login:"input[value='do_login']"},
  2070. {name: "NZBP", link: 'https://nzbplanet.net/search/' + ywm, selector: "#browsetable > tbody > tr:gt(0)"},
  2071. {name: "Oznzb", link: 'https://www.oznzb.com/search/' + ywm, selector: "#browsetable > tbody > tr.ratingReportContainer:gt(0)", selector_need_login:"#login"},
  2072. {name: "SNZB", link: 'https://simplynzbs.com/search/' + ywm, selector: "#browsetable > tbody > tr:gt(0)"},
  2073. ]
  2074. });
  2075. }
  2076. if (ptzimu.trim().length > 0) {
  2077. site_map.push({
  2078. name: "PT字幕",
  2079. label:[
  2080. {name:"BYRBT®", link: "https://bt.byr.cn/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table:last > tbody > tr:gt(1)"},
  2081. {name:"CHDBits®", link: "https://chdbits.co/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table:last > tbody > tr:gt(1)"},
  2082. {name:"CMCT®", link: "https://hdcmct.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table:last > tbody > tr:gt(1)"},
  2083. {name:"FRDS®", link: "http://pt.keepfrds.com/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  2084. {name:"HDChina®", link: "https://hdchina.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table.uploaded_sub_list > tbody > tr:gt(1)"},
  2085. {name:"HDCity®", link: "https://hdcity.city/subtitles?notnewword=1&search=" + ptzimu, selector: "center > div:nth-child(1) > table > tbody > tr:nth-child(2)"},
  2086. {name:"HDHome®", link: "https://hdhome.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table:last > tbody > tr:gt(1)"},
  2087. {name:"HDSky®", link: "https://hdsky.me/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table:last > tbody > tr:gt(1)"},
  2088. {name:"HDTime®", link: "https://hdtime.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='100%'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr"},
  2089. {name:"HDU®", link: "http://pt.upxin.net/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  2090. {name:"Hyperay®", link: "https://hyperay.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  2091. {name:"JoyHD®", link: "https://www.joyhd.net/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  2092. {name:"MTeam®", link: "https://tp.m-team.cc/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table.table-subtitle-list:last > tbody > tr"},
  2093. {name:"NPUBITS®", link: "https://npupt.com/subtitles.php?notnewword=1&search=" + ptzimu, selector: "#main > table > tbody > tr:nth-child(2)"},
  2094. {name:"NYPT®", link: "https://nanyangpt.com/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  2095. {name:"OurBits®", link: "https://ourbits.club/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  2096. {name:"SJTU®", link: "https://pt.sjtu.edu.cn/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  2097. {name:"TCCF®", link: "https://et8.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  2098. {name:"TLFBits®", link: "http://pt.eastgame.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  2099. {name:"U2®", link: "https://u2.dmhy.org/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table[width='940'][border='1'][cellspacing='0'][cellpadding='5'] > tbody > tr:nth-child(2)"},
  2100. {name:"WHUPT®", link: "https://pt.whu.edu.cn/subtitles.php?notnewword=1&search=" + ptzimu, selector: "table.no-vertical-line:last > tbody > tr"},
  2101. ]
  2102. });
  2103. }
  2104. }
  2105.  
  2106. site_map.push({
  2107. name: "中文字幕",
  2108. label:[
  2109. {name:'字幕库', link:'http://www.zimuku.cn/search?q=' + title,selector:'div.box.clearfix div.item.prel.clearfix'},
  2110. {name:'字幕天堂',method:"post", link:'http://www.zmtiantang.com/e/search/',data:`keyboard=${title}&show=title&classid=1,3&tempid=1`,headers:{"Content-Type": "application/x-www-form-urlencoded"},rewrite_href:true,selector:'table.data > tbody > tr:nth-child(2)'},
  2111. {name:'字幕组', link:'http://www.zimuzu.tv/search/index?type=subtitle&keyword=' + title,selector:".search-result li"},
  2112. {name:'sub HD', link:'http://subhd.com/search/' + title,selector:"div.col-md-9 div.box"},
  2113. {name:'伪射手', link:'http://assrt.net/sub/?searchword=' + title,selector:"div.body div.subitem"},
  2114. {name:'163字幕', link:'http://www.163sub.com/Search?id=' + title,selector:"#main_narrow_bd div.subs_list"},
  2115. {name:'电波字幕', link:'http://dbfansub.com/?s=' + title,selector:"div.panel-body article.panel.panel-default.archive"},
  2116. {name:'字幕社', link:'https://www.zimushe.com/search.php?keywords=' + title,selector:"div.wrap-l li"},
  2117. {name:'中文字幕网', link:'http://www.zimuzimu.com/so_zimu.php?title=' + title,selector:"table.sublist a.othersub"},
  2118. {name:'r3sub', link:'https://r3sub.com/search.php?s=' + title,selector:"div.col-sm-8.col-md-9.col-lg-8 div.movie.movie--preview.ddd"},
  2119. {name:'HDZIMU', link:'http://www.hdzimu.com/?s=' + title,selector:'div.post-warp div.post-box'},
  2120. {name:'M1080', link:'http://zimu.m1080.com/search.asp?a=&s=' + title,selector:"table td"},
  2121. {name:'OpenSub', link:'https://www.opensubtitles.org/zh/search/sublanguageid-chi,zht,zhe,eng/imdbid-' + imdb_id,selector:"#search_results tr.change"},
  2122. ]
  2123. });
  2124.  
  2125. if(!imdb_id.match(/9999999/)){
  2126. site_map.push({
  2127. name: "英文字幕",
  2128. label:[
  2129. {name:'Addic7ed', link:'http://www.addic7ed.com/search.php?search=' + eng_title_clean + year,selector:"table.tabel tr"},
  2130. {name:'Podnapisi', link:'https://www.podnapisi.net/zh/subtitles/search/?language=zh&language=en&keywords=' + eng_title_clean + '&' + year + '-' + year,selector:"table tr.subtitle-entry"},
  2131. {name:'Subscene', link:'https://subscene.com/subtitles/release?r=true&q=' + ywm,selector:"table td.a1"},
  2132. {name:'TVsubs', link:'http://tvsubs.net/search.php?q=' + eng_title_clean,selector:"div.cont li"},
  2133. {name:'TVsubtitles', link:'http://www.tvsubtitles.net/search.php?q=' + eng_title_clean,selector:"div.left_articles li"},
  2134. {name:'YIFY', link:'http://www.yifysubtitles.com/search?q=' + eng_title_clean,selector:"div.col-sm-12 div.col-xs-12"},
  2135. ]
  2136. });
  2137. }
  2138.  
  2139. site_map.push({
  2140. name: "在线视频",
  2141. label:[
  2142. {name:'Neets', link:'http://neets.cc/search?key=' + title,selector:'#search_li_box div.search_li.clearfix'},
  2143. {name:'爱奇艺视频', link:'https://so.iqiyi.com/so/q_' + title,selector:"div.mod_result a.info_play_btn"},
  2144. {name:'次元壁', link:'http://www.ciyuan.bi/Search?keyword=' + title,selector:'div.search_left_container div.search_list_box_right'},
  2145. {name:'哈哩哈哩', link:'http://www.halihali.cc/search/?wd=' + title,selector:'#contents div.info'},
  2146. {name:'搜狐视频', link:'https://so.tv.sohu.com/mts?wd=' + title,selector:'div.wrap.cfix div.cfix.resource'},
  2147. {name:'腾讯视频', link:'https://v.qq.com/x/search/?q=' + title,selector:'div.wrapper_main div._infos'},
  2148. {name:'优酷视频', link:'http://www.soku.com/search_video/q_' + title,selector:'div.DIR div.s_info'},
  2149. {name:'AAQQS', link:'http://aaxxy.com/vod-search-pg-1-wd-' + title + '.html',selector:'#find-focus li'},
  2150. {name:'Q2电影网', link:'http://www.q2002.com/search?wd=' + title,selector:'div.container div.movie-item'},
  2151. {name:'魔力电影网', link:'http://www.magbt.net/search.php?searchword=' + title,selector:'#content li.listfl'},
  2152. {name:'小朱视频', link:'http://noad.zhuchaoli.club/search/' + title + '.html',selector:'div.b-listtab-main li.item'},
  2153. {name:'9ANIME', link:'https://www4.9anime.is/search?keyword=' + eng_title,selector:"div.film-list a.name"},
  2154. ]
  2155. });
  2156.  
  2157. site_map.push({
  2158. name: "电影资源",
  2159. label:[
  2160. {name:'52 Movie', link:'http://www.52movieba.com/search.htm?keyword=' + title,selector:'table.table.table-hover.threadlist tr.thread.tap'},
  2161. {name:'97电影网', link:'http://www.id97.com/search?q=' + title,selector:'div.container div.col-xs-7'},
  2162. {name:'爱下电影网', link:'http://www.aixia.cc/plus/search.php?searchtype=titlekeyword&q=' + title,selector:'div.con li'},
  2163. {name:'比特大雄', link:'https://www.btdx8.com/?s=' + title,selector:'#content div.post.clearfix'},
  2164. {name:'比特影视', link:'https://www.bteye.com/search/' + title,selector:'#main div.item'},
  2165. {name:'电影巴士', link:'http://www.dy8c.com/?s=' + title,selector:'#content div.post-box'},
  2166. {name:'电影首发站', link:'http://www.dysfz.cc/key/' + title + '/',selector:'.movie-list li'},
  2167. {name:'电影天堂', method:"post", link:'https://www.dy2018.com/e/search/index.php',data:`show=title%2Csmalltext&tempid=1&keyboard=${gtitle}&Submit=%C1%A2%BC%B4%CB%D1%CB%F7`,headers:{"Content-Type": "application/x-www-form-urlencoded"},rewrite_href:true, selector:'div.co_content8 table'},
  2168. {name:'嘎嘎影视', link:'http://www.gagays.xyz/movie/search?req%5Bkw%5D=' + title,selector:'#movie-sub-cont-db div.large-movie-detail'},
  2169. {name:'高清MP4', link:'http://www.99tvs.com/?s=' + title,selector:'#post_container li'},
  2170. {name:'高清电台', link:'https://gaoqing.fm/s.php?q=' + title,selector:'#result1 div.row'},
  2171. {name:'高清控', link:'http://www.gaoqingkong.com/?s=' + title,selector:'#post_container div.post_hover'},
  2172. {name:'户户盘', method:"post", link:'http://huhupan.com/e/search/index.php',data:`keyboard=${title}&show=title&tempid=1&tbname=news&mid=1&depost=search`,headers:{"Content-Type": "application/x-www-form-urlencoded"},rewrite_href:true, selector:'div.main h2'},
  2173. {name:'蓝光网', link:'http://www.languang.co/?s=' + title,selector:'div.mi_cont li'},
  2174. {name:'迷你MP4', link:'http://www.minimp4.com/search?q=' + title,selector:'div.container div.col-xs-7'},
  2175. {name:'胖鸟电影', link:'http://www.pniao.com/Mov/so/' + title,selector:'div.mainContainer div.movieFlag.eachOne'},
  2176. {name:'人生05', link:'http://www.rs05.com/search.php?s=' + title,selector:'#movielist li'},
  2177. {name:'云播网', link:'http://www.yunbowang.cn/index.php?m=vod-search&wd=' + title,selector:'div.container div.col-xs-7'},
  2178. {name:'中国高清网', link:'http://gaoqing.la/?s=' + title,selector:'div.mainleft div.post_hover'},
  2179. {name:'最新影视站', link:'http://www.zxysz.com/?s=' + title,selector:'#content li.p-item'},
  2180. ]
  2181. });
  2182.  
  2183. site_map.push({
  2184. name: "动漫内站",
  2185. label:[
  2186. {name:'ACG.RIP', link:'https://acg.rip/?term=' + title,selector:'tbody tr'},
  2187. {name:'ACG狗狗', link:'http://bt.acg.gg/search.php?keyword=' + title,selector:'tbody p.original.download'},
  2188. {name:'ACG搜', link:'http://www.acgsou.com/search.php?keyword=' + title,selector:'tbody span.bts_1'},
  2189. {name:'动漫花园', link:'https://share.dmhy.org/topics/list?keyword=' + title,selector:'tbody span.btl_1'},
  2190. {name:'爱恋动漫', link:'http://www.kisssub.org/search.php?keyword=' + title,selector:'tbody span.bts_1'},
  2191. {name:'喵搜', link:'https://nyaso.com/dong/' + title +'.html',selector:'tbody a.down'},
  2192. {name:'旋风动漫', link:'http://share.xfsub.com:88/search.php?keyword=' + title,selector:'#listTable span.bts_1'},
  2193. {name:'怡萱动漫', link:'http://www.yxdm.tv/search.html?title=' + title,selector:'div.main p.stars1'},
  2194. ]
  2195. });
  2196.  
  2197. if(!imdb_id.match(/9999999/)){
  2198. site_map.push({
  2199. name: "动漫外站",
  2200. label:[
  2201. {name:'AniDex', link:'https://anidex.info/?q=' + eng_title,selector:'div.table-responsive tr'},
  2202. {name:'AniRena', link:'https://www.anirena.com/?s=' + eng_title,selector:'#content table'},
  2203. {name:'AniTosho', link:'https://animetosho.org/search?q=' + eng_title,selector:'#content div.home_list_entry'},
  2204. {name:'Nyaa', link:'https://nyaa.si/?q=' + eng_title,selector:'div.table-responsive tr.default'},
  2205. {name:'ニャパンツ', link:'https://nyaa.pantsu.cat/search?c=_&q=' + eng_title,selector:'#torrentListResults tr.torrent-info'},
  2206. {name:'东京図书馆', link:'https://www.tokyotosho.info/search.php?terms=' + eng_title,selector:'table.listing td.desc-top'},
  2207. ]
  2208. });
  2209. }
  2210.  
  2211. site_map.push({
  2212. name: "美剧资源",
  2213. label:[
  2214. {name:'人人影视', link:'http://www.zimuzu.tv/search?type=resource&keyword=' + title,selector:"div.search-result > ul > li"},
  2215. {name:'人人美剧', link:'http://www.yyetss.com/Search/index/s_keys/' + title,selector:'div.row div.col-xs-3'},
  2216. {name:'天天美剧', link:'http://www.ttmeiju.vip/index.php/search/index.html?keyword=' + title,selector:'table.latesttable tr.Scontent1'},
  2217. {name:'爱美剧', link:'https://22v.net/search/' + title,selector:'div.movie span'},
  2218. {name:'天天看美剧', link:'http://www.msj1.com/?s=' + title,selector:'div.cat_list div.art_show_top'},
  2219. {name:'美剧粉', link:'http://www.itvfans.com/?s=' + title,selector:'#main-wrap-left div.home-blog-entry-text'},
  2220. ]
  2221. });
  2222.  
  2223. site_map.push({
  2224. name: "BT内站",
  2225. label:[
  2226. {name:'BT吧', link:'http://www.btba.com.cn/search?keyword=' + title,selector:'div.left li'},
  2227. {name:'BT蚂蚁', link:'https://www.btmyi.com/search.html?kw=' + title,selector:"div.row h5.item-title"},
  2228. {name:'BT天堂', link:'http://www.bttt.la/s.php?q=' + title,selector:'div.ml div.title'},
  2229. {name:'BT之家', link:'http://www.btbtt.co/search-index-keyword-' + title + '.htm',selector:'#threadlist table'},
  2230. {name:'RARBT', link:'http://www.rarbt.com/index.php/search/index.html?search=' + title,selector:'div.ml div.title'},
  2231. {name:'查片源', link:'https://www.chapianyuan.com/?keyword=' + title,selector:'div.block li'},
  2232. {name:'磁力猫', link:'http://www.cilimao.me/search?word=' + title,selector:'#Search__content_left___2MajJ div.MovieCard__content___3kv1W'}, // TODO check
  2233. {name:'磁力站', link:'http://oabt004.com/index/index?c=&k=' + title,selector:'div.link-list-wrapper ul.link-list'},
  2234. {name:'光影资源', link:'http://www.etdown.net/index.php?keyword=' + title,selector:'tbody.list_4 tr'},
  2235. {name:'我爱P2P', link:'http://www.woaip2p.net/topic/list?categoryId=0&title=' + title,selector:'tbody td.word-break'},
  2236. {name:'小浣熊下载', link:'https://www.xiaohx.org/search?key=' + title,selector:'div.search_right li'},
  2237. {name:'一站搜', link:'http://v.yizhansou.com/search?kw=' + title,selector:'table td.st'},
  2238. ]
  2239. });
  2240.  
  2241. if(!imdb_id.match(/9999999/)){
  2242. site_map.push({
  2243. name: "BT外站",
  2244. label:[
  2245. {name:'1337X', link:'https://1337x.to/search/' + ywm + '/1/',selector:'table.table-list.table.table-responsive.table-striped td.coll-1.name'},
  2246. {name:'BT-Scene', link:'https://bt-scene.cc/results_.php?q=' + ywm,selector:'table.tor td.tname'},
  2247. {name:'iDope', link:'https://idope.se/torrent-list/' + ywm,selector:'#div2child div.resultdiv'},
  2248. {name:'ISOHunt', link:'https://isohunt2.net/torrent/?ihq=' + ywm,selector:'#serps td.title-row'},
  2249. {name:'KickAss', link:'https://katcr.co/katsearch/page/1/' + ywm,selector:'div.table--responsive_vertical div.torrents_table__torrent_name'},
  2250. {name:'Lime', link:'https://www.limetorrents.cc/search/all/' + ywm,selector:'table.table2 div.tt-name'},
  2251. {name:'RARBG', link:'http://rarbg.is/torrents.php?search=' + imdb_id,selector:'table.lista2t tr.lista2'},
  2252. {name:'TorLock', link:'https://www.torlock2.com/all/torrents/' + ywm.replace(/ /g,"-") +'.html',selector:'table.table.table-striped.table-bordered.table-hover.table-condensed td.td'},
  2253. {name:'WorldWide', link:'https://worldwidetorrents.me/torrents-search.php?search=' + ywm,selector:'div.w3-responsive td.w3-jose'},
  2254. {name:'Zooqle', link:'https://zooqle.com/search?q=' + ywm,selector:'div.panel-body a.small'},
  2255. {name:'海盗湾', link:'https://thepiratebay.org/search/' + ywm,selector:'#searchResult div.detName'},
  2256. ]
  2257. });
  2258. }
  2259.  
  2260. function Exist_check(label) {
  2261. let site = label.name;
  2262. let psite = $(`a[data-name="${site}"]`);
  2263.  
  2264. function TagExist(link){
  2265. $(psite).css("background-color", GM_getValue("tag_bcolor_exist","#e3f1ed"));
  2266. $(psite).css("color", GM_getValue("tag_fcolor_exist","#3377aa"));
  2267. $(psite).attr("title","资源存在");
  2268. let storage_data = true;
  2269. if (label.rewrite_href && label.rewrite_href === true) { // 重写链接
  2270. storage_data = GM_getCacheValue(`${douban_id}_${site}`, link || $(psite).attr("href"),false);
  2271. $(psite).attr("href",storage_data);
  2272. }
  2273. GM_setCacheValue(`${douban_id}_${site}`,storage_data,86400 * 7 * 1e3,false);
  2274. }
  2275.  
  2276. function TagNotExist() {
  2277. $(psite).css("background-color", GM_getValue("tag_bcolor_not_exist","#f4eac2"));
  2278. $(psite).css("color", GM_getValue("tag_fcolor_not_exist","#3377aa"));
  2279. $(psite).attr("title","资源不存在");
  2280. }
  2281.  
  2282. function TagNeedLogin() {
  2283. $(psite).css("background-color", GM_getValue("tag_bcolor_need_login",""));
  2284. $(psite).css("color", GM_getValue("tag_fcolor_need_login","#3377aa"));
  2285. GM_setCacheValue(`need_login_${site}`,true, 86400 * 1e3);
  2286. $(psite).click(function () {
  2287. GM_deletedCacheValue(`need_login_${site}`);
  2288. });
  2289. $(psite).attr("title","站点需要登陆");
  2290. }
  2291.  
  2292. function TagError() {
  2293. $(psite).css("background-color", GM_getValue("tag_bcolor_error",""));
  2294. $(psite).css("color", GM_getValue("tag_fcolor_error","#3377aa"));
  2295. $(psite).attr("title", "遇到问题");
  2296. }
  2297.  
  2298.  
  2299. // 这里假定有这个资源的就一直都有,直接使用第一次请求成功的时候缓存信息
  2300. if (GM_getCacheValue(`${douban_id}_${site}`, false)) {
  2301. TagExist();
  2302. return;
  2303. }
  2304.  
  2305. // 如果前次检查到这个站点需要登陆
  2306. if (GM_getCacheValue(`need_login_${site}`, false)) {
  2307. TagNeedLogin();
  2308. return;
  2309. }
  2310.  
  2311. // 不然,则请求相关信息
  2312. $(psite).attr("title", "正在请求信息中");
  2313. GM_xmlhttpRequest({
  2314. method: label.method || "GET",
  2315. url: label.ajax || label.link,
  2316. data: label.data,
  2317. headers: label.headers,
  2318. onload: function (res) {
  2319. if (/login|verify|checkpoint|returnto/ig.test(res.finalUrl)) {
  2320. TagNeedLogin(); // 检查最终的URL看是不是需要登陆
  2321. } else if (/refresh: \d+; url=.+login.+/ig.test(res.responseHeaders)){
  2322. TagNeedLogin(); // 检查responseHeader有没有重定向
  2323. } else {
  2324. let responseText = res.responseText;
  2325. // if (label.name==="AT") {console.log(label.name);console.log(res.finalUrl);console.log(res.responseHeaders);console.log(res.responseText);}
  2326. if (typeof responseText === "undefined") {
  2327. TagNeedLogin(); // 检查最终的Text,如果什么都没有也可能说明需要登陆
  2328. } else if (responseText.length <800 && /login/.test(responseText)) {
  2329. TagNeedLogin(); // 对Text进行检查,断言“过短,且中间出现login字段”即说明可能需要登陆
  2330. } else { // 开始解析返回信息
  2331. try {
  2332. TagNotExist(); // 先断言不存在
  2333. if (label.type && label.type === "json") { // 如果前面定义了返回类型是 "json"
  2334. let par = JSON.parse(responseText);
  2335. if (eval("par." + label.selector)) {
  2336. TagExist();
  2337. }
  2338. } else { // 否则默认label.type的默认值为 html
  2339. let doc = (new DOMParser()).parseFromString(res.responseText, 'text/html');
  2340. let body = doc.querySelector("body");
  2341. // 因为jQuery的选择器丰富,故这里不用 dom.querySelector() 而用 jQuery.find()
  2342. if (label.selector_need_login && $(body).find(label.selector_need_login).length){
  2343. TagNeedLogin(); // 如果存在selector_need_login选择器,则先判断是否存在以确定是否需要登录
  2344. } else if ($(body).find(label.selector || "table.torrents:last > tbody > tr:gt(0)").length) {
  2345. TagExist(res.finalUrl); // 最后使用selector选择器判断资源是否存在
  2346. }
  2347. }
  2348. } catch (e) {
  2349. TagError();
  2350. }
  2351. }
  2352. }
  2353. },
  2354. onerror: function () {
  2355. TagError();
  2356. }
  2357. });
  2358. }
  2359.  
  2360. function site_exist_status() {
  2361. for (let i = 0; i < site_map.length; i++) {
  2362. let map_dic = site_map[i];
  2363. if (GM_getCacheValue("delete_site_" + map_dic.name,false)) {
  2364. continue;
  2365. }
  2366. $('#content div.tags').before(`<div class="c-aside name-offline" data-id="${i}"><h2><i>${map_dic.name}</i>· · · · · ·</h2><div class=c-aside-body style="padding: 0 12px;"> <ul class=bs > </ul> </div> </div>`);
  2367.  
  2368. let in_site_html = $(`div[data-id='${i}'] ul.bs`);
  2369. for (let j = 0; j < map_dic.label.length; j++) {
  2370. let label = map_dic.label[j];
  2371. if (GM_getCacheValue("delete_site_" + label.name,false)) {
  2372. continue;
  2373. }
  2374. in_site_html.append(`<a href="${label.link}" data-name="${label.name}" target="_blank" rel="nofollow" class="name-offline">${label.name}</a>`);
  2375. Exist_check(label)
  2376. }
  2377. }
  2378. }
  2379. site_exist_status();
  2380. });
  2381.  
  2382. }
Add Comment
Please, Sign In to add comment