Merge pull request #309 from the1812/preview

Hotfix for v1.10.0
This commit is contained in:
Grant Howard 2020-01-28 11:13:09 +08:00 committed by GitHub
commit b127b08b7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 143 additions and 103 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,7 @@
"auto-draw.min.js": "AE72CF2623DF2D15AD4AF82D125FFAF7EF5B1E6B36D9E9AC646AC98AA6AA8698",
"auto-play.min.js": "DC9938AC15DADDC9D88DCA0C9BE64BE142C37D32CB85E42E23DAB2A7378531E5",
"bangumi-timeline.vue.min.js": "196BC0C07AF05A2E26E84D85C7CFB5C3E2620C927572C8C22070A1AEBB5B44B3",
"batch-download.min.js": "B7ADE150F26243B9529C2F0E2EC06695ACD27678E07902A8E6EABA767BBE3DD0",
"batch-download.min.js": "862A3881DD8C246806FC3E640CF4058EDD3A86EF9C1D64B4E6F06704A7D9BA91",
"biliplus-redirect.min.js": "9882D14DAC5C103212A101A5168883C41B4B3B2737FD5F222DC343D0304FF8AF",
"blackboard.min.js": "8BB9CCDE72302AE7DE39D66F9231EFB82BA27DDA799BA4AAAC06F6DE802661BF",
"blackboard.vue.min.js": "84A30D5A6F322A3C083FC1100E9FF51233ECD08AFBD89A6449AD2388ACCC8522",
@ -32,8 +32,8 @@
"custom-control-background.min.js": "2A439B045A51D24F5115DD25995ED37E3D0371A074199FE6C727F2235F39C4D9",
"custom-navbar.min.css": "BC8741D8949DEEBD3A745292A139B639A54C43E8015D348649EF09228A1A568A",
"custom-navbar.min.html": "17FD1B1727E8D62E7997F10002FE7BF23472F390042D44DE3376A7A5A5FF2FDF",
"custom-navbar.min.js": "F36FD2CDC9F23DFF3E43C294BED7C87E1674EA7FDDCD5CB79F5BA3CA889E2D18",
"custom-navbar-activities.min.js": "56759EC7004186C0BADF9903217191C9E6035437CADF5F640DB8CBD8C5171201",
"custom-navbar.min.js": "10A4390317FA65E016F29953B0FF9FD70C7E39AAB4E883A563B3EE21B33B7249",
"custom-navbar-activities.min.js": "7CCA4AF4555CF9E9D338FE7285879C9F1396112F1FCD7293AD92EEE965E656C3",
"custom-navbar-blank.min.js": "DC2B75D5760EECD3A257785FDFBB7E5DEBF61CD9083C68DD5BCE468B093F54F3",
"custom-navbar-category.min.js": "4CF38ACE1D0501217266D1E35DFCBF9D5C1D9A3838C54D53C614878BB8CF55E2",
"custom-navbar-component.min.js": "D1B98EDF5C32D19E4A009D2303F69207B35ED35DD06E0F161E7D0BBB313F3C37",
@ -53,7 +53,6 @@
"dark-important.min.css": "8453644F7FC8BB0E9DA401DC161815E2AC198E9B4D7A5A19C29934B672F277B1",
"dark-navbar.min.css": "A2D91F11127D165571ACCC53004EDDB118CEE110F9B020D7E0541E1C8FAEA478",
"dark-schedule.min.js": "853C446547603F4F0425F19F09F73335C9EC451A790C1C07E5E5B88A09E9B453",
"dark-slice-9.min.css": "2493E0DF5E63B5FA8F3005CEBECEB7940AEABF1C8AC70A42B17A61EA0E7376CA",
"dark-styles.min.js": "C62AFBB47DDC1E2F3F45D688B0F98394E471A423BE26BF47504D5C7D069ADBA1",
"debounce.min.js": "54D33E1273C1F3FE19550BF1844339C3D54D6B01DF8A39C3162D95B93B079CFA",
"default-danmaku-settings.min.css": "D9942B184FEDA7B08CFA0C34920E97D7A83B81762DCBF757642EBB60F95FF25D",
@ -66,16 +65,16 @@
"download-audio.min.js": "1F4536DE4FF302BFD026CA17E028AF8EB037FB6D0CB355692549DECAEAE0E8C9",
"download-danmaku.min.js": "87BC2B39D99E029BB602AB2F59A387FC960D5779791524F8C26FBC0278CD8F8E",
"download-subtitle.min.js": "4B99A00FEEA40C6D577AC8BD8DFFD34D91B75E150C7848B965D58B0096DF762C",
"download-video.min.css": "1EFE5EAFB1ABCBD01F583439AB910801B23359E9C9405A0515CA4A025B1AD7AB",
"download-video.min.css": "9B7FFAC852999B11DB62B6467CDBA1AEE53B7F3FA6C592185281542B25AF527A",
"download-video.min.html": "D662FBB3C6899E75A52D15C59C53FD6966DA6E4CE463BCEFF0008D5BD3796C7F",
"download-video.min.js": "FE66E6FAAA6940E9E9A1725671225C872F8A61F48A9437D360AB59C1D126DC22",
"download-video.min.js": "6A43BC28D28CCB2B047E3E7AAF75314F0DB5B2004F75D1414D282FC3A0129888",
"download-video-package.min.js": "B10FF11DE7DFBACEC38F195B8E836511E527215B5E177CB1D223D14F30EB1435",
"dpi-img.vue.min.js": "905DD5D8071437FE1C04C3E156E61E594C676BF3928241CC52BCAFAAA0FFA089",
"expand-danmaku.min.js": "B21658C40085AEA8DC49652AE62EB8610BB2EBEAF7A9C9AF69EF3B11E08EEC8D",
"expand-description.min.css": "58C7710A50521B80F7D872BDC4C652610D84C4FABC6874BA66DA37B4F8759224",
"expand-description.min.js": "A56857AD6B1C9F431B233D188E857D30DD5A2EB644986DE32A21280B1B7BC7A7",
"favorites-redirect.min.js": "70D6ECCE0402AA76387D2A3288C1148C60CC88D5378B7A2BDC813F3F78E4EE84",
"feeds-apis.min.js": "A75F0C85EC2445C366225B552156DBCBC407197FF9A38378A21ECA7CE84FD42A",
"feeds-apis.min.js": "BDE100C6071F5ED1A12F81786F7A30717326EB1C61B7E043B4D3E7FF44F7C44B",
"feeds-filter.min.js": "10557E498B8BADA3C1C03E8C1DCD6FB24DBA2DA27A5A03BD861054F7E2989D46",
"feeds-filter-card.vue.min.js": "86697BD2E1FAB99A7C3402192CFDDFF047BCF5826238EBDDFC318A54D3C6229D",
"ffmpeg-support.min.js": "B88C5BFDC1CC582CA25098D6BA47189FF628B7323EF9F90D4CFBC4E946648927",
@ -197,13 +196,13 @@
"tweets.min.css": "9015C1F165C91B9205ABBE4E8A3B5FA83DB1EB4B5CF2442846AF61E44FF178A8",
"url-params-clean.min.js": "1B9818B2CF9405C0CC97553594BC8F190C04032D2205CFE6FAD5F93F3F62C0FF",
"v-checkbox.vue.min.js": "A23C35D5627009A29FD396A024442A19E37DEE70674BF3CE0FA377D781ED2231",
"v-dropdown.vue.min.js": "D26B4A74515F53A34A3CB0590FC9683476D99FBBBB9647FDFCBF33E265C3F662",
"v-dropdown.vue.min.js": "22D3C9C4FE98D522D5E9F3BC91E0EF3F228A8C36486CC0572A5F7770DC27A20D",
"video-card.vue.min.js": "D622CD3A5123F605A46D1CFD80B09A42B4391A6C6C9B60062A247CA3F7B33538",
"video-card-info.min.js": "13B755C0EE0CA018AE65251E168BAF3395FEA2EB4FAD6949AADD752F61B8819B",
"video-dash.min.js": "E0345C36E793F8C05E5FC83DDAB88751CD6BA28FB0A1AA63BC20FBCE330F037B",
"video-downloader-fragment.min.js": "13B755C0EE0CA018AE65251E168BAF3395FEA2EB4FAD6949AADD752F61B8819B",
"video-info.min.js": "B837809D3D2C10CD34969143DC05EDD6F24C38181CF24FD705C80B9DD6E86B94",
"video-list.vue.min.js": "6B5A16415C6C2A6B25AA58DBCE0E6DDE7F4496F567727731DD8916621F25A968",
"video-list.vue.min.js": "9F91DBF44D68C96E02B926A43617651BAE32A7095AA21F2B1073C343044877A5",
"video-story.min.js": "F9D4D2D80997DF5F11BF0CFA4D389B77BDBF1566EA6002E47174B68B440F3C0D",
"view-cover.min.js": "E4960587BFC4A219278EC300AFC8983AE4064D6FDBB42093E4EB7590726E229E",
"watchlater.min.js": "8C3C74E64A6D1B0FD5A40166FCB19981F86AF0A0E1003586DC591863C2022B18",

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(()=>{return(t,i)=>{const a=["//www.bilibili.com","//t.bilibili.com","//search.bilibili.com","//space.bilibili.com","//account.bilibili.com","//pay.bilibili.com","//member.bilibili.com","//big.bilibili.com","//message.bilibili.com","//app.bilibili.com","//passport.bilibili.com","//game.bilibili.com","//live.bilibili.com/blackboard/"];const s=["//t.bilibili.com/lottery/h5/index/#/result","//member.bilibili.com/video/upload","//space.bilibili.com/ajax/","//www.bilibili.com/h5/comment/","//www.bilibili.com/blackboard/"];const n=()=>{document.body.style.setProperty("--navbar-bounds-padding",`0 ${t.customNavbarBoundsPadding}%`);document.body.style.setProperty("--navbar-blur-opacity",(t.customNavbarBlurOpacity||.7).toString());addSettingsListener("customNavbarBlurOpacity",t=>{document.body.style.setProperty("--navbar-blur-opacity",t)})};const o=(t,i,a)=>{a.classList.toggle(t,i)};const e=t=>{dq(".custom-navbar").classList.toggle("dark",t);dq(".custom-navbar-settings").classList.toggle("dark",t)};return(()=>{if(isIframe()){return}n();const c=!(!a.some(t=>document.URL.includes(t))||s.some(t=>document.URL.includes(t)))||document.URL.includes("//www.bilibili.com/blackboard/bnj2020.html");if(c){document.body.classList.add("custom-navbar-loading");(async()=>{const a=await i.importAsync((()=>"customNavbarHtml")());document.body.insertAdjacentHTML("beforeend",a);addSettingsListener("useDarkStyle",e,true);const s=()=>dq(".custom-navbar");["Fill","Shadow","Compact","Blur"].forEach(t=>{const i="customNavbar"+t;addSettingsListener(i,i=>o(t.toLowerCase(),i,s()),true)});SpinQuery.condition(()=>dq("#banner_link,.international-header .bili-banner"),t=>t===null?false:Boolean(t.style.backgroundImage),i=>{Observer.attributes(i,()=>{const a=dqa(".custom-navbar .blur-layer");a.forEach(t=>{t.style.backgroundImage=i.style.backgroundImage;t.setAttribute("data-image",i.style.backgroundImage)});addSettingsListener("customNavbarTransparent",i=>{if(!t.hideBanner){s().classList.toggle("transparent",i)}},true);addSettingsListener("hideBanner",i=>{if(t.customNavbarTransparent){s().classList.toggle("transparent",!i)}})})});const{Blank:n}=await i.importAsync("custom-navbar-blank");const{Logo:c}=await i.importAsync("custom-navbar-logo");const{Category:r}=await i.importAsync("custom-navbar-category");const{SimpleLink:l}=await i.importAsync("custom-navbar-simple-link");const{UserInfo:m}=await i.importAsync("custom-navbar-user-info");const{SearchBox:b}=await i.importAsync("custom-navbar-search-box");const{Iframe:u}=await i.importAsync("custom-navbar-iframe");const d=[new n(1),new c,new r,new l("排行","https://www.bilibili.com/ranking","ranking"),new l("相簿","https://h.bilibili.com","drawing"),new l("音频","https://www.bilibili.com/audio/home/","music"),new u("游戏中心","https://game.bilibili.com/",{src:`https://www.bilibili.com/page-proxy/game-nav.html`,width:`680px`,height:`260px`,lazy:true,iframeName:"games"}),new u("直播","https://live.bilibili.com",{src:`https://live.bilibili.com/blackboard/dropdown-menu.html`,width:`528px`,height:`266px`,lazy:true,iframeName:"lives"}),new l("会员购","https://show.bilibili.com","shop"),new l("漫画","https://manga.bilibili.com","manga"),new n(2),new b,new m];if(getUID()){const{WatchlaterList:t}=await i.importAsync("custom-navbar-watchlater-list");const{Messages:a}=await i.importAsync("custom-navbar-messages");const{Activities:s}=await i.importAsync("custom-navbar-activities");const{Subscriptions:n}=await i.importAsync("custom-navbar-subscriptions");const{FavoritesList:o,HistoryList:e}=await i.importAsync("custom-navbar-video-list");d.push(new a,new n,new s,new t,new o,new e)}const{Upload:p}=await i.importAsync("custom-navbar-upload");d.push(new p,new n(3));new Vue({el:".custom-navbar",data:{components:d},methods:{requestPopup(t){if(!t.requestedPopup&&!t.disabled&&!t.active){this.$set(t,`requestedPopup`,true);t.initialPopup&&t.initialPopup()}t.onPopup&&t.onPopup()}},mounted(){document.body.classList.remove("custom-navbar-loading")}})})()}return{widget:{content:`\n<div class="gui-settings-flat-button" id="custom-navbar-settings">\n<i class="mdi mdi-24px mdi-auto-fix"></i>\n<span>顶栏布局</span>\n</div>`,condition:()=>c,success:async()=>{const{initSettingsPanel:t}=await i.importAsync("custom-navbar-settings");await t()}},unload:()=>{const t=dqa(".custom-navbar,.custom-navbar-settings");t.forEach(t=>t.style.display="none");i.removeStyle("customNavbarStyle")},reload:()=>{const t=dqa(".custom-navbar,.custom-navbar-settings");t.forEach(t=>t.style.display="flex");i.applyImportantStyle("customNavbarStyle")}}})()}})();
(()=>{return(t,i)=>{const a=["//www.bilibili.com","//t.bilibili.com","//search.bilibili.com","//space.bilibili.com","//account.bilibili.com","//pay.bilibili.com","//member.bilibili.com","//big.bilibili.com","//message.bilibili.com","//app.bilibili.com","//passport.bilibili.com","//game.bilibili.com","//live.bilibili.com/blackboard/"];const s=["//t.bilibili.com/vote/h5/index/#/result","//t.bilibili.com/lottery/h5/index/#/result","//member.bilibili.com/video/upload","//space.bilibili.com/ajax/","//www.bilibili.com/h5/comment/","//www.bilibili.com/blackboard/"];const o=()=>{document.body.style.setProperty("--navbar-bounds-padding",`0 ${t.customNavbarBoundsPadding}%`);document.body.style.setProperty("--navbar-blur-opacity",(t.customNavbarBlurOpacity||.7).toString());addSettingsListener("customNavbarBlurOpacity",t=>{document.body.style.setProperty("--navbar-blur-opacity",t)})};const n=(t,i,a)=>{a.classList.toggle(t,i)};const e=t=>{dq(".custom-navbar").classList.toggle("dark",t);dq(".custom-navbar-settings").classList.toggle("dark",t)};return(()=>{if(isIframe()){return}o();const c=!(!a.some(t=>document.URL.includes(t))||s.some(t=>document.URL.includes(t)))||document.URL.includes("//www.bilibili.com/blackboard/bnj2020.html");if(c){document.body.classList.add("custom-navbar-loading");(async()=>{const a=await i.importAsync("customNavbarHtml");document.body.insertAdjacentHTML("beforeend",a);addSettingsListener("useDarkStyle",e,true);const s=()=>dq(".custom-navbar");["Fill","Shadow","Compact","Blur"].forEach(t=>{const i="customNavbar"+t;addSettingsListener(i,i=>n(t.toLowerCase(),i,s()),true)});SpinQuery.condition(()=>dq("#banner_link,.international-header .bili-banner"),t=>t===null?false:Boolean(t.style.backgroundImage),i=>{Observer.attributes(i,()=>{const a=dqa(".custom-navbar .blur-layer");a.forEach(t=>{t.style.backgroundImage=i.style.backgroundImage;t.setAttribute("data-image",i.style.backgroundImage)});addSettingsListener("customNavbarTransparent",i=>{if(!t.hideBanner){s().classList.toggle("transparent",i)}},true);addSettingsListener("hideBanner",i=>{if(t.customNavbarTransparent){s().classList.toggle("transparent",!i)}})})});const{Blank:o}=await i.importAsync("custom-navbar-blank");const{Logo:c}=await i.importAsync("custom-navbar-logo");const{Category:r}=await i.importAsync("custom-navbar-category");const{SimpleLink:l}=await i.importAsync("custom-navbar-simple-link");const{UserInfo:b}=await i.importAsync("custom-navbar-user-info");const{SearchBox:m}=await i.importAsync("custom-navbar-search-box");const{Iframe:u}=await i.importAsync("custom-navbar-iframe");const d=[new o(1),new c,new r,new l("排行","https://www.bilibili.com/ranking","ranking"),new l("相簿","https://h.bilibili.com","drawing"),new l("音频","https://www.bilibili.com/audio/home/","music"),new u("游戏中心","https://game.bilibili.com/",{src:`https://www.bilibili.com/page-proxy/game-nav.html`,width:`680px`,height:`260px`,lazy:true,iframeName:"games"}),new u("直播","https://live.bilibili.com",{src:`https://live.bilibili.com/blackboard/dropdown-menu.html`,width:`528px`,height:`266px`,lazy:true,iframeName:"lives"}),new l("会员购","https://show.bilibili.com","shop"),new l("漫画","https://manga.bilibili.com","manga"),new o(2),new m,new b];if(getUID()){const{WatchlaterList:t}=await i.importAsync("custom-navbar-watchlater-list");const{Messages:a}=await i.importAsync("custom-navbar-messages");const{Activities:s}=await i.importAsync("custom-navbar-activities");const{Subscriptions:o}=await i.importAsync("custom-navbar-subscriptions");const{FavoritesList:n,HistoryList:e}=await i.importAsync("custom-navbar-video-list");d.push(new a,new o,new s,new t,new n,new e)}const{Upload:p}=await i.importAsync("custom-navbar-upload");d.push(new p,new o(3));new Vue({el:".custom-navbar",data:{components:d},methods:{requestPopup(t){if(!t.requestedPopup&&!t.disabled&&!t.active){this.$set(t,`requestedPopup`,true);t.initialPopup&&t.initialPopup()}t.onPopup&&t.onPopup()}},mounted(){document.body.classList.remove("custom-navbar-loading")}})})()}return{widget:{content:`\n<div class="gui-settings-flat-button" id="custom-navbar-settings">\n<i class="mdi mdi-24px mdi-auto-fix"></i>\n<span>顶栏布局</span>\n</div>`,condition:()=>c,success:async()=>{const{initSettingsPanel:t}=await i.importAsync("custom-navbar-settings");await t()}},unload:()=>{const t=dqa(".custom-navbar,.custom-navbar-settings");t.forEach(t=>t.style.display="none");i.removeStyle("customNavbarStyle")},reload:()=>{const t=dqa(".custom-navbar,.custom-navbar-settings");t.forEach(t=>t.style.display="flex");i.applyImportantStyle("customNavbarStyle")}}})()}})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(()=>{return(e,t)=>{const n={repost:{id:1,name:"转发"},textWithImages:{id:2,name:"图文"},text:{id:4,name:"文字"},video:{id:8,name:"视频"},miniVideo:{id:16,name:"小视频"},column:{id:64,name:"专栏"},audio:{id:256,name:"音频"},bangumi:{id:512,name:"番剧"},share:{id:2048,name:"分享"}};class r extends EventTarget{constructor(){super(...arguments);this.cards=[]}addEventListener(e,t,n){super.addEventListener(e,t,n)}removeEventListener(e,t,n){super.removeEventListener(e,t,n)}async addCard(e){if(e instanceof HTMLElement&&e.classList.contains("card")){if(e.querySelector(".skeleton")!==null){const t=Observer.childList(e,()=>{if(e.querySelector(".skeleton")===null){t.stop();this.addCard(e)}})}else{const t=await this.parseCard(e);this.cards.push(t);const n=new CustomEvent("addCard",{detail:t});this.dispatchEvent(n)}}}async removeCard(e){if(e instanceof HTMLElement&&e.classList.contains("card")){const t=(await this.parseCard(e)).id;const n=this.cards.findIndex(e=>e.id===t);const r=this.cards[n];this.cards.splice(n,1);const i=new CustomEvent("removeCard",{detail:r});this.dispatchEvent(i)}}async parseCard(e){const t=async(t,n=false)=>{const r=await SpinQuery.condition(()=>e.querySelector(t),e=>e!==null);if(r===null){console.warn(e,t);return""}const i=r.innerText.trim();if(n){const t=await SpinQuery.condition(()=>e.querySelector(".original-card-content .description"),e=>{if(e===null){return false}if(i){return true}return Boolean(e.innerText)});return t?(r.innerText+"\n"+t.innerText).trim():i}return i};const r=async e=>{const n=parseInt(await t(e));if(isNaN(n)){return 0}return n};const i=(()=>{if(e.querySelector(".repost")){return n.repost}if(e.querySelector(".imagesbox")){return n.textWithImages}if(e.querySelector(".video-container")){return n.video}if(e.querySelector(".bangumi-container")){return n.bangumi}if(e.querySelector(".article-container")){return n.column}if(e.querySelector(".music-container")){return n.audio}if(e.querySelector(".h5share-container")){return n.share}if(e.querySelector(".vc-ctnr")){return n.miniVideo}return n.text})();const a={id:e.getAttribute("data-did"),username:await t(".main-content .user-name"),text:await t(".card-content .text.description,.video-container .title,.bangumi-container .title",true),reposts:await r(".button-bar .single-button:nth-child(1) .text-offset"),comments:await r(".button-bar .single-button:nth-child(2) .text-offset"),likes:await r(".button-bar .single-button:nth-child(3) .text-offset"),element:e,type:i};e.setAttribute("data-type",i.id.toString());return a}async startWatching(){const e=await SpinQuery.select(".card-list .content");if(!e){return false}const t=[...e.querySelectorAll(".content>.card")];t.forEach(e=>this.addCard(e));Observer.childList(e,e=>{e.forEach(e=>{e.addedNodes.forEach(e=>this.addCard(e));e.removedNodes.forEach(e=>this.removeCard(e))})});return true}}const i=new r;const a=async(e="video")=>{if(!getUID()){return[]}const t=await Ajax.getJsonWithCredentials(`https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/dynamic_new?uid=${getUID()}&type_list=${e==="video"?8:512}`);if(t.code!==0){throw new Error(t.message)}if(e==="video"){return t.data.cards.map(e=>{const t=JSON.parse(e.card);const n=_.get(e,"display.topic_info.topic_details",[]).map(e=>{return{id:e.topic_id,name:e.topic_name}});return{id:e.desc.dynamic_id_str,aid:t.aid,title:t.title,upID:e.desc.user_profile.info.uid,upName:e.desc.user_profile.info.uname,upFaceUrl:e.desc.user_profile.info.face,coverUrl:t.pic,description:t.desc,timestamp:e.timestamp,time:new Date(e.timestamp*1e3),topics:n,dynamic:t.dynamic,like:formatCount(e.desc.like),duration:t.duration,durationText:formatDuration(t.duration,0),playCount:formatCount(t.stat.view),danmakuCount:formatCount(t.stat.danmaku),watchlater:store.state.watchlaterList.includes(t.aid)}})}else if(e==="bangumi"){return t.data.cards.map(e=>{const t=JSON.parse(e.card);return{id:e.desc.dynamic_id_str,aid:t.aid,epID:t.episode_id,title:t.new_desc,upName:t.apiSeasonInfo.title,upFaceUrl:t.apiSeasonInfo.cover,coverUrl:t.cover,description:"",timestamp:e.timestamp,time:new Date(e.timestamp*1e3),like:formatCount(e.desc.like),durationText:"",playCount:formatCount(t.play_count),danmakuCount:formatCount(t.bullet_count),watchlater:false}})}else{return[]}};return{export:{feedsCardsManager:i,feedsCardTypes:n,getVideoFeeds:a}}}})();
(()=>{return(e,t)=>{const n={repost:{id:1,name:"转发"},textWithImages:{id:2,name:"图文"},text:{id:4,name:"文字"},video:{id:8,name:"视频"},miniVideo:{id:16,name:"小视频"},column:{id:64,name:"专栏"},audio:{id:256,name:"音频"},bangumi:{id:512,name:"番剧"},share:{id:2048,name:"分享"}};class r extends EventTarget{constructor(){super(...arguments);this.cards=[]}addEventListener(e,t,n){super.addEventListener(e,t,n)}removeEventListener(e,t,n){super.removeEventListener(e,t,n)}async addCard(e){if(e instanceof HTMLElement&&e.classList.contains("card")){if(e.querySelector(".skeleton")!==null){const t=Observer.childList(e,()=>{if(e.querySelector(".skeleton")===null){t.stop();this.addCard(e)}})}else{const t=await this.parseCard(e);this.cards.push(t);const n=new CustomEvent("addCard",{detail:t});this.dispatchEvent(n)}}}async removeCard(e){if(e instanceof HTMLElement&&e.classList.contains("card")){const t=(await this.parseCard(e)).id;const n=this.cards.findIndex(e=>e.id===t);const r=this.cards[n];this.cards.splice(n,1);const i=new CustomEvent("removeCard",{detail:r});this.dispatchEvent(i)}}async parseCard(e){const t=async(t,n=false)=>{const r=await SpinQuery.condition(()=>e.querySelector(t),e=>e!==null);if(r===null){console.warn(e,t);return""}const i=r.innerText.trim();if(n){const t=await SpinQuery.condition(()=>e.querySelector(".original-card-content .description"),e=>{if(e===null){return false}if(i){return true}return Boolean(e.innerText)});return t?(r.innerText+"\n"+t.innerText).trim():i}return i};const r=async e=>{const n=parseInt(await t(e));if(isNaN(n)){return 0}return n};const i=(()=>{if(e.querySelector(".repost")){return n.repost}if(e.querySelector(".imagesbox")){return n.textWithImages}if(e.querySelector(".video-container")){return n.video}if(e.querySelector(".bangumi-container")){return n.bangumi}if(e.querySelector(".article-container")){return n.column}if(e.querySelector(".music-container")){return n.audio}if(e.querySelector(".h5share-container")){return n.share}if(e.querySelector(".vc-ctnr")){return n.miniVideo}return n.text})();const a={id:e.getAttribute("data-did"),username:await t(".main-content .user-name"),text:await t(".card-content .text.description,.video-container .title,.bangumi-container .title",true),reposts:await r(".button-bar .single-button:nth-child(1) .text-offset"),comments:await r(".button-bar .single-button:nth-child(2) .text-offset"),likes:await r(".button-bar .single-button:nth-child(3) .text-offset"),element:e,type:i};e.setAttribute("data-type",i.id.toString());return a}async startWatching(){const e=await SpinQuery.select(".card-list .content");if(!e){return false}const t=[...e.querySelectorAll(".content>.card")];t.forEach(e=>this.addCard(e));Observer.childList(e,e=>{e.forEach(e=>{e.addedNodes.forEach(e=>this.addCard(e));e.removedNodes.forEach(e=>this.removeCard(e))})});return true}}const i=new r;const a=async(e="video")=>{if(!getUID()){return[]}const t=await Ajax.getJsonWithCredentials(`https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/dynamic_new?uid=${getUID()}&type_list=${e==="video"?8:512}`);if(t.code!==0){throw new Error(t.message)}if(e==="video"){return t.data.cards.filter(e=>{return e.desc.orig_dy_id===0}).map(e=>{const t=JSON.parse(e.card);const n=_.get(e,"display.topic_info.topic_details",[]).map(e=>{return{id:e.topic_id,name:e.topic_name}});return{id:e.desc.dynamic_id_str,aid:t.aid,title:t.title,upID:e.desc.user_profile.info.uid,upName:e.desc.user_profile.info.uname,upFaceUrl:e.desc.user_profile.info.face,coverUrl:t.pic,description:t.desc,timestamp:e.timestamp,time:new Date(e.timestamp*1e3),topics:n,dynamic:t.dynamic,like:formatCount(e.desc.like),duration:t.duration,durationText:formatDuration(t.duration,0),playCount:formatCount(t.stat.view),danmakuCount:formatCount(t.stat.danmaku),watchlater:store.state.watchlaterList.includes(t.aid)}})}else if(e==="bangumi"){return t.data.cards.map(e=>{const t=JSON.parse(e.card);return{id:e.desc.dynamic_id_str,aid:t.aid,epID:t.episode_id,title:t.new_desc,upName:t.apiSeasonInfo.title,upFaceUrl:t.apiSeasonInfo.cover,coverUrl:t.cover,description:"",timestamp:e.timestamp,time:new Date(e.timestamp*1e3),like:formatCount(e.desc.like),durationText:"",playCount:formatCount(t.play_count),danmakuCount:formatCount(t.bullet_count),watchlater:false}})}else{return[]}};return{export:{feedsCardsManager:i,feedsCardTypes:n,getVideoFeeds:a}}}})();

View File

@ -1 +1 @@
(()=>{return(o,e)=>{const n=`<div class=v-dropdown @click=toggleDropdown()><span class=selected>{{ value }}</span><ul class=dropdown-menu :class="{ opened: dropdownOpen }"><li v-for="item in items":key=item :data-value=item @click=select(item)>{{ item }}</li></ul><i class="mdi mdi-chevron-down"></i></div>`;e.applyStyleFromText(`.v-dropdown{--background-color:#eee;position:relative;background-color:var(--background-color);cursor:pointer;display:flex;align-items:center;justify-content:space-between;min-width:100px}body.dark .v-dropdown{--background-color:#333}.v-dropdown .dropdown-menu{transform-origin:top;transform:translateY(-4px) translateX(-50%);pointer-events:none;opacity:0;position:absolute;top:calc(100% + 2px);left:50%;background-color:var(--background-color);z-index:1;transition:.2s ease-out;box-shadow:rgba(0,0,0,.2) 0 4px 8px 0}.v-dropdown .dropdown-menu.opened{transform:translateY(0) translateX(-50%);pointer-events:initial;opacity:1}.v-dropdown .dropdown-menu li{padding:4px 16px;white-space:nowrap;min-width:64px;text-align:center;cursor:pointer;color:inherit;background-color:transparent}.v-dropdown .dropdown-menu li:hover{background-color:rgba(0,0,0,.16)}.v-dropdown .mdi-chevron-down{font-size:16pt;line-height:1;transform:rotate(0)}.v-dropdown .dropdown-menu.opened~.mdi-chevron-down{transform:rotate(180deg)}.v-dropdown .selected{user-select:none;padding:4px 8px}.round-corner .v-dropdown,.round-corner .v-dropdown .dropdown-menu,.round-corner .v-dropdown .dropdown-menu li{border-radius:var(--corner-radius)}`,"v-dropdown-style");return{export:Object.assign({template:n},{props:["items","value"],data(){return{dropdownOpen:false}},methods:{toggleDropdown(){this.dropdownOpen=!this.dropdownOpen;if(this.dropdownOpen){document.addEventListener("click",o=>{const e=o.target;if(e===this.$el||this.$el.contains(e)){return}this.dropdownOpen=false},{once:true,capture:true})}},select(o){this.$emit("update:value",o);this.$emit("change",o)}}})}}})();
(()=>{return(o,e)=>{const n=`<div class=v-dropdown @click=toggleDropdown()><span class=selected>{{ value }}</span><ul class=dropdown-menu :class="{ opened: dropdownOpen }"><li v-for="item in items":key=item :data-value=item @click=select(item)>{{ item }}</li></ul><i class="mdi mdi-chevron-down"></i></div>`;e.applyStyleFromText(`.v-dropdown{--background-color:#eee;position:relative;background-color:var(--background-color);cursor:pointer;display:flex;align-items:center;justify-content:space-between;min-width:100px}body.dark .v-dropdown{--background-color:#333}.v-dropdown .dropdown-menu{transform-origin:top;transform:translateY(-4px) translateX(-50%);pointer-events:none;opacity:0;position:absolute;top:calc(100% + 2px);left:50%;background-color:var(--background-color);z-index:1;transition:.2s ease-out;box-shadow:rgba(0,0,0,.2) 0 4px 8px 0}.v-dropdown .dropdown-menu.opened{transform:translateY(0) translateX(-50%);pointer-events:initial;opacity:1}.v-dropdown .dropdown-menu li{padding:4px 16px;box-sizing:content-box;white-space:nowrap;min-width:64px;text-align:center;cursor:pointer;color:inherit;background-color:transparent}.v-dropdown .dropdown-menu li:hover{background-color:rgba(0,0,0,.16)}.v-dropdown .mdi-chevron-down{font-size:16pt;line-height:1;transform:rotate(0)}.v-dropdown .dropdown-menu.opened~.mdi-chevron-down{transform:rotate(180deg)}.v-dropdown .selected{user-select:none;padding:4px 8px}.round-corner .v-dropdown,.round-corner .v-dropdown .dropdown-menu,.round-corner .v-dropdown .dropdown-menu li{border-radius:var(--corner-radius)}`,"v-dropdown-style");return{export:Object.assign({template:n},{props:["items","value"],data(){return{dropdownOpen:false}},methods:{toggleDropdown(){this.dropdownOpen=!this.dropdownOpen;if(this.dropdownOpen){document.addEventListener("click",o=>{const e=o.target;if(e===this.$el||this.$el.contains(e)){return}this.dropdownOpen=false},{once:true,capture:true})}},select(o){this.$emit("update:value",o);this.$emit("change",o)}}})}}})();

View File

@ -1 +1 @@
(()=>{return(i,e)=>{const a=`<div class=video-list><div class=loading v-if=loading><i class="mdi mdi-18px mdi-loading mdi-spin"></i>加载中...</div><div class=cards :class="{'show-rank': showRank}"v-else-if=cards.length><video-card v-for="card of cards":key=card.id :data=card></video-card></div><div class=empty v-else>空空如也哦 = ̄ω ̄=</div></div>`;e.applyStyleFromText(`.minimal-home .video-list .empty,.minimal-home .video-list .loading{height:48px;display:flex;align-items:center;justify-content:center;font-size:11pt;color:#707070}.minimal-home .video-list .empty .mdi,.minimal-home .video-list .loading .mdi{margin-right:8px}body.dark .minimal-home .video-list .empty,body.dark .minimal-home .video-list .loading{color:#eee}.minimal-home .video-list .cards{display:flex;flex-wrap:wrap;align-items:flex-end}.minimal-home .video-list .cards.show-rank .video-card:nth-child(1),.minimal-home .video-list .cards.show-rank .video-card:nth-child(17),.minimal-home .video-list .cards.show-rank .video-card:nth-child(9){margin-top:48px}.minimal-home .video-list .cards.show-rank .video-card:nth-child(1)::before,.minimal-home .video-list .cards.show-rank .video-card:nth-child(17)::before,.minimal-home .video-list .cards.show-rank .video-card:nth-child(9)::before{position:absolute;top:-42px;left:0;font-size:14pt;font-weight:700}.minimal-home .video-list .cards.show-rank .video-card:nth-child(1)::before{content:"今日"}.minimal-home .video-list .cards.show-rank .video-card:nth-child(9)::before{content:"三日"}.minimal-home .video-list .cards.show-rank .video-card:nth-child(17)::before{content:"一周"}`,"video-list-style");return{export:Object.assign({template:a},{components:{VideoCard:()=>e.importAsync("video-card.vue")},props:["showRank"],data(){return{cards:[],loading:true}},methods:{async getRankList(){const{getTrendingVideos:i}=await e.importAsync("trending-videos");const a=async e=>{const a=await i(e);this.cards.push(...a)};await Promise.all([1,3,7].map(a))},async getActivityVideos(){const i=await Ajax.getJsonWithCredentials(`https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/dynamic_new?uid=${getUID()}&type_list=8`);if(i.code!==0){throw new Error(i.message)}this.cards=i.data.cards.map(i=>{const e=JSON.parse(i.card);const a=_.get(i,"display.topic_info.topic_details",[]).map(i=>{return{id:i.topic_id,name:i.topic_name}});return{id:i.desc.dynamic_id_str,aid:e.aid,title:e.title,upID:i.desc.user_profile.info.uid,upName:i.desc.user_profile.info.uname,upFaceUrl:i.desc.user_profile.info.face,coverUrl:e.pic,description:e.desc,timestamp:i.timestamp,time:new Date(i.timestamp*1e3),topics:a,dynamic:e.dynamic,like:formatCount(i.desc.like),duration:e.duration,durationText:formatDuration(e.duration,0),playCount:formatCount(e.stat.view),danmakuCount:formatCount(e.stat.danmaku),watchlater:true}})}},async mounted(){try{if(this.showRank){await this.getRankList()}else{await this.getActivityVideos()}}catch(i){Toast.error(i.message,this.showRank?"热门视频":"视频动态",3e3)}finally{this.loading=false}}})}}})();
(()=>{return(i,e)=>{const a=`<div class=video-list><div class=loading v-if=loading><i class="mdi mdi-18px mdi-loading mdi-spin"></i>加载中...</div><div class=cards :class="{'show-rank': showRank}"v-else-if=cards.length><video-card v-for="card of cards":key=card.id :data=card></video-card></div><div class=empty v-else>空空如也哦 = ̄ω ̄=</div></div>`;e.applyStyleFromText(`.minimal-home .video-list .empty,.minimal-home .video-list .loading{height:48px;display:flex;align-items:center;justify-content:center;font-size:11pt;color:#707070}.minimal-home .video-list .empty .mdi,.minimal-home .video-list .loading .mdi{margin-right:8px}body.dark .minimal-home .video-list .empty,body.dark .minimal-home .video-list .loading{color:#eee}.minimal-home .video-list .cards{display:flex;flex-wrap:wrap;align-items:flex-end}.minimal-home .video-list .cards.show-rank .video-card:nth-child(1),.minimal-home .video-list .cards.show-rank .video-card:nth-child(17),.minimal-home .video-list .cards.show-rank .video-card:nth-child(9){margin-top:48px}.minimal-home .video-list .cards.show-rank .video-card:nth-child(1)::before,.minimal-home .video-list .cards.show-rank .video-card:nth-child(17)::before,.minimal-home .video-list .cards.show-rank .video-card:nth-child(9)::before{position:absolute;top:-42px;left:0;font-size:14pt;font-weight:700}.minimal-home .video-list .cards.show-rank .video-card:nth-child(1)::before{content:"今日"}.minimal-home .video-list .cards.show-rank .video-card:nth-child(9)::before{content:"三日"}.minimal-home .video-list .cards.show-rank .video-card:nth-child(17)::before{content:"一周"}`,"video-list-style");return{export:Object.assign({template:a},{components:{VideoCard:()=>e.importAsync("video-card.vue")},props:["showRank"],data(){return{cards:[],loading:true}},methods:{async getRankList(){const{getTrendingVideos:i}=await e.importAsync("trending-videos");const a=async e=>{const a=await i(e);this.cards.push(...a)};await Promise.all([1,3,7].map(a))},async getActivityVideos(){const i=await Ajax.getJsonWithCredentials(`https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/dynamic_new?uid=${getUID()}&type_list=8`);if(i.code!==0){throw new Error(i.message)}this.cards=i.data.cards.filter(i=>{return i.desc.orig_dy_id===0}).map(i=>{const e=JSON.parse(i.card);const a=_.get(i,"display.topic_info.topic_details",[]).map(i=>{return{id:i.topic_id,name:i.topic_name}});return{id:i.desc.dynamic_id_str,aid:e.aid,title:e.title,upID:i.desc.user_profile.info.uid,upName:i.desc.user_profile.info.uname,upFaceUrl:i.desc.user_profile.info.face,coverUrl:e.pic,description:e.desc,timestamp:i.timestamp,time:new Date(i.timestamp*1e3),topics:a,dynamic:e.dynamic,like:formatCount(i.desc.like),duration:e.duration,durationText:formatDuration(e.duration,0),playCount:formatCount(e.stat.view),danmakuCount:formatCount(e.stat.danmaku),watchlater:true}})}},async mounted(){try{if(this.showRank){await this.getRankList()}else{await this.getActivityVideos()}}catch(i){Toast.error(i.message,this.showRank?"热门视频":"视频动态",3e3)}finally{this.loading=false}}})}}})();

View File

@ -204,7 +204,10 @@ export const getVideoFeeds = async (type: 'video' | 'bangumi' = 'video'): Promis
// '../video/watchlater-api'
// )
// const watchlaterList = await getWatchlaterList()
return json.data.cards.map(
return json.data.cards.filter((c: any) => {
// 合作视频仅取UP主的
return c.desc.orig_dy_id === 0
}).map(
(c: any): VideoCardInfo => {
const card = JSON.parse(c.card)
const topics = _.get(c, 'display.topic_info.topic_details', []).map(

View File

@ -220,7 +220,10 @@ export class Activities extends NavbarComponent {
handleJson: async function (json) {
// const { getWatchlaterList } = await import('../../video/watchlater-api')
// const watchlaterList = await getWatchlaterList()
const cards = json.data.cards.map((card: any) => {
const cards = json.data.cards.filter((c: any) => {
// 合作视频仅取UP主的
return c.desc.orig_dy_id === 0
}).map((card: any) => {
const cardJson = JSON.parse(card.card)
return {
coverUrl: cardJson.pic,

View File

@ -15,6 +15,7 @@ const supportedUrls = [
'//live.bilibili.com/blackboard/'
]
const unsupportedUrls = [
'//t.bilibili.com/vote/h5/index/#/result',
'//t.bilibili.com/lottery/h5/index/#/result',
'//member.bilibili.com/video/upload',
'//space.bilibili.com/ajax/',

View File

@ -53,40 +53,45 @@ export default {
if (json.code !== 0) {
throw new Error(json.message)
}
this.cards = json.data.cards.map(
(c: any): VideoCardInfo => {
const card = JSON.parse(c.card)
const topics = _.get(c, 'display.topic_info.topic_details', []).map(
(it: any) => {
return {
id: it.topic_id,
name: it.topic_name
this.cards = json.data.cards
.filter((c: any) => {
// UP
return c.desc.orig_dy_id === 0
})
.map(
(c: any): VideoCardInfo => {
const card = JSON.parse(c.card)
const topics = _.get(c, 'display.topic_info.topic_details', []).map(
(it: any) => {
return {
id: it.topic_id,
name: it.topic_name
}
}
)
return {
id: c.desc.dynamic_id_str,
aid: card.aid,
title: card.title,
upID: c.desc.user_profile.info.uid,
upName: c.desc.user_profile.info.uname,
upFaceUrl: c.desc.user_profile.info.face,
coverUrl: card.pic,
description: card.desc,
timestamp: c.timestamp,
time: new Date(c.timestamp * 1000),
topics,
dynamic: card.dynamic,
like: formatCount(c.desc.like),
duration: card.duration,
durationText: formatDuration(card.duration, 0),
playCount: formatCount(card.stat.view),
danmakuCount: formatCount(card.stat.danmaku),
watchlater: true
// watchlater: watchlaterList ? watchlaterList.includes(card.aid) : undefined,
}
)
return {
id: c.desc.dynamic_id_str,
aid: card.aid,
title: card.title,
upID: c.desc.user_profile.info.uid,
upName: c.desc.user_profile.info.uname,
upFaceUrl: c.desc.user_profile.info.face,
coverUrl: card.pic,
description: card.desc,
timestamp: c.timestamp,
time: new Date(c.timestamp * 1000),
topics,
dynamic: card.dynamic,
like: formatCount(c.desc.like),
duration: card.duration,
durationText: formatDuration(card.duration, 0),
playCount: formatCount(card.stat.view),
danmakuCount: formatCount(card.stat.danmaku),
watchlater: true,
// watchlater: watchlaterList ? watchlaterList.includes(card.aid) : undefined,
}
}
)
)
}
},
async mounted() {

View File

@ -31,7 +31,7 @@ abstract class Batch {
itemList: BatchItem[] = []
abstract async getItemList(): Promise<BatchItem[]>
abstract async collectData(quality: number | string): Promise<string>
formatTitle(parameters: BatchTitleParameter | undefined) {
static formatTitle(parameters: BatchTitleParameter | undefined) {
const format = settings.batchFilenameFormat
const title = formatTitle(format, true, parameters)
return escapeFilename(title, ' ')
@ -108,17 +108,18 @@ ${f.url}
}
}
class VideoEpisodeBatch extends Batch {
aid = unsafeWindow.aid!
static async test() {
if (!document.URL.includes('/www.bilibili.com/video/av')) {
return false
if (document.URL.includes('//www.bilibili.com/video/av')) {
return await SpinQuery.select('#multi_page') !== null
}
return await SpinQuery.select('#multi_page') !== null
return false
}
async getItemList() {
if (this.itemList.length > 0) {
return this.itemList
}
const api = `https://api.bilibili.com/x/web-interface/view?aid=${unsafeWindow.aid}`
const api = `https://api.bilibili.com/x/web-interface/view?aid=${this.aid}`
const json = await Ajax.getJson(api)
if (json.code !== 0) {
Toast.error(`获取视频选集列表失败, message=${json.message}`, '批量下载')
@ -137,7 +138,7 @@ class VideoEpisodeBatch extends Batch {
ep: page.part
},
cid: page.cid,
aid: unsafeWindow.aid,
aid: this.aid,
} as BatchItem
})
return this.itemList
@ -168,7 +169,7 @@ class VideoEpisodeBatch extends Batch {
result.push({
fragments,
// title: item.title.replace(/[\/\\:\*\?"<>\|]/g, ' '),
title: this.formatTitle(item.titleParameters),
title: Batch.formatTitle(item.titleParameters),
totalSize: fragments.map(it => it.size).reduce((acc, it) => acc + it),
cid: item.cid,
referer: document.URL.replace(window.location.search, '')
@ -177,6 +178,27 @@ class VideoEpisodeBatch extends Batch {
return JSON.stringify(result)
}
}
class Bnj2020Batch extends Batch {
mainVideo: VideoEpisodeBatch
spVideo: VideoEpisodeBatch
constructor(config: BatchExtractorConfig) {
super(config)
// 拜年祭就硬编码 aid 了(
this.mainVideo = new VideoEpisodeBatch(config)
this.mainVideo.aid = '78976165'
this.spVideo = new VideoEpisodeBatch(config)
this.spVideo.aid = '78979124'
}
static async test() {
return document.URL.includes('//www.bilibili.com/blackboard/bnj2020.html')
}
async getItemList() {
return (await this.mainVideo.getItemList()).concat(await this.spVideo.getItemList())
}
async collectData(quality: string | number) {
return (await this.mainVideo.collectData(quality)).concat(await this.spVideo.collectData(quality))
}
}
class BangumiBatch extends Batch {
static async test() {
return document.URL.includes('/www.bilibili.com/bangumi')
@ -242,7 +264,7 @@ class BangumiBatch extends Batch {
result.push({
fragments,
// title: item.title.replace(/[\/\\:\*\?"<>\|]/g, ' '),
title: this.formatTitle(item.titleParameters),
title: Batch.formatTitle(item.titleParameters),
totalSize: fragments.map(it => it.size).reduce((acc, it) => acc + it),
cid: item.cid,
referer: document.URL.replace(window.location.search, '')
@ -251,7 +273,7 @@ class BangumiBatch extends Batch {
return JSON.stringify(result)
}
}
const extractors = [BangumiBatch, VideoEpisodeBatch]
const extractors = [BangumiBatch, VideoEpisodeBatch, Bnj2020Batch]
let ExtractorClass: new (config: BatchExtractorConfig) => Batch
export class BatchExtractor {
config: BatchExtractorConfig
@ -299,6 +321,9 @@ export class BatchExtractor {
toast.dismiss()
return result
}
formatTitle(parameters: BatchTitleParameter | undefined) {
return Batch.formatTitle(parameters)
}
}
export default {
export: {

View File

@ -20,6 +20,8 @@
flex-direction: column;
align-items: stretch;
justify-content: space-between;
box-sizing: content-box;
line-height: normal;
&,
* {
@ -232,6 +234,7 @@
.direct-download .progress .percent {
width: 50px;
text-align: right;
font-size: 12px;
}
.actions {
display: flex;
@ -305,6 +308,7 @@
}
.selected-count {
width: 64px;
font-size: 12px;
text-align: right;
}
.aria2-rpc .mdi {

View File

@ -3,7 +3,7 @@ import { VideoInfo, DanmakuInfo } from '../video-info'
import { VideoDownloaderFragment } from './video-downloader-fragment'
import { DownloadVideoPackage } from './download-video-package'
import { VideoDash } from './video-dash'
import { BatchExtractor } from './batch-download'
import { BatchExtractor, BatchTitleParameter } from './batch-download'
interface PageData {
entity: Video
@ -596,6 +596,7 @@ async function loadPanel() {
type ExportType = 'copyLink' | 'showLink' | 'aria2' | 'aria2RPC' | 'copyVLD' | 'exportVLD' | 'ffmpegEpisodes' | 'ffmpegFragments'
interface EpisodeItem {
title: string
titleParameters?: BatchTitleParameter
checked: boolean
index: number
cid: string
@ -787,6 +788,7 @@ async function loadPanel() {
}
return match.checked
}
const batchExtractor = this.batchExtractor as BatchExtractor
const format: VideoFormat = this.getFormat()
if (this.danmakuModel.value !== '无') {
const danmakuToast = Toast.info('下载弹幕中...', '批量导出')
@ -796,14 +798,14 @@ async function loadPanel() {
for (const item of episodeList.filter(episodeFilter)) {
const danmakuInfo = new DanmakuInfo(item.cid)
await danmakuInfo.fetchInfo()
pack.add(item.title + '.xml', danmakuInfo.rawXML)
pack.add(batchExtractor.formatTitle(item.titleParameters) + '.xml', danmakuInfo.rawXML)
}
} else {
const { convertToAss } = await import('../download-danmaku')
for (const item of episodeList.filter(episodeFilter)) {
const danmakuInfo = new DanmakuInfo(item.cid)
await danmakuInfo.fetchInfo()
pack.add(item.title + '.ass', await convertToAss(danmakuInfo.rawXML))
pack.add(batchExtractor.formatTitle(item.titleParameters) + '.ass', await convertToAss(danmakuInfo.rawXML))
}
}
await pack.emit(this.cid + '.danmakus.zip')
@ -815,7 +817,6 @@ async function loadPanel() {
}
}
const toast = Toast.info('获取链接中...', '批量导出')
const batchExtractor = this.batchExtractor as BatchExtractor
batchExtractor.config.itemFilter = episodeFilter
batchExtractor.config.api = await pageData.entity.getApiGenerator(this.dash)
let result: string
@ -884,8 +885,9 @@ async function loadPanel() {
},
async checkBatch() {
const urls = [
'/www.bilibili.com/bangumi',
'/www.bilibili.com/video/av'
'//www.bilibili.com/bangumi',
'//www.bilibili.com/video/av',
'//www.bilibili.com/blackboard/bnj2020.html'
]
if (!urls.some(url => document.URL.includes(url))) {
this.batch = false
@ -905,6 +907,7 @@ async function loadPanel() {
aid: item.aid,
cid: item.cid,
title: item.title,
titleParameters: item.titleParameters,
index,
checked: true,
} as EpisodeItem

View File

@ -72,6 +72,7 @@ export default {
}
li {
padding: 4px 16px;
box-sizing: content-box;
white-space: nowrap;
min-width: 64px;
text-align: center;