fc2ppvdb-improved

fc2ppvdb.com Improved for better browsing

  1. // ==UserScript==
  2. // @name fc2ppvdb-improved
  3. // @namespace fc2ppvdb.com-improved
  4. // @version 1.0.4
  5. // @author KememChan
  6. // @icon https://www.google.com/s2/favicons?sz=32&domain_url=https%3A%2F%2Ffc2ppvdb.com%2Farticles%2F4558488
  7. // @match https://fc2ppvdb.com/*
  8. // @require https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js
  9. // @grant GM_addStyle
  10. // @grant GM_xmlhttpRequest
  11. // @description fc2ppvdb.com Improved for better browsing
  12. // ==/UserScript==
  13.  
  14. (e=>{if(typeof GM_addStyle=="function"){GM_addStyle(e);return}const t=document.createElement("style");t.textContent=e,document.head.append(t)})(' @import"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css";.resources.svelte-mhmjd3.svelte-mhmjd3{display:flex;justify-content:flex-end;gap:5px;list-style-type:none}.resources.svelte-mhmjd3>.svelte-mhmjd3{transition:transform .3s ease-in-out,color .3s ease-in-out;color:#fff}.seed.svelte-mhmjd3.svelte-mhmjd3{color:#adff2f;transition:all .3s ease-in-out}.resources.svelte-mhmjd3>.svelte-mhmjd3:hover{color:#0f0}.grid-item-wrapper.svelte-12nfdbu.svelte-12nfdbu{transition:transform .3s ease-in-out,filter .3s ease-in-out;will-change:transform,filter}.grid-item-wrapper.svelte-12nfdbu.svelte-12nfdbu:hover{animation:none;transform:scale(1.05)}.grid-item.svelte-12nfdbu.svelte-12nfdbu{position:relative;width:100%;padding-top:56.25%;overflow:hidden;transition:transform .3s ease-in-out;will-change:transform}.grid-item.svelte-12nfdbu.svelte-12nfdbu:hover{animation:none;transform:scale(1.02)}.grid-item.svelte-12nfdbu img.svelte-12nfdbu{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:contain;background-color:#1f2937;transition:filter .3s ease-in-out;will-change:filter}.grid-item.svelte-12nfdbu:hover img.svelte-12nfdbu{animation:none;filter:blur(2px) brightness(.5)}video.svelte-12nfdbu.svelte-12nfdbu{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:contain}.code.svelte-12nfdbu.svelte-12nfdbu{color:#fff;position:absolute;top:0;background-color:#1f2937e6;padding:5px;font-size:.8rem}.no-video.svelte-12nfdbu.svelte-12nfdbu{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:1.2rem;padding:10px;background-color:#000c;border-radius:8px;color:#fff;opacity:0;animation:svelte-12nfdbu-popup .3s ease-in-out forwards;will-change:transform,opacity}.flex.svelte-12nfdbu.svelte-12nfdbu{display:flex;justify-content:space-between;align-items:center;transition:transform .3s ease-in-out}.grid-item-title.svelte-12nfdbu.svelte-12nfdbu{color:#fff;font-size:14px;margin-top:5px;width:100%;transition:transform .3s ease-in-out}.title.svelte-12nfdbu.svelte-12nfdbu{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}.maker.svelte-12nfdbu.svelte-12nfdbu{color:#6495ed;transition:color .3s ease-in-out,transform .3s ease-in-out}.maker.svelte-12nfdbu.svelte-12nfdbu:hover{color:#1e90ff;transform:scale(1.1)}@keyframes svelte-12nfdbu-popup{0%{opacity:0;transform:translate(-50%,-50%) scale(.8)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@keyframes svelte-12nfdbu-flash{0%{background-color:#1f2937e6}50%{background-color:#333333e6}to{background-color:#1f2937e6}}@keyframes svelte-12nfdbu-blur{0%{filter:blur(0) brightness(1)}50%{filter:blur(1px) brightness(.7)}to{filter:blur(2px) brightness(.5)}}@keyframes svelte-12nfdbu-scale{0%{transform:scale(1)}50%{transform:scale(1.02)}to{transform:scale(1.05)}}.toggle-container.svelte-9avr2h{margin-bottom:1rem}.grid-container.svelte-9avr2h{display:grid;grid-template-columns:repeat(4,minmax(300px,1fr));gap:1rem;margin:0 auto;animation:svelte-9avr2h-fadeIn 1s ease-out forwards}.toggle-button.svelte-9avr2h{font-size:.8rem;padding:.3rem .7rem;border-radius:5px;border:.5px solid rgba(204,204,204,.5);color:#e4e4e4;background-color:#374151;cursor:pointer;transition:all .3s ease}.toggle-button.active.svelte-9avr2h{background-color:#24581d;color:#e4e4e4;border-color:#cccccc80}@media (min-width: 2000px){.grid-container.svelte-9avr2h{grid-template-columns:repeat(5,1fr);font-size:.9em}}@media (max-width: 1600px){.grid-container.svelte-9avr2h{grid-template-columns:repeat(4,1fr);font-size:.85em}}@media (max-width: 1200px){.grid-container.svelte-9avr2h{grid-template-columns:repeat(3,1fr);font-size:.8em}}@media (max-width: 900px){.grid-container.svelte-9avr2h{grid-template-columns:repeat(2,1fr);font-size:.75em}}@media (max-width: 600px){.grid-container.svelte-9avr2h{grid-template-columns:1fr;font-size:.7em}}@keyframes svelte-9avr2h-fadeIn{0%{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}div.svelte-we16u3{display:inline-block;position:relative;width:100%;height:0;padding-top:56.25%;overflow:hidden}img.svelte-we16u3,video.svelte-we16u3{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:contain;transition:filter .3s ease-in-out;background-color:#1f2937}img.svelte-we16u3:hover{filter:brightness(.5)}.no-video.svelte-we16u3{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;font-size:1.5rem} ');
  15.  
  16. (function ($) {
  17. 'use strict';
  18.  
  19. var __defProp = Object.defineProperty;
  20. var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  21. var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
  22. async function getMovieList() {
  23. const movies = $("div.flex.flex-wrap.-m-4 > *");
  24. return await Promise.all(
  25. Array.from(movies).map(
  26. async (movie) => {
  27. var _a, _b, _c, _d;
  28. return {
  29. code: $(movie).find("span").first().text().trim() || "",
  30. thumbnail: ((_a = $(movie).find("img").attr("data-src")) == null ? void 0 : _a.trim()) || ((_b = $(movie).find("img").attr("src")) == null ? void 0 : _b.trim()) || "",
  31. title: $(movie).find("div.mt-1 a:eq(0)").text().trim() || "",
  32. titleUrl: ((_c = $(movie).find("div.mt-1 a:eq(0)").attr("href")) == null ? void 0 : _c.trim()) || "",
  33. maker: $(movie).find("div.mt-1 a:eq(1)").text().trim() || "",
  34. makerUrl: ((_d = $(movie).find("div.mt-1 a:eq(1)").attr("href")) == null ? void 0 : _d.trim()) || ""
  35. };
  36. }
  37. )
  38. );
  39. }
  40. function noop() {
  41. }
  42. function is_promise(value) {
  43. return !!value && (typeof value === "object" || typeof value === "function") && typeof /** @type {any} */
  44. value.then === "function";
  45. }
  46. function run(fn) {
  47. return fn();
  48. }
  49. function blank_object() {
  50. return /* @__PURE__ */ Object.create(null);
  51. }
  52. function run_all(fns) {
  53. fns.forEach(run);
  54. }
  55. function is_function(thing) {
  56. return typeof thing === "function";
  57. }
  58. function safe_not_equal(a, b) {
  59. return a != a ? b == b : a !== b || a && typeof a === "object" || typeof a === "function";
  60. }
  61. let src_url_equal_anchor;
  62. function src_url_equal(element_src, url) {
  63. if (element_src === url) return true;
  64. if (!src_url_equal_anchor) {
  65. src_url_equal_anchor = document.createElement("a");
  66. }
  67. src_url_equal_anchor.href = url;
  68. return element_src === src_url_equal_anchor.href;
  69. }
  70. function is_empty(obj) {
  71. return Object.keys(obj).length === 0;
  72. }
  73. function action_destroyer(action_result) {
  74. return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;
  75. }
  76. function append(target, node) {
  77. target.appendChild(node);
  78. }
  79. function insert(target, node, anchor) {
  80. target.insertBefore(node, anchor || null);
  81. }
  82. function detach(node) {
  83. if (node.parentNode) {
  84. node.parentNode.removeChild(node);
  85. }
  86. }
  87. function destroy_each(iterations, detaching) {
  88. for (let i = 0; i < iterations.length; i += 1) {
  89. if (iterations[i]) iterations[i].d(detaching);
  90. }
  91. }
  92. function element(name) {
  93. return document.createElement(name);
  94. }
  95. function text(data) {
  96. return document.createTextNode(data);
  97. }
  98. function space() {
  99. return text(" ");
  100. }
  101. function empty() {
  102. return text("");
  103. }
  104. function listen(node, event, handler, options) {
  105. node.addEventListener(event, handler, options);
  106. return () => node.removeEventListener(event, handler, options);
  107. }
  108. function attr(node, attribute, value) {
  109. if (value == null) node.removeAttribute(attribute);
  110. else if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value);
  111. }
  112. function children(element2) {
  113. return Array.from(element2.childNodes);
  114. }
  115. function set_data(text2, data) {
  116. data = "" + data;
  117. if (text2.data === data) return;
  118. text2.data = /** @type {string} */
  119. data;
  120. }
  121. function set_style(node, key, value, important) {
  122. if (value == null) {
  123. node.style.removeProperty(key);
  124. } else {
  125. node.style.setProperty(key, value, "");
  126. }
  127. }
  128. function toggle_class(element2, name, toggle) {
  129. element2.classList.toggle(name, !!toggle);
  130. }
  131. let current_component;
  132. function set_current_component(component) {
  133. current_component = component;
  134. }
  135. function get_current_component() {
  136. if (!current_component) throw new Error("Function called outside component initialization");
  137. return current_component;
  138. }
  139. function onMount(fn) {
  140. get_current_component().$$.on_mount.push(fn);
  141. }
  142. const dirty_components = [];
  143. const binding_callbacks = [];
  144. let render_callbacks = [];
  145. const flush_callbacks = [];
  146. const resolved_promise = /* @__PURE__ */ Promise.resolve();
  147. let update_scheduled = false;
  148. function schedule_update() {
  149. if (!update_scheduled) {
  150. update_scheduled = true;
  151. resolved_promise.then(flush);
  152. }
  153. }
  154. function add_render_callback(fn) {
  155. render_callbacks.push(fn);
  156. }
  157. const seen_callbacks = /* @__PURE__ */ new Set();
  158. let flushidx = 0;
  159. function flush() {
  160. if (flushidx !== 0) {
  161. return;
  162. }
  163. const saved_component = current_component;
  164. do {
  165. try {
  166. while (flushidx < dirty_components.length) {
  167. const component = dirty_components[flushidx];
  168. flushidx++;
  169. set_current_component(component);
  170. update(component.$$);
  171. }
  172. } catch (e) {
  173. dirty_components.length = 0;
  174. flushidx = 0;
  175. throw e;
  176. }
  177. set_current_component(null);
  178. dirty_components.length = 0;
  179. flushidx = 0;
  180. while (binding_callbacks.length) binding_callbacks.pop()();
  181. for (let i = 0; i < render_callbacks.length; i += 1) {
  182. const callback = render_callbacks[i];
  183. if (!seen_callbacks.has(callback)) {
  184. seen_callbacks.add(callback);
  185. callback();
  186. }
  187. }
  188. render_callbacks.length = 0;
  189. } while (dirty_components.length);
  190. while (flush_callbacks.length) {
  191. flush_callbacks.pop()();
  192. }
  193. update_scheduled = false;
  194. seen_callbacks.clear();
  195. set_current_component(saved_component);
  196. }
  197. function update($$) {
  198. if ($$.fragment !== null) {
  199. $$.update();
  200. run_all($$.before_update);
  201. const dirty = $$.dirty;
  202. $$.dirty = [-1];
  203. $$.fragment && $$.fragment.p($$.ctx, dirty);
  204. $$.after_update.forEach(add_render_callback);
  205. }
  206. }
  207. function flush_render_callbacks(fns) {
  208. const filtered = [];
  209. const targets = [];
  210. render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c));
  211. targets.forEach((c) => c());
  212. render_callbacks = filtered;
  213. }
  214. const outroing = /* @__PURE__ */ new Set();
  215. let outros;
  216. function group_outros() {
  217. outros = {
  218. r: 0,
  219. c: [],
  220. p: outros
  221. // parent group
  222. };
  223. }
  224. function check_outros() {
  225. if (!outros.r) {
  226. run_all(outros.c);
  227. }
  228. outros = outros.p;
  229. }
  230. function transition_in(block, local) {
  231. if (block && block.i) {
  232. outroing.delete(block);
  233. block.i(local);
  234. }
  235. }
  236. function transition_out(block, local, detach2, callback) {
  237. if (block && block.o) {
  238. if (outroing.has(block)) return;
  239. outroing.add(block);
  240. outros.c.push(() => {
  241. outroing.delete(block);
  242. if (callback) {
  243. if (detach2) block.d(1);
  244. callback();
  245. }
  246. });
  247. block.o(local);
  248. } else if (callback) {
  249. callback();
  250. }
  251. }
  252. function handle_promise(promise, info) {
  253. const token = info.token = {};
  254. function update2(type, index, key, value) {
  255. if (info.token !== token) return;
  256. info.resolved = value;
  257. let child_ctx = info.ctx;
  258. if (key !== void 0) {
  259. child_ctx = child_ctx.slice();
  260. child_ctx[key] = value;
  261. }
  262. const block = type && (info.current = type)(child_ctx);
  263. let needs_flush = false;
  264. if (info.block) {
  265. if (info.blocks) {
  266. info.blocks.forEach((block2, i) => {
  267. if (i !== index && block2) {
  268. group_outros();
  269. transition_out(block2, 1, 1, () => {
  270. if (info.blocks[i] === block2) {
  271. info.blocks[i] = null;
  272. }
  273. });
  274. check_outros();
  275. }
  276. });
  277. } else {
  278. info.block.d(1);
  279. }
  280. block.c();
  281. transition_in(block, 1);
  282. block.m(info.mount(), info.anchor);
  283. needs_flush = true;
  284. }
  285. info.block = block;
  286. if (info.blocks) info.blocks[index] = block;
  287. if (needs_flush) {
  288. flush();
  289. }
  290. }
  291. if (is_promise(promise)) {
  292. const current_component2 = get_current_component();
  293. promise.then(
  294. (value) => {
  295. set_current_component(current_component2);
  296. update2(info.then, 1, info.value, value);
  297. set_current_component(null);
  298. },
  299. (error) => {
  300. set_current_component(current_component2);
  301. update2(info.catch, 2, info.error, error);
  302. set_current_component(null);
  303. if (!info.hasCatch) {
  304. throw error;
  305. }
  306. }
  307. );
  308. if (info.current !== info.pending) {
  309. update2(info.pending, 0);
  310. return true;
  311. }
  312. } else {
  313. if (info.current !== info.then) {
  314. update2(info.then, 1, info.value, promise);
  315. return true;
  316. }
  317. info.resolved = /** @type {T} */
  318. promise;
  319. }
  320. }
  321. function update_await_block_branch(info, ctx, dirty) {
  322. const child_ctx = ctx.slice();
  323. const { resolved } = info;
  324. if (info.current === info.then) {
  325. child_ctx[info.value] = resolved;
  326. }
  327. if (info.current === info.catch) {
  328. child_ctx[info.error] = resolved;
  329. }
  330. info.block.p(child_ctx, dirty);
  331. }
  332. function ensure_array_like(array_like_or_iterator) {
  333. return (array_like_or_iterator == null ? void 0 : array_like_or_iterator.length) !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator);
  334. }
  335. function create_component(block) {
  336. block && block.c();
  337. }
  338. function mount_component(component, target, anchor) {
  339. const { fragment, after_update } = component.$$;
  340. fragment && fragment.m(target, anchor);
  341. add_render_callback(() => {
  342. const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);
  343. if (component.$$.on_destroy) {
  344. component.$$.on_destroy.push(...new_on_destroy);
  345. } else {
  346. run_all(new_on_destroy);
  347. }
  348. component.$$.on_mount = [];
  349. });
  350. after_update.forEach(add_render_callback);
  351. }
  352. function destroy_component(component, detaching) {
  353. const $$ = component.$$;
  354. if ($$.fragment !== null) {
  355. flush_render_callbacks($$.after_update);
  356. run_all($$.on_destroy);
  357. $$.fragment && $$.fragment.d(detaching);
  358. $$.on_destroy = $$.fragment = null;
  359. $$.ctx = [];
  360. }
  361. }
  362. function make_dirty(component, i) {
  363. if (component.$$.dirty[0] === -1) {
  364. dirty_components.push(component);
  365. schedule_update();
  366. component.$$.dirty.fill(0);
  367. }
  368. component.$$.dirty[i / 31 | 0] |= 1 << i % 31;
  369. }
  370. function init(component, options, instance2, create_fragment2, not_equal, props, append_styles = null, dirty = [-1]) {
  371. const parent_component = current_component;
  372. set_current_component(component);
  373. const $$ = component.$$ = {
  374. fragment: null,
  375. ctx: [],
  376. // state
  377. props,
  378. update: noop,
  379. not_equal,
  380. bound: blank_object(),
  381. // lifecycle
  382. on_mount: [],
  383. on_destroy: [],
  384. on_disconnect: [],
  385. before_update: [],
  386. after_update: [],
  387. context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
  388. // everything else
  389. callbacks: blank_object(),
  390. dirty,
  391. skip_bound: false,
  392. root: options.target || parent_component.$$.root
  393. };
  394. append_styles && append_styles($$.root);
  395. let ready = false;
  396. $$.ctx = instance2 ? instance2(component, options.props || {}, (i, ret, ...rest) => {
  397. const value = rest.length ? rest[0] : ret;
  398. if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
  399. if (!$$.skip_bound && $$.bound[i]) $$.bound[i](value);
  400. if (ready) make_dirty(component, i);
  401. }
  402. return ret;
  403. }) : [];
  404. $$.update();
  405. ready = true;
  406. run_all($$.before_update);
  407. $$.fragment = create_fragment2 ? create_fragment2($$.ctx) : false;
  408. if (options.target) {
  409. if (options.hydrate) {
  410. const nodes = children(options.target);
  411. $$.fragment && $$.fragment.l(nodes);
  412. nodes.forEach(detach);
  413. } else {
  414. $$.fragment && $$.fragment.c();
  415. }
  416. if (options.intro) transition_in(component.$$.fragment);
  417. mount_component(component, options.target, options.anchor);
  418. flush();
  419. }
  420. set_current_component(parent_component);
  421. }
  422. class SvelteComponent {
  423. constructor() {
  424. /**
  425. * ### PRIVATE API
  426. *
  427. * Do not use, may change at any time
  428. *
  429. * @type {any}
  430. */
  431. __publicField(this, "$$");
  432. /**
  433. * ### PRIVATE API
  434. *
  435. * Do not use, may change at any time
  436. *
  437. * @type {any}
  438. */
  439. __publicField(this, "$$set");
  440. }
  441. /** @returns {void} */
  442. $destroy() {
  443. destroy_component(this, 1);
  444. this.$destroy = noop;
  445. }
  446. /**
  447. * @template {Extract<keyof Events, string>} K
  448. * @param {K} type
  449. * @param {((e: Events[K]) => void) | null | undefined} callback
  450. * @returns {() => void}
  451. */
  452. $on(type, callback) {
  453. if (!is_function(callback)) {
  454. return noop;
  455. }
  456. const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
  457. callbacks.push(callback);
  458. return () => {
  459. const index = callbacks.indexOf(callback);
  460. if (index !== -1) callbacks.splice(index, 1);
  461. };
  462. }
  463. /**
  464. * @param {Partial<Props>} props
  465. * @returns {void}
  466. */
  467. $set(props) {
  468. if (this.$$set && !is_empty(props)) {
  469. this.$$.skip_bound = true;
  470. this.$$set(props);
  471. this.$$.skip_bound = false;
  472. }
  473. }
  474. }
  475. const PUBLIC_VERSION = "4";
  476. if (typeof window !== "undefined")
  477. (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(PUBLIC_VERSION);
  478. var _GM_xmlhttpRequest = /* @__PURE__ */ (() => typeof GM_xmlhttpRequest != "undefined" ? GM_xmlhttpRequest : void 0)();
  479. async function getThumb(code) {
  480. let url = `https://javtiful.com/channel/fc2ppv?q=${code}`;
  481. try {
  482. const responseText = await new Promise((resolve, reject) => {
  483. _GM_xmlhttpRequest({
  484. url,
  485. method: "GET",
  486. onload: (response) => resolve(response.responseText),
  487. onerror: reject
  488. });
  489. });
  490. const $responseText = $(responseText);
  491. const $row = $responseText.find("div.row.row-cols-1.row-cols-sm-2");
  492. const $contains = $row.find(`div:contains('${code}')`).first();
  493. const $img = $contains.find("img").attr("data-src");
  494. return $img;
  495. } catch (error) {
  496. console.error("Error fetching thumbnail:", error);
  497. return null;
  498. }
  499. }
  500. const videoPreviewCache = {};
  501. async function getVideoPreview(code, missav) {
  502. let url = `https://123av.com/en/search?keyword=${code}`;
  503. if (missav) {
  504. url = `https://missav.ws/en/search/${code}`;
  505. }
  506. if (videoPreviewCache[url] !== void 0) {
  507. return videoPreviewCache[url];
  508. }
  509. try {
  510. const responseText = await new Promise((resolve, reject) => {
  511. _GM_xmlhttpRequest({
  512. url,
  513. method: "GET",
  514. onload: (response) => resolve(response.responseText),
  515. onerror: reject
  516. });
  517. });
  518. const $responseText = $(responseText);
  519. let previewUrl;
  520. if (missav) {
  521. const $gridFirst = $responseText.find("div.grid.grid-cols-2").first();
  522. previewUrl = $gridFirst.find("video").attr("data-src");
  523. } else {
  524. const $gridFirst = $responseText.find("div.col-6.col-sm-4.col-lg-3").first();
  525. previewUrl = $gridFirst.find("div.thumb").attr("data-preview");
  526. if (!previewUrl) {
  527. return await getVideoPreview(code, true);
  528. }
  529. }
  530. if (previewUrl) {
  531. const previewBlob = await new Promise((resolve, reject) => {
  532. _GM_xmlhttpRequest({
  533. url: previewUrl,
  534. responseType: "blob",
  535. onload: (r) => resolve(r.response),
  536. onerror: reject
  537. });
  538. });
  539. const blobUrl = URL.createObjectURL(previewBlob);
  540. videoPreviewCache[url] = blobUrl;
  541. return blobUrl;
  542. } else {
  543. videoPreviewCache[url] = null;
  544. return null;
  545. }
  546. } catch (error) {
  547. console.error("Error fetching video preview:", error);
  548. videoPreviewCache[url] = null;
  549. return null;
  550. }
  551. }
  552. function create_if_block$2(ctx) {
  553. let a0;
  554. let i0;
  555. let a0_href_value;
  556. let t0;
  557. let a1;
  558. let i1;
  559. let a1_href_value;
  560. let t1;
  561. let a2;
  562. let i2;
  563. let a2_href_value;
  564. let t2;
  565. let a3;
  566. let i3;
  567. let a3_href_value;
  568. let t3;
  569. let a4;
  570. let i4;
  571. let t4;
  572. let a5;
  573. let i5;
  574. let t5;
  575. let button;
  576. let t6;
  577. return {
  578. c() {
  579. a0 = element("a");
  580. i0 = element("i");
  581. t0 = space();
  582. a1 = element("a");
  583. i1 = element("i");
  584. t1 = space();
  585. a2 = element("a");
  586. i2 = element("i");
  587. t2 = space();
  588. a3 = element("a");
  589. i3 = element("i");
  590. t3 = space();
  591. a4 = element("a");
  592. i4 = element("i");
  593. t4 = space();
  594. a5 = element("a");
  595. i5 = element("i");
  596. t5 = space();
  597. button = element("button");
  598. t6 = text(
  599. /*seed*/
  600. ctx[3]
  601. );
  602. attr(i0, "class", "fa-solid fa-globe");
  603. attr(i0, "aria-hidden", "true");
  604. attr(a0, "class", "missav svelte-mhmjd3");
  605. attr(a0, "href", a0_href_value = "https://missav.ws/en/search/" + /*code*/
  606. ctx[0]);
  607. attr(a0, "target", "_blank");
  608. attr(a0, "rel", "noopener");
  609. attr(a0, "title", "Search on MissAV");
  610. attr(i1, "class", "fa-solid fa-globe");
  611. attr(i1, "aria-hidden", "true");
  612. attr(a1, "class", "njav svelte-mhmjd3");
  613. attr(a1, "href", a1_href_value = "https://123av.com/en/search?keyword=" + /*code*/
  614. ctx[0]);
  615. attr(a1, "target", "_blank");
  616. attr(a1, "rel", "noopener");
  617. attr(a1, "title", "Search on Njav");
  618. attr(i2, "class", "fa-solid fa-image");
  619. attr(i2, "aria-hidden", "true");
  620. attr(a2, "href", a2_href_value = "https://img.javstore.net/search/images/?q=" + /*code*/
  621. ctx[0]);
  622. attr(a2, "target", "_blank");
  623. attr(a2, "rel", "noopener");
  624. attr(a2, "title", "Search Images");
  625. attr(a2, "class", "svelte-mhmjd3");
  626. attr(i3, "class", "fa-solid fa-magnifying-glass");
  627. attr(i3, "aria-hidden", "true");
  628. attr(a3, "class", "sukebei svelte-mhmjd3");
  629. attr(a3, "href", a3_href_value = "https://sukebei.nyaa.si/?f=0&c=0_0&q=" + /*code*/
  630. ctx[0] + "&s=seeders&o=desc");
  631. attr(a3, "target", "_blank");
  632. attr(a3, "rel", "noopener");
  633. attr(a3, "title", "Search on Sukebei");
  634. attr(i4, "class", "fa-solid fa-arrow-down");
  635. attr(i4, "aria-hidden", "true");
  636. attr(a4, "class", "torrent svelte-mhmjd3");
  637. attr(
  638. a4,
  639. "href",
  640. /*torrent*/
  641. ctx[1]
  642. );
  643. attr(a4, "rel", "noopener");
  644. attr(a4, "title", "Download Torrent");
  645. attr(i5, "class", "fa-solid fa-magnet");
  646. attr(i5, "aria-hidden", "true");
  647. attr(a5, "class", "magnet svelte-mhmjd3");
  648. attr(
  649. a5,
  650. "href",
  651. /*magnet*/
  652. ctx[2]
  653. );
  654. attr(a5, "rel", "noopener");
  655. attr(a5, "title", "Download with Magnet");
  656. attr(button, "class", "seed svelte-mhmjd3");
  657. attr(button, "type", "button");
  658. },
  659. m(target, anchor) {
  660. insert(target, a0, anchor);
  661. append(a0, i0);
  662. insert(target, t0, anchor);
  663. insert(target, a1, anchor);
  664. append(a1, i1);
  665. insert(target, t1, anchor);
  666. insert(target, a2, anchor);
  667. append(a2, i2);
  668. insert(target, t2, anchor);
  669. insert(target, a3, anchor);
  670. append(a3, i3);
  671. insert(target, t3, anchor);
  672. insert(target, a4, anchor);
  673. append(a4, i4);
  674. insert(target, t4, anchor);
  675. insert(target, a5, anchor);
  676. append(a5, i5);
  677. insert(target, t5, anchor);
  678. insert(target, button, anchor);
  679. append(button, t6);
  680. },
  681. p(ctx2, dirty) {
  682. if (dirty & /*code*/
  683. 1 && a0_href_value !== (a0_href_value = "https://missav.ws/en/search/" + /*code*/
  684. ctx2[0])) {
  685. attr(a0, "href", a0_href_value);
  686. }
  687. if (dirty & /*code*/
  688. 1 && a1_href_value !== (a1_href_value = "https://123av.com/en/search?keyword=" + /*code*/
  689. ctx2[0])) {
  690. attr(a1, "href", a1_href_value);
  691. }
  692. if (dirty & /*code*/
  693. 1 && a2_href_value !== (a2_href_value = "https://img.javstore.net/search/images/?q=" + /*code*/
  694. ctx2[0])) {
  695. attr(a2, "href", a2_href_value);
  696. }
  697. if (dirty & /*code*/
  698. 1 && a3_href_value !== (a3_href_value = "https://sukebei.nyaa.si/?f=0&c=0_0&q=" + /*code*/
  699. ctx2[0] + "&s=seeders&o=desc")) {
  700. attr(a3, "href", a3_href_value);
  701. }
  702. if (dirty & /*torrent*/
  703. 2) {
  704. attr(
  705. a4,
  706. "href",
  707. /*torrent*/
  708. ctx2[1]
  709. );
  710. }
  711. if (dirty & /*magnet*/
  712. 4) {
  713. attr(
  714. a5,
  715. "href",
  716. /*magnet*/
  717. ctx2[2]
  718. );
  719. }
  720. if (dirty & /*seed*/
  721. 8) set_data(
  722. t6,
  723. /*seed*/
  724. ctx2[3]
  725. );
  726. },
  727. d(detaching) {
  728. if (detaching) {
  729. detach(a0);
  730. detach(t0);
  731. detach(a1);
  732. detach(t1);
  733. detach(a2);
  734. detach(t2);
  735. detach(a3);
  736. detach(t3);
  737. detach(a4);
  738. detach(t4);
  739. detach(a5);
  740. detach(t5);
  741. detach(button);
  742. }
  743. }
  744. };
  745. }
  746. function create_fragment$3(ctx) {
  747. let li;
  748. let if_block = (
  749. /*torrent*/
  750. ctx[1] && create_if_block$2(ctx)
  751. );
  752. return {
  753. c() {
  754. li = element("li");
  755. if (if_block) if_block.c();
  756. attr(li, "class", "resources svelte-mhmjd3");
  757. },
  758. m(target, anchor) {
  759. insert(target, li, anchor);
  760. if (if_block) if_block.m(li, null);
  761. },
  762. p(ctx2, [dirty]) {
  763. if (
  764. /*torrent*/
  765. ctx2[1]
  766. ) {
  767. if (if_block) {
  768. if_block.p(ctx2, dirty);
  769. } else {
  770. if_block = create_if_block$2(ctx2);
  771. if_block.c();
  772. if_block.m(li, null);
  773. }
  774. } else if (if_block) {
  775. if_block.d(1);
  776. if_block = null;
  777. }
  778. },
  779. i: noop,
  780. o: noop,
  781. d(detaching) {
  782. if (detaching) {
  783. detach(li);
  784. }
  785. if (if_block) if_block.d();
  786. }
  787. };
  788. }
  789. function instance$3($$self, $$props, $$invalidate) {
  790. let { code } = $$props;
  791. let { torrent } = $$props;
  792. let { magnet } = $$props;
  793. let { seed } = $$props;
  794. $$self.$$set = ($$props2) => {
  795. if ("code" in $$props2) $$invalidate(0, code = $$props2.code);
  796. if ("torrent" in $$props2) $$invalidate(1, torrent = $$props2.torrent);
  797. if ("magnet" in $$props2) $$invalidate(2, magnet = $$props2.magnet);
  798. if ("seed" in $$props2) $$invalidate(3, seed = $$props2.seed);
  799. };
  800. return [code, torrent, magnet, seed];
  801. }
  802. class Resources extends SvelteComponent {
  803. constructor(options) {
  804. super();
  805. init(this, options, instance$3, create_fragment$3, safe_not_equal, { code: 0, torrent: 1, magnet: 2, seed: 3 });
  806. }
  807. }
  808. function create_if_block_2$1(ctx) {
  809. let await_block_anchor;
  810. let promise;
  811. let info = {
  812. ctx,
  813. current: null,
  814. token: null,
  815. hasCatch: false,
  816. pending: create_pending_block_1,
  817. then: create_then_block_1,
  818. catch: create_catch_block_1,
  819. value: 13
  820. };
  821. handle_promise(promise = getThumb(
  822. /*movie*/
  823. ctx[1].code
  824. ), info);
  825. return {
  826. c() {
  827. await_block_anchor = empty();
  828. info.block.c();
  829. },
  830. m(target, anchor) {
  831. insert(target, await_block_anchor, anchor);
  832. info.block.m(target, info.anchor = anchor);
  833. info.mount = () => await_block_anchor.parentNode;
  834. info.anchor = await_block_anchor;
  835. },
  836. p(new_ctx, dirty) {
  837. ctx = new_ctx;
  838. info.ctx = ctx;
  839. if (dirty & /*movie*/
  840. 2 && promise !== (promise = getThumb(
  841. /*movie*/
  842. ctx[1].code
  843. )) && handle_promise(promise, info)) ;
  844. else {
  845. update_await_block_branch(info, ctx, dirty);
  846. }
  847. },
  848. d(detaching) {
  849. if (detaching) {
  850. detach(await_block_anchor);
  851. }
  852. info.block.d(detaching);
  853. info.token = null;
  854. info = null;
  855. }
  856. };
  857. }
  858. function create_catch_block_1(ctx) {
  859. return { c: noop, m: noop, p: noop, d: noop };
  860. }
  861. function create_then_block_1(ctx) {
  862. let img;
  863. let img_src_value;
  864. let img_alt_value;
  865. return {
  866. c() {
  867. var _a;
  868. img = element("img");
  869. if (!src_url_equal(img.src, img_src_value = /*thumbnail*/
  870. ((_a = ctx[13]) == null ? void 0 : _a.toString()) ?? /*movie*/
  871. ctx[1].thumbnail)) attr(img, "src", img_src_value);
  872. attr(img, "alt", img_alt_value = /*movie*/
  873. ctx[1].title);
  874. attr(img, "loading", "lazy");
  875. attr(img, "class", "svelte-12nfdbu");
  876. },
  877. m(target, anchor) {
  878. insert(target, img, anchor);
  879. },
  880. p(ctx2, dirty) {
  881. var _a;
  882. if (dirty & /*movie*/
  883. 2 && !src_url_equal(img.src, img_src_value = /*thumbnail*/
  884. ((_a = ctx2[13]) == null ? void 0 : _a.toString()) ?? /*movie*/
  885. ctx2[1].thumbnail)) {
  886. attr(img, "src", img_src_value);
  887. }
  888. if (dirty & /*movie*/
  889. 2 && img_alt_value !== (img_alt_value = /*movie*/
  890. ctx2[1].title)) {
  891. attr(img, "alt", img_alt_value);
  892. }
  893. },
  894. d(detaching) {
  895. if (detaching) {
  896. detach(img);
  897. }
  898. }
  899. };
  900. }
  901. function create_pending_block_1(ctx) {
  902. return { c: noop, m: noop, p: noop, d: noop };
  903. }
  904. function create_if_block$1(ctx) {
  905. let await_block_anchor;
  906. let promise;
  907. let info = {
  908. ctx,
  909. current: null,
  910. token: null,
  911. hasCatch: false,
  912. pending: create_pending_block$1,
  913. then: create_then_block$1,
  914. catch: create_catch_block$1,
  915. value: 12
  916. };
  917. handle_promise(promise = getVideoPreview(
  918. /*movie*/
  919. ctx[1].code,
  920. false
  921. ), info);
  922. return {
  923. c() {
  924. await_block_anchor = empty();
  925. info.block.c();
  926. },
  927. m(target, anchor) {
  928. insert(target, await_block_anchor, anchor);
  929. info.block.m(target, info.anchor = anchor);
  930. info.mount = () => await_block_anchor.parentNode;
  931. info.anchor = await_block_anchor;
  932. },
  933. p(new_ctx, dirty) {
  934. ctx = new_ctx;
  935. info.ctx = ctx;
  936. if (dirty & /*movie*/
  937. 2 && promise !== (promise = getVideoPreview(
  938. /*movie*/
  939. ctx[1].code,
  940. false
  941. )) && handle_promise(promise, info)) ;
  942. else {
  943. update_await_block_branch(info, ctx, dirty);
  944. }
  945. },
  946. d(detaching) {
  947. if (detaching) {
  948. detach(await_block_anchor);
  949. }
  950. info.block.d(detaching);
  951. info.token = null;
  952. info = null;
  953. }
  954. };
  955. }
  956. function create_catch_block$1(ctx) {
  957. return { c: noop, m: noop, p: noop, d: noop };
  958. }
  959. function create_then_block$1(ctx) {
  960. let if_block_anchor;
  961. function select_block_type(ctx2, dirty) {
  962. if (
  963. /*videoPreview*/
  964. ctx2[12]
  965. ) return create_if_block_1$1;
  966. return create_else_block$1;
  967. }
  968. let current_block_type = select_block_type(ctx);
  969. let if_block = current_block_type(ctx);
  970. return {
  971. c() {
  972. if_block.c();
  973. if_block_anchor = empty();
  974. },
  975. m(target, anchor) {
  976. if_block.m(target, anchor);
  977. insert(target, if_block_anchor, anchor);
  978. },
  979. p(ctx2, dirty) {
  980. if (current_block_type === (current_block_type = select_block_type(ctx2)) && if_block) {
  981. if_block.p(ctx2, dirty);
  982. } else {
  983. if_block.d(1);
  984. if_block = current_block_type(ctx2);
  985. if (if_block) {
  986. if_block.c();
  987. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  988. }
  989. }
  990. },
  991. d(detaching) {
  992. if (detaching) {
  993. detach(if_block_anchor);
  994. }
  995. if_block.d(detaching);
  996. }
  997. };
  998. }
  999. function create_else_block$1(ctx) {
  1000. let p;
  1001. return {
  1002. c() {
  1003. p = element("p");
  1004. p.textContent = "No Preview 😭";
  1005. attr(p, "class", "no-video svelte-12nfdbu");
  1006. },
  1007. m(target, anchor) {
  1008. insert(target, p, anchor);
  1009. },
  1010. p: noop,
  1011. d(detaching) {
  1012. if (detaching) {
  1013. detach(p);
  1014. }
  1015. }
  1016. };
  1017. }
  1018. function create_if_block_1$1(ctx) {
  1019. let video;
  1020. let video_src_value;
  1021. return {
  1022. c() {
  1023. video = element("video");
  1024. if (!src_url_equal(video.src, video_src_value = /*videoPreview*/
  1025. ctx[12])) attr(video, "src", video_src_value);
  1026. video.autoplay = true;
  1027. video.playsInline = true;
  1028. video.loop = true;
  1029. video.muted = true;
  1030. attr(video, "preload", "none");
  1031. attr(video, "class", "svelte-12nfdbu");
  1032. },
  1033. m(target, anchor) {
  1034. insert(target, video, anchor);
  1035. },
  1036. p(ctx2, dirty) {
  1037. if (dirty & /*movie*/
  1038. 2 && !src_url_equal(video.src, video_src_value = /*videoPreview*/
  1039. ctx2[12])) {
  1040. attr(video, "src", video_src_value);
  1041. }
  1042. },
  1043. d(detaching) {
  1044. if (detaching) {
  1045. detach(video);
  1046. }
  1047. }
  1048. };
  1049. }
  1050. function create_pending_block$1(ctx) {
  1051. return { c: noop, m: noop, p: noop, d: noop };
  1052. }
  1053. function create_fragment$2(ctx) {
  1054. var _a, _b, _c;
  1055. let div4;
  1056. let div1;
  1057. let div0;
  1058. let img;
  1059. let img_src_value;
  1060. let img_alt_value;
  1061. let t0;
  1062. let t1;
  1063. let t2;
  1064. let span;
  1065. let t3;
  1066. let t4_value = (
  1067. /*movie*/
  1068. ctx[1].code + ""
  1069. );
  1070. let t4;
  1071. let t5;
  1072. let div3;
  1073. let a0;
  1074. let t6_value = (
  1075. /*movie*/
  1076. ctx[1].title + ""
  1077. );
  1078. let t6;
  1079. let a0_href_value;
  1080. let a0_title_value;
  1081. let t7;
  1082. let div2;
  1083. let a1;
  1084. let t8_value = (
  1085. /*movie*/
  1086. ctx[1].maker + ""
  1087. );
  1088. let t8;
  1089. let a1_href_value;
  1090. let t9;
  1091. let resources;
  1092. let current;
  1093. let mounted;
  1094. let dispose;
  1095. let if_block0 = (
  1096. /*thumbLoaded*/
  1097. ctx[6] && /*isThumb*/
  1098. ctx[2] && create_if_block_2$1(ctx)
  1099. );
  1100. let if_block1 = (
  1101. /*mouseHover*/
  1102. (ctx[4] || /*thumbLoaded*/
  1103. ctx[6] && /*isPreview*/
  1104. ctx[3]) && create_if_block$1(ctx)
  1105. );
  1106. resources = new Resources({
  1107. props: {
  1108. code: (
  1109. /*movie*/
  1110. ctx[1].code
  1111. ),
  1112. torrent: (
  1113. /*torrentDataArray*/
  1114. ((_a = ctx[0][0]) == null ? void 0 : _a.torrent) ?? null
  1115. ),
  1116. magnet: (
  1117. /*torrentDataArray*/
  1118. ((_b = ctx[0][0]) == null ? void 0 : _b.magnet) ?? null
  1119. ),
  1120. seed: (
  1121. /*torrentDataArray*/
  1122. ((_c = ctx[0][0]) == null ? void 0 : _c.seed) ?? null
  1123. )
  1124. }
  1125. });
  1126. return {
  1127. c() {
  1128. div4 = element("div");
  1129. div1 = element("div");
  1130. div0 = element("div");
  1131. img = element("img");
  1132. t0 = space();
  1133. if (if_block0) if_block0.c();
  1134. t1 = space();
  1135. if (if_block1) if_block1.c();
  1136. t2 = space();
  1137. span = element("span");
  1138. t3 = text("FC2-PPV-");
  1139. t4 = text(t4_value);
  1140. t5 = space();
  1141. div3 = element("div");
  1142. a0 = element("a");
  1143. t6 = text(t6_value);
  1144. t7 = space();
  1145. div2 = element("div");
  1146. a1 = element("a");
  1147. t8 = text(t8_value);
  1148. t9 = space();
  1149. create_component(resources.$$.fragment);
  1150. if (!src_url_equal(img.src, img_src_value = /*movie*/
  1151. ctx[1].thumbnail)) attr(img, "src", img_src_value);
  1152. attr(img, "alt", img_alt_value = /*movie*/
  1153. ctx[1].title);
  1154. attr(img, "loading", "lazy");
  1155. attr(img, "class", "svelte-12nfdbu");
  1156. attr(span, "class", "code svelte-12nfdbu");
  1157. attr(div1, "class", "grid-item svelte-12nfdbu");
  1158. attr(a0, "class", "title svelte-12nfdbu");
  1159. attr(a0, "href", a0_href_value = /*movie*/
  1160. ctx[1].titleUrl);
  1161. attr(a0, "title", a0_title_value = /*movie*/
  1162. ctx[1].title);
  1163. attr(a0, "rel", "noopener");
  1164. attr(a1, "class", "maker svelte-12nfdbu");
  1165. attr(a1, "href", a1_href_value = /*movie*/
  1166. ctx[1].makerUrl);
  1167. attr(a1, "rel", "noopener");
  1168. attr(div2, "class", "flex svelte-12nfdbu");
  1169. attr(div3, "class", "grid-item-title svelte-12nfdbu");
  1170. attr(div4, "class", "grid-item-wrapper svelte-12nfdbu");
  1171. set_style(div4, "filter", "brightness(" + /*torrentDataArray*/
  1172. (ctx[0][0] ? "1" : "0.5") + ")");
  1173. set_style(div4, "transition", "filter 0.3s ease-in-out");
  1174. },
  1175. m(target, anchor) {
  1176. insert(target, div4, anchor);
  1177. append(div4, div1);
  1178. append(div1, div0);
  1179. append(div0, img);
  1180. append(div0, t0);
  1181. if (if_block0) if_block0.m(div0, null);
  1182. append(div0, t1);
  1183. if (if_block1) if_block1.m(div0, null);
  1184. append(div1, t2);
  1185. append(div1, span);
  1186. append(span, t3);
  1187. append(span, t4);
  1188. ctx[11](div1);
  1189. append(div4, t5);
  1190. append(div4, div3);
  1191. append(div3, a0);
  1192. append(a0, t6);
  1193. append(div3, t7);
  1194. append(div3, div2);
  1195. append(div2, a1);
  1196. append(a1, t8);
  1197. append(div2, t9);
  1198. mount_component(resources, div2, null);
  1199. current = true;
  1200. if (!mounted) {
  1201. dispose = [
  1202. listen(
  1203. div0,
  1204. "mouseover",
  1205. /*mouseover_handler*/
  1206. ctx[8]
  1207. ),
  1208. listen(
  1209. div0,
  1210. "mouseleave",
  1211. /*mouseleave_handler*/
  1212. ctx[9]
  1213. ),
  1214. listen(
  1215. div0,
  1216. "touchstart",
  1217. /*touchstart_handler*/
  1218. ctx[10],
  1219. { passive: true }
  1220. ),
  1221. action_destroyer(
  1222. /*observeIntersection*/
  1223. ctx[7].call(null, div1)
  1224. )
  1225. ];
  1226. mounted = true;
  1227. }
  1228. },
  1229. p(ctx2, [dirty]) {
  1230. var _a2, _b2, _c2;
  1231. if (!current || dirty & /*movie*/
  1232. 2 && !src_url_equal(img.src, img_src_value = /*movie*/
  1233. ctx2[1].thumbnail)) {
  1234. attr(img, "src", img_src_value);
  1235. }
  1236. if (!current || dirty & /*movie*/
  1237. 2 && img_alt_value !== (img_alt_value = /*movie*/
  1238. ctx2[1].title)) {
  1239. attr(img, "alt", img_alt_value);
  1240. }
  1241. if (
  1242. /*thumbLoaded*/
  1243. ctx2[6] && /*isThumb*/
  1244. ctx2[2]
  1245. ) {
  1246. if (if_block0) {
  1247. if_block0.p(ctx2, dirty);
  1248. } else {
  1249. if_block0 = create_if_block_2$1(ctx2);
  1250. if_block0.c();
  1251. if_block0.m(div0, t1);
  1252. }
  1253. } else if (if_block0) {
  1254. if_block0.d(1);
  1255. if_block0 = null;
  1256. }
  1257. if (
  1258. /*mouseHover*/
  1259. ctx2[4] || /*thumbLoaded*/
  1260. ctx2[6] && /*isPreview*/
  1261. ctx2[3]
  1262. ) {
  1263. if (if_block1) {
  1264. if_block1.p(ctx2, dirty);
  1265. } else {
  1266. if_block1 = create_if_block$1(ctx2);
  1267. if_block1.c();
  1268. if_block1.m(div0, null);
  1269. }
  1270. } else if (if_block1) {
  1271. if_block1.d(1);
  1272. if_block1 = null;
  1273. }
  1274. if ((!current || dirty & /*movie*/
  1275. 2) && t4_value !== (t4_value = /*movie*/
  1276. ctx2[1].code + "")) set_data(t4, t4_value);
  1277. if ((!current || dirty & /*movie*/
  1278. 2) && t6_value !== (t6_value = /*movie*/
  1279. ctx2[1].title + "")) set_data(t6, t6_value);
  1280. if (!current || dirty & /*movie*/
  1281. 2 && a0_href_value !== (a0_href_value = /*movie*/
  1282. ctx2[1].titleUrl)) {
  1283. attr(a0, "href", a0_href_value);
  1284. }
  1285. if (!current || dirty & /*movie*/
  1286. 2 && a0_title_value !== (a0_title_value = /*movie*/
  1287. ctx2[1].title)) {
  1288. attr(a0, "title", a0_title_value);
  1289. }
  1290. if ((!current || dirty & /*movie*/
  1291. 2) && t8_value !== (t8_value = /*movie*/
  1292. ctx2[1].maker + "")) set_data(t8, t8_value);
  1293. if (!current || dirty & /*movie*/
  1294. 2 && a1_href_value !== (a1_href_value = /*movie*/
  1295. ctx2[1].makerUrl)) {
  1296. attr(a1, "href", a1_href_value);
  1297. }
  1298. const resources_changes = {};
  1299. if (dirty & /*movie*/
  1300. 2) resources_changes.code = /*movie*/
  1301. ctx2[1].code;
  1302. if (dirty & /*torrentDataArray*/
  1303. 1) resources_changes.torrent = /*torrentDataArray*/
  1304. ((_a2 = ctx2[0][0]) == null ? void 0 : _a2.torrent) ?? null;
  1305. if (dirty & /*torrentDataArray*/
  1306. 1) resources_changes.magnet = /*torrentDataArray*/
  1307. ((_b2 = ctx2[0][0]) == null ? void 0 : _b2.magnet) ?? null;
  1308. if (dirty & /*torrentDataArray*/
  1309. 1) resources_changes.seed = /*torrentDataArray*/
  1310. ((_c2 = ctx2[0][0]) == null ? void 0 : _c2.seed) ?? null;
  1311. resources.$set(resources_changes);
  1312. if (!current || dirty & /*torrentDataArray*/
  1313. 1) {
  1314. set_style(div4, "filter", "brightness(" + /*torrentDataArray*/
  1315. (ctx2[0][0] ? "1" : "0.5") + ")");
  1316. }
  1317. },
  1318. i(local) {
  1319. if (current) return;
  1320. transition_in(resources.$$.fragment, local);
  1321. current = true;
  1322. },
  1323. o(local) {
  1324. transition_out(resources.$$.fragment, local);
  1325. current = false;
  1326. },
  1327. d(detaching) {
  1328. if (detaching) {
  1329. detach(div4);
  1330. }
  1331. if (if_block0) if_block0.d();
  1332. if (if_block1) if_block1.d();
  1333. ctx[11](null);
  1334. destroy_component(resources);
  1335. mounted = false;
  1336. run_all(dispose);
  1337. }
  1338. };
  1339. }
  1340. function instance$2($$self, $$props, $$invalidate) {
  1341. let mouseHover = false;
  1342. let { torrentDataArray = [] } = $$props;
  1343. let { movie } = $$props;
  1344. let { isThumb } = $$props;
  1345. let { isPreview } = $$props;
  1346. let gridItemRef;
  1347. let thumbLoaded = false;
  1348. const observeIntersection = (element2) => {
  1349. const observer = new IntersectionObserver((entries) => {
  1350. entries.forEach((entry) => {
  1351. if (entry.isIntersecting && !thumbLoaded) {
  1352. $$invalidate(6, thumbLoaded = true);
  1353. }
  1354. });
  1355. });
  1356. observer.observe(element2);
  1357. return observer;
  1358. };
  1359. const mouseover_handler = () => $$invalidate(4, mouseHover = true);
  1360. const mouseleave_handler = () => $$invalidate(4, mouseHover = false);
  1361. const touchstart_handler = () => $$invalidate(4, mouseHover = true);
  1362. function div1_binding($$value) {
  1363. binding_callbacks[$$value ? "unshift" : "push"](() => {
  1364. gridItemRef = $$value;
  1365. $$invalidate(5, gridItemRef);
  1366. });
  1367. }
  1368. $$self.$$set = ($$props2) => {
  1369. if ("torrentDataArray" in $$props2) $$invalidate(0, torrentDataArray = $$props2.torrentDataArray);
  1370. if ("movie" in $$props2) $$invalidate(1, movie = $$props2.movie);
  1371. if ("isThumb" in $$props2) $$invalidate(2, isThumb = $$props2.isThumb);
  1372. if ("isPreview" in $$props2) $$invalidate(3, isPreview = $$props2.isPreview);
  1373. };
  1374. return [
  1375. torrentDataArray,
  1376. movie,
  1377. isThumb,
  1378. isPreview,
  1379. mouseHover,
  1380. gridItemRef,
  1381. thumbLoaded,
  1382. observeIntersection,
  1383. mouseover_handler,
  1384. mouseleave_handler,
  1385. touchstart_handler,
  1386. div1_binding
  1387. ];
  1388. }
  1389. class MovieList extends SvelteComponent {
  1390. constructor(options) {
  1391. super();
  1392. init(this, options, instance$2, create_fragment$2, safe_not_equal, {
  1393. torrentDataArray: 0,
  1394. movie: 1,
  1395. isThumb: 2,
  1396. isPreview: 3
  1397. });
  1398. }
  1399. }
  1400. const sukebeiCache = {};
  1401. async function getTorrentDataFromSukebei(url) {
  1402. if (sukebeiCache[url] !== void 0) {
  1403. return Promise.resolve(sukebeiCache[url]);
  1404. }
  1405. const newUrl = `https://sukebei.nyaa.si/?f=0&c=0_0&q=${url}&s=seeders&o=desc`;
  1406. return new Promise((resolve, reject) => {
  1407. _GM_xmlhttpRequest({
  1408. url: newUrl,
  1409. onload(response) {
  1410. const $torrentRows = $(response.responseText).find("tbody > *");
  1411. const torrentDataArray = $torrentRows.map((_, row) => {
  1412. const $row = $(row);
  1413. return {
  1414. title: $row.find("td a:eq(1)").text(),
  1415. torrent: "https://sukebei.nyaa.si" + ($row.find("td a i.fa-download").parent().attr("href") ?? ""),
  1416. magnet: $row.find("td a i.fa-magnet").parent().attr("href") ?? "",
  1417. seed: $row.find("td:eq(-3)").text()
  1418. };
  1419. }).get();
  1420. sukebeiCache[url] = torrentDataArray;
  1421. resolve(torrentDataArray);
  1422. },
  1423. onerror(response) {
  1424. reject(response);
  1425. }
  1426. });
  1427. });
  1428. }
  1429. function get_each_context(ctx, list, i) {
  1430. const child_ctx = ctx.slice();
  1431. child_ctx[7] = list[i];
  1432. return child_ctx;
  1433. }
  1434. function create_each_block(ctx) {
  1435. let movielistpage;
  1436. let current;
  1437. function func(...args) {
  1438. return (
  1439. /*func*/
  1440. ctx[6](
  1441. /*movie*/
  1442. ctx[7],
  1443. ...args
  1444. )
  1445. );
  1446. }
  1447. movielistpage = new MovieList({
  1448. props: {
  1449. movie: (
  1450. /*movie*/
  1451. ctx[7]
  1452. ),
  1453. isThumb: (
  1454. /*isThumb*/
  1455. ctx[0]
  1456. ),
  1457. isPreview: (
  1458. /*isPreview*/
  1459. ctx[1]
  1460. ),
  1461. torrentDataArray: (
  1462. /*torrentDataArray*/
  1463. ctx[3].filter(func).map(func_1) || null
  1464. )
  1465. }
  1466. });
  1467. return {
  1468. c() {
  1469. create_component(movielistpage.$$.fragment);
  1470. },
  1471. m(target, anchor) {
  1472. mount_component(movielistpage, target, anchor);
  1473. current = true;
  1474. },
  1475. p(new_ctx, dirty) {
  1476. ctx = new_ctx;
  1477. const movielistpage_changes = {};
  1478. if (dirty & /*movieList*/
  1479. 4) movielistpage_changes.movie = /*movie*/
  1480. ctx[7];
  1481. if (dirty & /*isThumb*/
  1482. 1) movielistpage_changes.isThumb = /*isThumb*/
  1483. ctx[0];
  1484. if (dirty & /*isPreview*/
  1485. 2) movielistpage_changes.isPreview = /*isPreview*/
  1486. ctx[1];
  1487. if (dirty & /*torrentDataArray, movieList*/
  1488. 12) movielistpage_changes.torrentDataArray = /*torrentDataArray*/
  1489. ctx[3].filter(func).map(func_1) || null;
  1490. movielistpage.$set(movielistpage_changes);
  1491. },
  1492. i(local) {
  1493. if (current) return;
  1494. transition_in(movielistpage.$$.fragment, local);
  1495. current = true;
  1496. },
  1497. o(local) {
  1498. transition_out(movielistpage.$$.fragment, local);
  1499. current = false;
  1500. },
  1501. d(detaching) {
  1502. destroy_component(movielistpage, detaching);
  1503. }
  1504. };
  1505. }
  1506. function create_fragment$1(ctx) {
  1507. let div0;
  1508. let button0;
  1509. let t0;
  1510. let t1_value = (
  1511. /*isThumb*/
  1512. ctx[0] ? "ON" : "OFF"
  1513. );
  1514. let t1;
  1515. let t2;
  1516. let button1;
  1517. let t3;
  1518. let t4_value = (
  1519. /*isPreview*/
  1520. ctx[1] ? "ON" : "OFF"
  1521. );
  1522. let t4;
  1523. let t5;
  1524. let div1;
  1525. let current;
  1526. let mounted;
  1527. let dispose;
  1528. let each_value = ensure_array_like(
  1529. /*movieList*/
  1530. ctx[2]
  1531. );
  1532. let each_blocks = [];
  1533. for (let i = 0; i < each_value.length; i += 1) {
  1534. each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
  1535. }
  1536. const out = (i) => transition_out(each_blocks[i], 1, 1, () => {
  1537. each_blocks[i] = null;
  1538. });
  1539. return {
  1540. c() {
  1541. div0 = element("div");
  1542. button0 = element("button");
  1543. t0 = text("Javtiful Thumbnail ");
  1544. t1 = text(t1_value);
  1545. t2 = space();
  1546. button1 = element("button");
  1547. t3 = text("View All Preview ");
  1548. t4 = text(t4_value);
  1549. t5 = space();
  1550. div1 = element("div");
  1551. for (let i = 0; i < each_blocks.length; i += 1) {
  1552. each_blocks[i].c();
  1553. }
  1554. attr(button0, "class", "toggle-button svelte-9avr2h");
  1555. toggle_class(
  1556. button0,
  1557. "active",
  1558. /*isThumb*/
  1559. ctx[0]
  1560. );
  1561. attr(button1, "class", "toggle-button svelte-9avr2h");
  1562. toggle_class(
  1563. button1,
  1564. "active",
  1565. /*isPreview*/
  1566. ctx[1]
  1567. );
  1568. attr(div0, "class", "toggle-container svelte-9avr2h");
  1569. attr(div1, "class", "grid-container svelte-9avr2h");
  1570. },
  1571. m(target, anchor) {
  1572. insert(target, div0, anchor);
  1573. append(div0, button0);
  1574. append(button0, t0);
  1575. append(button0, t1);
  1576. append(div0, t2);
  1577. append(div0, button1);
  1578. append(button1, t3);
  1579. append(button1, t4);
  1580. insert(target, t5, anchor);
  1581. insert(target, div1, anchor);
  1582. for (let i = 0; i < each_blocks.length; i += 1) {
  1583. if (each_blocks[i]) {
  1584. each_blocks[i].m(div1, null);
  1585. }
  1586. }
  1587. current = true;
  1588. if (!mounted) {
  1589. dispose = [
  1590. listen(
  1591. button0,
  1592. "click",
  1593. /*click_handler*/
  1594. ctx[4]
  1595. ),
  1596. listen(
  1597. button1,
  1598. "click",
  1599. /*click_handler_1*/
  1600. ctx[5]
  1601. )
  1602. ];
  1603. mounted = true;
  1604. }
  1605. },
  1606. p(ctx2, [dirty]) {
  1607. if ((!current || dirty & /*isThumb*/
  1608. 1) && t1_value !== (t1_value = /*isThumb*/
  1609. ctx2[0] ? "ON" : "OFF")) set_data(t1, t1_value);
  1610. if (!current || dirty & /*isThumb*/
  1611. 1) {
  1612. toggle_class(
  1613. button0,
  1614. "active",
  1615. /*isThumb*/
  1616. ctx2[0]
  1617. );
  1618. }
  1619. if ((!current || dirty & /*isPreview*/
  1620. 2) && t4_value !== (t4_value = /*isPreview*/
  1621. ctx2[1] ? "ON" : "OFF")) set_data(t4, t4_value);
  1622. if (!current || dirty & /*isPreview*/
  1623. 2) {
  1624. toggle_class(
  1625. button1,
  1626. "active",
  1627. /*isPreview*/
  1628. ctx2[1]
  1629. );
  1630. }
  1631. if (dirty & /*movieList, isThumb, isPreview, torrentDataArray*/
  1632. 15) {
  1633. each_value = ensure_array_like(
  1634. /*movieList*/
  1635. ctx2[2]
  1636. );
  1637. let i;
  1638. for (i = 0; i < each_value.length; i += 1) {
  1639. const child_ctx = get_each_context(ctx2, each_value, i);
  1640. if (each_blocks[i]) {
  1641. each_blocks[i].p(child_ctx, dirty);
  1642. transition_in(each_blocks[i], 1);
  1643. } else {
  1644. each_blocks[i] = create_each_block(child_ctx);
  1645. each_blocks[i].c();
  1646. transition_in(each_blocks[i], 1);
  1647. each_blocks[i].m(div1, null);
  1648. }
  1649. }
  1650. group_outros();
  1651. for (i = each_value.length; i < each_blocks.length; i += 1) {
  1652. out(i);
  1653. }
  1654. check_outros();
  1655. }
  1656. },
  1657. i(local) {
  1658. if (current) return;
  1659. for (let i = 0; i < each_value.length; i += 1) {
  1660. transition_in(each_blocks[i]);
  1661. }
  1662. current = true;
  1663. },
  1664. o(local) {
  1665. each_blocks = each_blocks.filter(Boolean);
  1666. for (let i = 0; i < each_blocks.length; i += 1) {
  1667. transition_out(each_blocks[i]);
  1668. }
  1669. current = false;
  1670. },
  1671. d(detaching) {
  1672. if (detaching) {
  1673. detach(div0);
  1674. detach(t5);
  1675. detach(div1);
  1676. }
  1677. destroy_each(each_blocks, detaching);
  1678. mounted = false;
  1679. run_all(dispose);
  1680. }
  1681. };
  1682. }
  1683. const CHUNK_SIZE = 30;
  1684. const func_1 = (data) => ({ ...data, seed: data.seed.toString() });
  1685. function instance$1($$self, $$props, $$invalidate) {
  1686. let movieList = [];
  1687. let torrentDataArray = [];
  1688. let isThumb = JSON.parse(localStorage.getItem("isThumb") || "false");
  1689. let isPreview = JSON.parse(localStorage.getItem("isPreview") || "false");
  1690. onMount(async () => {
  1691. $$invalidate(2, movieList = await getMovieList());
  1692. const codes = Array.from(new Set(movieList.map((movie) => movie.code)));
  1693. const chunks = [];
  1694. for (let i = 0; i < codes.length; i += CHUNK_SIZE) {
  1695. chunks.push(codes.slice(i, i + CHUNK_SIZE).join("|"));
  1696. }
  1697. const results = await Promise.all(chunks.map(getTorrentDataFromSukebei));
  1698. $$invalidate(3, torrentDataArray = results.flat());
  1699. });
  1700. const click_handler = () => $$invalidate(0, isThumb = !isThumb);
  1701. const click_handler_1 = () => $$invalidate(1, isPreview = !isPreview);
  1702. const func = (movie, data) => data.title.includes(movie.code);
  1703. $$self.$$.update = () => {
  1704. if ($$self.$$.dirty & /*isThumb*/
  1705. 1) {
  1706. {
  1707. localStorage.setItem("isThumb", JSON.stringify(isThumb));
  1708. }
  1709. }
  1710. if ($$self.$$.dirty & /*isPreview*/
  1711. 2) {
  1712. {
  1713. localStorage.setItem("isPreview", JSON.stringify(isPreview));
  1714. }
  1715. }
  1716. };
  1717. return [
  1718. isThumb,
  1719. isPreview,
  1720. movieList,
  1721. torrentDataArray,
  1722. click_handler,
  1723. click_handler_1,
  1724. func
  1725. ];
  1726. }
  1727. class Movies extends SvelteComponent {
  1728. constructor(options) {
  1729. super();
  1730. init(this, options, instance$1, create_fragment$1, safe_not_equal, {});
  1731. }
  1732. }
  1733. function getMovieDetail() {
  1734. const $El = $("div.flex.flex-col.items-start.rounded-lg");
  1735. const movieDetail = {
  1736. code: $El.find("span.text-white.ml-2").first().text(),
  1737. thumbnail: $El.find("img").first().attr("src")
  1738. };
  1739. return movieDetail;
  1740. }
  1741. function create_if_block_1(ctx) {
  1742. let await_block_anchor;
  1743. let info = {
  1744. ctx,
  1745. current: null,
  1746. token: null,
  1747. hasCatch: false,
  1748. pending: create_pending_block,
  1749. then: create_then_block,
  1750. catch: create_catch_block,
  1751. value: 5
  1752. };
  1753. handle_promise(getVideoPreview(
  1754. /*movieDetail*/
  1755. ctx[2].code,
  1756. false
  1757. ), info);
  1758. return {
  1759. c() {
  1760. await_block_anchor = empty();
  1761. info.block.c();
  1762. },
  1763. m(target, anchor) {
  1764. insert(target, await_block_anchor, anchor);
  1765. info.block.m(target, info.anchor = anchor);
  1766. info.mount = () => await_block_anchor.parentNode;
  1767. info.anchor = await_block_anchor;
  1768. },
  1769. p(new_ctx, dirty) {
  1770. ctx = new_ctx;
  1771. update_await_block_branch(info, ctx, dirty);
  1772. },
  1773. d(detaching) {
  1774. if (detaching) {
  1775. detach(await_block_anchor);
  1776. }
  1777. info.block.d(detaching);
  1778. info.token = null;
  1779. info = null;
  1780. }
  1781. };
  1782. }
  1783. function create_catch_block(ctx) {
  1784. return { c: noop, m: noop, p: noop, d: noop };
  1785. }
  1786. function create_then_block(ctx) {
  1787. let if_block_anchor;
  1788. function select_block_type(ctx2, dirty) {
  1789. if (
  1790. /*videoPreview*/
  1791. ctx2[5]
  1792. ) return create_if_block_2;
  1793. return create_else_block;
  1794. }
  1795. let current_block_type = select_block_type(ctx);
  1796. let if_block = current_block_type(ctx);
  1797. return {
  1798. c() {
  1799. if_block.c();
  1800. if_block_anchor = empty();
  1801. },
  1802. m(target, anchor) {
  1803. if_block.m(target, anchor);
  1804. insert(target, if_block_anchor, anchor);
  1805. },
  1806. p(ctx2, dirty) {
  1807. if_block.p(ctx2, dirty);
  1808. },
  1809. d(detaching) {
  1810. if (detaching) {
  1811. detach(if_block_anchor);
  1812. }
  1813. if_block.d(detaching);
  1814. }
  1815. };
  1816. }
  1817. function create_else_block(ctx) {
  1818. let p;
  1819. return {
  1820. c() {
  1821. p = element("p");
  1822. p.textContent = "No Preview 😭";
  1823. attr(p, "class", "no-video svelte-we16u3");
  1824. },
  1825. m(target, anchor) {
  1826. insert(target, p, anchor);
  1827. },
  1828. p: noop,
  1829. d(detaching) {
  1830. if (detaching) {
  1831. detach(p);
  1832. }
  1833. }
  1834. };
  1835. }
  1836. function create_if_block_2(ctx) {
  1837. let video;
  1838. let video_src_value;
  1839. return {
  1840. c() {
  1841. video = element("video");
  1842. if (!src_url_equal(video.src, video_src_value = /*videoPreview*/
  1843. ctx[5])) attr(video, "src", video_src_value);
  1844. video.autoplay = true;
  1845. video.loop = true;
  1846. attr(video, "class", "svelte-we16u3");
  1847. },
  1848. m(target, anchor) {
  1849. insert(target, video, anchor);
  1850. },
  1851. p: noop,
  1852. d(detaching) {
  1853. if (detaching) {
  1854. detach(video);
  1855. }
  1856. }
  1857. };
  1858. }
  1859. function create_pending_block(ctx) {
  1860. return { c: noop, m: noop, p: noop, d: noop };
  1861. }
  1862. function create_if_block(ctx) {
  1863. let resources;
  1864. let current;
  1865. resources = new Resources({
  1866. props: {
  1867. code: (
  1868. /*movieDetail*/
  1869. ctx[2].code
  1870. ),
  1871. torrent: (
  1872. /*torrentData*/
  1873. ctx[1][0].torrent
  1874. ),
  1875. magnet: (
  1876. /*torrentData*/
  1877. ctx[1][0].magnet
  1878. ),
  1879. seed: (
  1880. /*torrentData*/
  1881. ctx[1][0].seed
  1882. )
  1883. }
  1884. });
  1885. return {
  1886. c() {
  1887. create_component(resources.$$.fragment);
  1888. },
  1889. m(target, anchor) {
  1890. mount_component(resources, target, anchor);
  1891. current = true;
  1892. },
  1893. p(ctx2, dirty) {
  1894. const resources_changes = {};
  1895. if (dirty & /*torrentData*/
  1896. 2) resources_changes.torrent = /*torrentData*/
  1897. ctx2[1][0].torrent;
  1898. if (dirty & /*torrentData*/
  1899. 2) resources_changes.magnet = /*torrentData*/
  1900. ctx2[1][0].magnet;
  1901. if (dirty & /*torrentData*/
  1902. 2) resources_changes.seed = /*torrentData*/
  1903. ctx2[1][0].seed;
  1904. resources.$set(resources_changes);
  1905. },
  1906. i(local) {
  1907. if (current) return;
  1908. transition_in(resources.$$.fragment, local);
  1909. current = true;
  1910. },
  1911. o(local) {
  1912. transition_out(resources.$$.fragment, local);
  1913. current = false;
  1914. },
  1915. d(detaching) {
  1916. destroy_component(resources, detaching);
  1917. }
  1918. };
  1919. }
  1920. function create_fragment(ctx) {
  1921. let div;
  1922. let img;
  1923. let img_src_value;
  1924. let t0;
  1925. let t1;
  1926. let if_block1_anchor;
  1927. let current;
  1928. let mounted;
  1929. let dispose;
  1930. let if_block0 = (
  1931. /*mouseHover*/
  1932. ctx[0] && create_if_block_1(ctx)
  1933. );
  1934. let if_block1 = (
  1935. /*torrentData*/
  1936. ctx[1].length > 0 && create_if_block(ctx)
  1937. );
  1938. return {
  1939. c() {
  1940. div = element("div");
  1941. img = element("img");
  1942. t0 = space();
  1943. if (if_block0) if_block0.c();
  1944. t1 = space();
  1945. if (if_block1) if_block1.c();
  1946. if_block1_anchor = empty();
  1947. if (!src_url_equal(img.src, img_src_value = /*movieDetail*/
  1948. ctx[2].thumbnail)) attr(img, "src", img_src_value);
  1949. attr(
  1950. img,
  1951. "alt",
  1952. /*movieDetail*/
  1953. ctx[2].code
  1954. );
  1955. attr(img, "class", "svelte-we16u3");
  1956. attr(div, "class", "svelte-we16u3");
  1957. },
  1958. m(target, anchor) {
  1959. insert(target, div, anchor);
  1960. append(div, img);
  1961. append(div, t0);
  1962. if (if_block0) if_block0.m(div, null);
  1963. insert(target, t1, anchor);
  1964. if (if_block1) if_block1.m(target, anchor);
  1965. insert(target, if_block1_anchor, anchor);
  1966. current = true;
  1967. if (!mounted) {
  1968. dispose = [
  1969. listen(
  1970. div,
  1971. "touchstart",
  1972. /*handleMouseEnter*/
  1973. ctx[3],
  1974. { passive: true }
  1975. ),
  1976. listen(
  1977. div,
  1978. "focus",
  1979. /*handleMouseEnter*/
  1980. ctx[3]
  1981. ),
  1982. listen(
  1983. div,
  1984. "mouseover",
  1985. /*handleMouseEnter*/
  1986. ctx[3]
  1987. ),
  1988. listen(
  1989. div,
  1990. "mouseleave",
  1991. /*handleMouseLeave*/
  1992. ctx[4]
  1993. )
  1994. ];
  1995. mounted = true;
  1996. }
  1997. },
  1998. p(ctx2, [dirty]) {
  1999. if (
  2000. /*mouseHover*/
  2001. ctx2[0]
  2002. ) {
  2003. if (if_block0) {
  2004. if_block0.p(ctx2, dirty);
  2005. } else {
  2006. if_block0 = create_if_block_1(ctx2);
  2007. if_block0.c();
  2008. if_block0.m(div, null);
  2009. }
  2010. } else if (if_block0) {
  2011. if_block0.d(1);
  2012. if_block0 = null;
  2013. }
  2014. if (
  2015. /*torrentData*/
  2016. ctx2[1].length > 0
  2017. ) {
  2018. if (if_block1) {
  2019. if_block1.p(ctx2, dirty);
  2020. if (dirty & /*torrentData*/
  2021. 2) {
  2022. transition_in(if_block1, 1);
  2023. }
  2024. } else {
  2025. if_block1 = create_if_block(ctx2);
  2026. if_block1.c();
  2027. transition_in(if_block1, 1);
  2028. if_block1.m(if_block1_anchor.parentNode, if_block1_anchor);
  2029. }
  2030. } else if (if_block1) {
  2031. group_outros();
  2032. transition_out(if_block1, 1, 1, () => {
  2033. if_block1 = null;
  2034. });
  2035. check_outros();
  2036. }
  2037. },
  2038. i(local) {
  2039. if (current) return;
  2040. transition_in(if_block1);
  2041. current = true;
  2042. },
  2043. o(local) {
  2044. transition_out(if_block1);
  2045. current = false;
  2046. },
  2047. d(detaching) {
  2048. if (detaching) {
  2049. detach(div);
  2050. detach(t1);
  2051. detach(if_block1_anchor);
  2052. }
  2053. if (if_block0) if_block0.d();
  2054. if (if_block1) if_block1.d(detaching);
  2055. mounted = false;
  2056. run_all(dispose);
  2057. }
  2058. };
  2059. }
  2060. function instance($$self, $$props, $$invalidate) {
  2061. let movieDetail = getMovieDetail();
  2062. let mouseHover = false;
  2063. let torrentData = [];
  2064. onMount(async () => {
  2065. $$invalidate(1, torrentData = await getTorrentDataFromSukebei(movieDetail.code));
  2066. });
  2067. const handleMouseEnter = () => $$invalidate(0, mouseHover = true);
  2068. const handleMouseLeave = () => $$invalidate(0, mouseHover = false);
  2069. return [mouseHover, torrentData, movieDetail, handleMouseEnter, handleMouseLeave];
  2070. }
  2071. class MovieDetail extends SvelteComponent {
  2072. constructor(options) {
  2073. super();
  2074. init(this, options, instance, create_fragment, safe_not_equal, {});
  2075. }
  2076. }
  2077. const waitForMoviesTarget = () => {
  2078. const moviesTarget = $("div.flex.flex-wrap.-m-4");
  2079. if (moviesTarget.length) {
  2080. const newDivMovies = $("<div>");
  2081. new Movies({
  2082. target: newDivMovies[0]
  2083. });
  2084. moviesTarget.replaceWith(newDivMovies);
  2085. } else {
  2086. setTimeout(waitForMoviesTarget, 1e3);
  2087. }
  2088. };
  2089. waitForMoviesTarget();
  2090. const movieDetailTarget = $(
  2091. "div.flex.flex-col.items-start.rounded-lg > div > a > img"
  2092. ).parent();
  2093. if (movieDetailTarget.length) {
  2094. const newDivDetail = $("<div>");
  2095. new MovieDetail({
  2096. target: newDivDetail[0]
  2097. });
  2098. movieDetailTarget.replaceWith(newDivDetail);
  2099. }
  2100. const containerEl = $("div.container");
  2101. if (containerEl.length) {
  2102. containerEl.removeClass("container");
  2103. }
  2104. const idEl = $("span.text-white.ml-2").first();
  2105. if (idEl.length && /^\d+$/.test(idEl.text())) {
  2106. const originalText = idEl.text();
  2107. idEl.text("FC2-PPV-" + originalText);
  2108. }
  2109.  
  2110. })(jQuery);