豆瓣电影在线观看

提供在线观看豆瓣电影的链接

  1. // ==UserScript==
  2. // @name 豆瓣电影在线观看
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1.3
  5. // @description 提供在线观看豆瓣电影的链接
  6. // @author anc95
  7. // @match https://movie.douban.com/subject/*
  8. // @include https://movie.douban.com/subject/*
  9. // @icon https://www.google.com/s2/favicons?domain=douban.com
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. // ===== dependencies ======
  15. ;(function (root, factory) {
  16. if (typeof exports === "object") {
  17. // CommonJS
  18. module.exports = exports = factory();
  19. }
  20. else if (typeof define === "function" && define.amd) {
  21. // AMD
  22. define([], factory);
  23. }
  24. else {
  25. // Global (browser)
  26. root.CryptoJS = factory();
  27. }
  28. }(this, function () {
  29.  
  30. /*globals window, global, require*/
  31.  
  32. /**
  33. * CryptoJS core components.
  34. */
  35. var CryptoJS = CryptoJS || (function (Math, undefined) {
  36.  
  37. var crypto;
  38.  
  39. // Native crypto from window (Browser)
  40. if (typeof window !== 'undefined' && window.crypto) {
  41. crypto = window.crypto;
  42. }
  43.  
  44. // Native (experimental IE 11) crypto from window (Browser)
  45. if (!crypto && typeof window !== 'undefined' && window.msCrypto) {
  46. crypto = window.msCrypto;
  47. }
  48.  
  49. // Native crypto from global (NodeJS)
  50. if (!crypto && typeof global !== 'undefined' && global.crypto) {
  51. crypto = global.crypto;
  52. }
  53.  
  54. // Native crypto import via require (NodeJS)
  55. if (!crypto && typeof require === 'function') {
  56. try {
  57. crypto = require('crypto');
  58. } catch (err) {}
  59. }
  60.  
  61. /*
  62. * Cryptographically secure pseudorandom number generator
  63. *
  64. * As Math.random() is cryptographically not safe to use
  65. */
  66. var cryptoSecureRandomInt = function () {
  67. if (crypto) {
  68. // Use getRandomValues method (Browser)
  69. if (typeof crypto.getRandomValues === 'function') {
  70. try {
  71. return crypto.getRandomValues(new Uint32Array(1))[0];
  72. } catch (err) {}
  73. }
  74.  
  75. // Use randomBytes method (NodeJS)
  76. if (typeof crypto.randomBytes === 'function') {
  77. try {
  78. return crypto.randomBytes(4).readInt32LE();
  79. } catch (err) {}
  80. }
  81. }
  82.  
  83. throw new Error('Native crypto module could not be used to get secure random number.');
  84. };
  85.  
  86. /*
  87. * Local polyfill of Object.create
  88.  
  89. */
  90. var create = Object.create || (function () {
  91. function F() {}
  92.  
  93. return function (obj) {
  94. var subtype;
  95.  
  96. F.prototype = obj;
  97.  
  98. subtype = new F();
  99.  
  100. F.prototype = null;
  101.  
  102. return subtype;
  103. };
  104. }())
  105.  
  106. /**
  107. * CryptoJS namespace.
  108. */
  109. var C = {};
  110.  
  111. /**
  112. * Library namespace.
  113. */
  114. var C_lib = C.lib = {};
  115.  
  116. /**
  117. * Base object for prototypal inheritance.
  118. */
  119. var Base = C_lib.Base = (function () {
  120.  
  121.  
  122. return {
  123. /**
  124. * Creates a new object that inherits from this object.
  125. *
  126. * @param {Object} overrides Properties to copy into the new object.
  127. *
  128. * @return {Object} The new object.
  129. *
  130. * @static
  131. *
  132. * @example
  133. *
  134. * var MyType = CryptoJS.lib.Base.extend({
  135. * field: 'value',
  136. *
  137. * method: function () {
  138. * }
  139. * });
  140. */
  141. extend: function (overrides) {
  142. // Spawn
  143. var subtype = create(this);
  144.  
  145. // Augment
  146. if (overrides) {
  147. subtype.mixIn(overrides);
  148. }
  149.  
  150. // Create default initializer
  151. if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {
  152. subtype.init = function () {
  153. subtype.$super.init.apply(this, arguments);
  154. };
  155. }
  156.  
  157. // Initializer's prototype is the subtype object
  158. subtype.init.prototype = subtype;
  159.  
  160. // Reference supertype
  161. subtype.$super = this;
  162.  
  163. return subtype;
  164. },
  165.  
  166. /**
  167. * Extends this object and runs the init method.
  168. * Arguments to create() will be passed to init().
  169. *
  170. * @return {Object} The new object.
  171. *
  172. * @static
  173. *
  174. * @example
  175. *
  176. * var instance = MyType.create();
  177. */
  178. create: function () {
  179. var instance = this.extend();
  180. instance.init.apply(instance, arguments);
  181.  
  182. return instance;
  183. },
  184.  
  185. /**
  186. * Initializes a newly created object.
  187. * Override this method to add some logic when your objects are created.
  188. *
  189. * @example
  190. *
  191. * var MyType = CryptoJS.lib.Base.extend({
  192. * init: function () {
  193. * // ...
  194. * }
  195. * });
  196. */
  197. init: function () {
  198. },
  199.  
  200. /**
  201. * Copies properties into this object.
  202. *
  203. * @param {Object} properties The properties to mix in.
  204. *
  205. * @example
  206. *
  207. * MyType.mixIn({
  208. * field: 'value'
  209. * });
  210. */
  211. mixIn: function (properties) {
  212. for (var propertyName in properties) {
  213. if (properties.hasOwnProperty(propertyName)) {
  214. this[propertyName] = properties[propertyName];
  215. }
  216. }
  217.  
  218. // IE won't copy toString using the loop above
  219. if (properties.hasOwnProperty('toString')) {
  220. this.toString = properties.toString;
  221. }
  222. },
  223.  
  224. /**
  225. * Creates a copy of this object.
  226. *
  227. * @return {Object} The clone.
  228. *
  229. * @example
  230. *
  231. * var clone = instance.clone();
  232. */
  233. clone: function () {
  234. return this.init.prototype.extend(this);
  235. }
  236. };
  237. }());
  238.  
  239. /**
  240. * An array of 32-bit words.
  241. *
  242. * @property {Array} words The array of 32-bit words.
  243. * @property {number} sigBytes The number of significant bytes in this word array.
  244. */
  245. var WordArray = C_lib.WordArray = Base.extend({
  246. /**
  247. * Initializes a newly created word array.
  248. *
  249. * @param {Array} words (Optional) An array of 32-bit words.
  250. * @param {number} sigBytes (Optional) The number of significant bytes in the words.
  251. *
  252. * @example
  253. *
  254. * var wordArray = CryptoJS.lib.WordArray.create();
  255. * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
  256. * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
  257. */
  258. init: function (words, sigBytes) {
  259. words = this.words = words || [];
  260.  
  261. if (sigBytes != undefined) {
  262. this.sigBytes = sigBytes;
  263. } else {
  264. this.sigBytes = words.length * 4;
  265. }
  266. },
  267.  
  268. /**
  269. * Converts this word array to a string.
  270. *
  271. * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
  272. *
  273. * @return {string} The stringified word array.
  274. *
  275. * @example
  276. *
  277. * var string = wordArray + '';
  278. * var string = wordArray.toString();
  279. * var string = wordArray.toString(CryptoJS.enc.Utf8);
  280. */
  281. toString: function (encoder) {
  282. return (encoder || Hex).stringify(this);
  283. },
  284.  
  285. /**
  286. * Concatenates a word array to this word array.
  287. *
  288. * @param {WordArray} wordArray The word array to append.
  289. *
  290. * @return {WordArray} This word array.
  291. *
  292. * @example
  293. *
  294. * wordArray1.concat(wordArray2);
  295. */
  296. concat: function (wordArray) {
  297. // Shortcuts
  298. var thisWords = this.words;
  299. var thatWords = wordArray.words;
  300. var thisSigBytes = this.sigBytes;
  301. var thatSigBytes = wordArray.sigBytes;
  302.  
  303. // Clamp excess bits
  304. this.clamp();
  305.  
  306. // Concat
  307. if (thisSigBytes % 4) {
  308. // Copy one byte at a time
  309. for (var i = 0; i < thatSigBytes; i++) {
  310. var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
  311. thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
  312. }
  313. } else {
  314. // Copy one word at a time
  315. for (var i = 0; i < thatSigBytes; i += 4) {
  316. thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
  317. }
  318. }
  319. this.sigBytes += thatSigBytes;
  320.  
  321. // Chainable
  322. return this;
  323. },
  324.  
  325. /**
  326. * Removes insignificant bits.
  327. *
  328. * @example
  329. *
  330. * wordArray.clamp();
  331. */
  332. clamp: function () {
  333. // Shortcuts
  334. var words = this.words;
  335. var sigBytes = this.sigBytes;
  336.  
  337. // Clamp
  338. words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);
  339. words.length = Math.ceil(sigBytes / 4);
  340. },
  341.  
  342. /**
  343. * Creates a copy of this word array.
  344. *
  345. * @return {WordArray} The clone.
  346. *
  347. * @example
  348. *
  349. * var clone = wordArray.clone();
  350. */
  351. clone: function () {
  352. var clone = Base.clone.call(this);
  353. clone.words = this.words.slice(0);
  354.  
  355. return clone;
  356. },
  357.  
  358. /**
  359. * Creates a word array filled with random bytes.
  360. *
  361. * @param {number} nBytes The number of random bytes to generate.
  362. *
  363. * @return {WordArray} The random word array.
  364. *
  365. * @static
  366. *
  367. * @example
  368. *
  369. * var wordArray = CryptoJS.lib.WordArray.random(16);
  370. */
  371. random: function (nBytes) {
  372. var words = [];
  373.  
  374. for (var i = 0; i < nBytes; i += 4) {
  375. words.push(cryptoSecureRandomInt());
  376. }
  377.  
  378. return new WordArray.init(words, nBytes);
  379. }
  380. });
  381.  
  382. /**
  383. * Encoder namespace.
  384. */
  385. var C_enc = C.enc = {};
  386.  
  387. /**
  388. * Hex encoding strategy.
  389. */
  390. var Hex = C_enc.Hex = {
  391. /**
  392. * Converts a word array to a hex string.
  393. *
  394. * @param {WordArray} wordArray The word array.
  395. *
  396. * @return {string} The hex string.
  397. *
  398. * @static
  399. *
  400. * @example
  401. *
  402. * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
  403. */
  404. stringify: function (wordArray) {
  405. // Shortcuts
  406. var words = wordArray.words;
  407. var sigBytes = wordArray.sigBytes;
  408.  
  409. // Convert
  410. var hexChars = [];
  411. for (var i = 0; i < sigBytes; i++) {
  412. var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
  413. hexChars.push((bite >>> 4).toString(16));
  414. hexChars.push((bite & 0x0f).toString(16));
  415. }
  416.  
  417. return hexChars.join('');
  418. },
  419.  
  420. /**
  421. * Converts a hex string to a word array.
  422. *
  423. * @param {string} hexStr The hex string.
  424. *
  425. * @return {WordArray} The word array.
  426. *
  427. * @static
  428. *
  429. * @example
  430. *
  431. * var wordArray = CryptoJS.enc.Hex.parse(hexString);
  432. */
  433. parse: function (hexStr) {
  434. // Shortcut
  435. var hexStrLength = hexStr.length;
  436.  
  437. // Convert
  438. var words = [];
  439. for (var i = 0; i < hexStrLength; i += 2) {
  440. words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);
  441. }
  442.  
  443. return new WordArray.init(words, hexStrLength / 2);
  444. }
  445. };
  446.  
  447. /**
  448. * Latin1 encoding strategy.
  449. */
  450. var Latin1 = C_enc.Latin1 = {
  451. /**
  452. * Converts a word array to a Latin1 string.
  453. *
  454. * @param {WordArray} wordArray The word array.
  455. *
  456. * @return {string} The Latin1 string.
  457. *
  458. * @static
  459. *
  460. * @example
  461. *
  462. * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
  463. */
  464. stringify: function (wordArray) {
  465. // Shortcuts
  466. var words = wordArray.words;
  467. var sigBytes = wordArray.sigBytes;
  468.  
  469. // Convert
  470. var latin1Chars = [];
  471. for (var i = 0; i < sigBytes; i++) {
  472. var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
  473. latin1Chars.push(String.fromCharCode(bite));
  474. }
  475.  
  476. return latin1Chars.join('');
  477. },
  478.  
  479. /**
  480. * Converts a Latin1 string to a word array.
  481. *
  482. * @param {string} latin1Str The Latin1 string.
  483. *
  484. * @return {WordArray} The word array.
  485. *
  486. * @static
  487. *
  488. * @example
  489. *
  490. * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
  491. */
  492. parse: function (latin1Str) {
  493. // Shortcut
  494. var latin1StrLength = latin1Str.length;
  495.  
  496. // Convert
  497. var words = [];
  498. for (var i = 0; i < latin1StrLength; i++) {
  499. words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
  500. }
  501.  
  502. return new WordArray.init(words, latin1StrLength);
  503. }
  504. };
  505.  
  506. /**
  507. * UTF-8 encoding strategy.
  508. */
  509. var Utf8 = C_enc.Utf8 = {
  510. /**
  511. * Converts a word array to a UTF-8 string.
  512. *
  513. * @param {WordArray} wordArray The word array.
  514. *
  515. * @return {string} The UTF-8 string.
  516. *
  517. * @static
  518. *
  519. * @example
  520. *
  521. * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
  522. */
  523. stringify: function (wordArray) {
  524. try {
  525. return decodeURIComponent(escape(Latin1.stringify(wordArray)));
  526. } catch (e) {
  527. throw new Error('Malformed UTF-8 data');
  528. }
  529. },
  530.  
  531. /**
  532. * Converts a UTF-8 string to a word array.
  533. *
  534. * @param {string} utf8Str The UTF-8 string.
  535. *
  536. * @return {WordArray} The word array.
  537. *
  538. * @static
  539. *
  540. * @example
  541. *
  542. * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
  543. */
  544. parse: function (utf8Str) {
  545. return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
  546. }
  547. };
  548.  
  549. /**
  550. * Abstract buffered block algorithm template.
  551. *
  552. * The property blockSize must be implemented in a concrete subtype.
  553. *
  554. * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
  555. */
  556. var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
  557. /**
  558. * Resets this block algorithm's data buffer to its initial state.
  559. *
  560. * @example
  561. *
  562. * bufferedBlockAlgorithm.reset();
  563. */
  564. reset: function () {
  565. // Initial values
  566. this._data = new WordArray.init();
  567. this._nDataBytes = 0;
  568. },
  569.  
  570. /**
  571. * Adds new data to this block algorithm's buffer.
  572. *
  573. * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
  574. *
  575. * @example
  576. *
  577. * bufferedBlockAlgorithm._append('data');
  578. * bufferedBlockAlgorithm._append(wordArray);
  579. */
  580. _append: function (data) {
  581. // Convert string to WordArray, else assume WordArray already
  582. if (typeof data == 'string') {
  583. data = Utf8.parse(data);
  584. }
  585.  
  586. // Append
  587. this._data.concat(data);
  588. this._nDataBytes += data.sigBytes;
  589. },
  590.  
  591. /**
  592. * Processes available data blocks.
  593. *
  594. * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
  595. *
  596. * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
  597. *
  598. * @return {WordArray} The processed data.
  599. *
  600. * @example
  601. *
  602. * var processedData = bufferedBlockAlgorithm._process();
  603. * var processedData = bufferedBlockAlgorithm._process(!!'flush');
  604. */
  605. _process: function (doFlush) {
  606. var processedWords;
  607.  
  608. // Shortcuts
  609. var data = this._data;
  610. var dataWords = data.words;
  611. var dataSigBytes = data.sigBytes;
  612. var blockSize = this.blockSize;
  613. var blockSizeBytes = blockSize * 4;
  614.  
  615. // Count blocks ready
  616. var nBlocksReady = dataSigBytes / blockSizeBytes;
  617. if (doFlush) {
  618. // Round up to include partial blocks
  619. nBlocksReady = Math.ceil(nBlocksReady);
  620. } else {
  621. // Round down to include only full blocks,
  622. // less the number of blocks that must remain in the buffer
  623. nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
  624. }
  625.  
  626. // Count words ready
  627. var nWordsReady = nBlocksReady * blockSize;
  628.  
  629. // Count bytes ready
  630. var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
  631.  
  632. // Process blocks
  633. if (nWordsReady) {
  634. for (var offset = 0; offset < nWordsReady; offset += blockSize) {
  635. // Perform concrete-algorithm logic
  636. this._doProcessBlock(dataWords, offset);
  637. }
  638.  
  639. // Remove processed words
  640. processedWords = dataWords.splice(0, nWordsReady);
  641. data.sigBytes -= nBytesReady;
  642. }
  643.  
  644. // Return processed words
  645. return new WordArray.init(processedWords, nBytesReady);
  646. },
  647.  
  648. /**
  649. * Creates a copy of this object.
  650. *
  651. * @return {Object} The clone.
  652. *
  653. * @example
  654. *
  655. * var clone = bufferedBlockAlgorithm.clone();
  656. */
  657. clone: function () {
  658. var clone = Base.clone.call(this);
  659. clone._data = this._data.clone();
  660.  
  661. return clone;
  662. },
  663.  
  664. _minBufferSize: 0
  665. });
  666.  
  667. /**
  668. * Abstract hasher template.
  669. *
  670. * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
  671. */
  672. var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
  673. /**
  674. * Configuration options.
  675. */
  676. cfg: Base.extend(),
  677.  
  678. /**
  679. * Initializes a newly created hasher.
  680. *
  681. * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
  682. *
  683. * @example
  684. *
  685. * var hasher = CryptoJS.algo.SHA256.create();
  686. */
  687. init: function (cfg) {
  688. // Apply config defaults
  689. this.cfg = this.cfg.extend(cfg);
  690.  
  691. // Set initial values
  692. this.reset();
  693. },
  694.  
  695. /**
  696. * Resets this hasher to its initial state.
  697. *
  698. * @example
  699. *
  700. * hasher.reset();
  701. */
  702. reset: function () {
  703. // Reset data buffer
  704. BufferedBlockAlgorithm.reset.call(this);
  705.  
  706. // Perform concrete-hasher logic
  707. this._doReset();
  708. },
  709.  
  710. /**
  711. * Updates this hasher with a message.
  712. *
  713. * @param {WordArray|string} messageUpdate The message to append.
  714. *
  715. * @return {Hasher} This hasher.
  716. *
  717. * @example
  718. *
  719. * hasher.update('message');
  720. * hasher.update(wordArray);
  721. */
  722. update: function (messageUpdate) {
  723. // Append
  724. this._append(messageUpdate);
  725.  
  726. // Update the hash
  727. this._process();
  728.  
  729. // Chainable
  730. return this;
  731. },
  732.  
  733. /**
  734. * Finalizes the hash computation.
  735. * Note that the finalize operation is effectively a destructive, read-once operation.
  736. *
  737. * @param {WordArray|string} messageUpdate (Optional) A final message update.
  738. *
  739. * @return {WordArray} The hash.
  740. *
  741. * @example
  742. *
  743. * var hash = hasher.finalize();
  744. * var hash = hasher.finalize('message');
  745. * var hash = hasher.finalize(wordArray);
  746. */
  747. finalize: function (messageUpdate) {
  748. // Final message update
  749. if (messageUpdate) {
  750. this._append(messageUpdate);
  751. }
  752.  
  753. // Perform concrete-hasher logic
  754. var hash = this._doFinalize();
  755.  
  756. return hash;
  757. },
  758.  
  759. blockSize: 512/32,
  760.  
  761. /**
  762. * Creates a shortcut function to a hasher's object interface.
  763. *
  764. * @param {Hasher} hasher The hasher to create a helper for.
  765. *
  766. * @return {Function} The shortcut function.
  767. *
  768. * @static
  769. *
  770. * @example
  771. *
  772. * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
  773. */
  774. _createHelper: function (hasher) {
  775. return function (message, cfg) {
  776. return new hasher.init(cfg).finalize(message);
  777. };
  778. },
  779.  
  780. /**
  781. * Creates a shortcut function to the HMAC's object interface.
  782. *
  783. * @param {Hasher} hasher The hasher to use in this HMAC helper.
  784. *
  785. * @return {Function} The shortcut function.
  786. *
  787. * @static
  788. *
  789. * @example
  790. *
  791. * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
  792. */
  793. _createHmacHelper: function (hasher) {
  794. return function (message, key) {
  795. return new C_algo.HMAC.init(hasher, key).finalize(message);
  796. };
  797. }
  798. });
  799.  
  800. /**
  801. * Algorithm namespace.
  802. */
  803. var C_algo = C.algo = {};
  804.  
  805. return C;
  806. }(Math));
  807.  
  808. (function () {
  809. // Shortcuts
  810. var C = CryptoJS;
  811. var C_lib = C.lib;
  812. var WordArray = C_lib.WordArray;
  813. var Hasher = C_lib.Hasher;
  814. var C_algo = C.algo;
  815.  
  816. // Reusable object
  817. var W = [];
  818.  
  819. /**
  820. * SHA-1 hash algorithm.
  821. */
  822. var SHA1 = C_algo.SHA1 = Hasher.extend({
  823. _doReset: function () {
  824. this._hash = new WordArray.init([
  825. 0x67452301, 0xefcdab89,
  826. 0x98badcfe, 0x10325476,
  827. 0xc3d2e1f0
  828. ]);
  829. },
  830.  
  831. _doProcessBlock: function (M, offset) {
  832. // Shortcut
  833. var H = this._hash.words;
  834.  
  835. // Working variables
  836. var a = H[0];
  837. var b = H[1];
  838. var c = H[2];
  839. var d = H[3];
  840. var e = H[4];
  841.  
  842. // Computation
  843. for (var i = 0; i < 80; i++) {
  844. if (i < 16) {
  845. W[i] = M[offset + i] | 0;
  846. } else {
  847. var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
  848. W[i] = (n << 1) | (n >>> 31);
  849. }
  850.  
  851. var t = ((a << 5) | (a >>> 27)) + e + W[i];
  852. if (i < 20) {
  853. t += ((b & c) | (~b & d)) + 0x5a827999;
  854. } else if (i < 40) {
  855. t += (b ^ c ^ d) + 0x6ed9eba1;
  856. } else if (i < 60) {
  857. t += ((b & c) | (b & d) | (c & d)) - 0x70e44324;
  858. } else /* if (i < 80) */ {
  859. t += (b ^ c ^ d) - 0x359d3e2a;
  860. }
  861.  
  862. e = d;
  863. d = c;
  864. c = (b << 30) | (b >>> 2);
  865. b = a;
  866. a = t;
  867. }
  868.  
  869. // Intermediate hash value
  870. H[0] = (H[0] + a) | 0;
  871. H[1] = (H[1] + b) | 0;
  872. H[2] = (H[2] + c) | 0;
  873. H[3] = (H[3] + d) | 0;
  874. H[4] = (H[4] + e) | 0;
  875. },
  876.  
  877. _doFinalize: function () {
  878. // Shortcuts
  879. var data = this._data;
  880. var dataWords = data.words;
  881.  
  882. var nBitsTotal = this._nDataBytes * 8;
  883. var nBitsLeft = data.sigBytes * 8;
  884.  
  885. // Add padding
  886. dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
  887. dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
  888. dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
  889. data.sigBytes = dataWords.length * 4;
  890.  
  891. // Hash final blocks
  892. this._process();
  893.  
  894. // Return final computed hash
  895. return this._hash;
  896. },
  897.  
  898. clone: function () {
  899. var clone = Hasher.clone.call(this);
  900. clone._hash = this._hash.clone();
  901.  
  902. return clone;
  903. }
  904. });
  905.  
  906. /**
  907. * Shortcut function to the hasher's object interface.
  908. *
  909. * @param {WordArray|string} message The message to hash.
  910. *
  911. * @return {WordArray} The hash.
  912. *
  913. * @static
  914. *
  915. * @example
  916. *
  917. * var hash = CryptoJS.SHA1('message');
  918. * var hash = CryptoJS.SHA1(wordArray);
  919. */
  920. C.SHA1 = Hasher._createHelper(SHA1);
  921.  
  922. /**
  923. * Shortcut function to the HMAC's object interface.
  924. *
  925. * @param {WordArray|string} message The message to hash.
  926. * @param {WordArray|string} key The secret key.
  927. *
  928. * @return {WordArray} The HMAC.
  929. *
  930. * @static
  931. *
  932. * @example
  933. *
  934. * var hmac = CryptoJS.HmacSHA1(message, key);
  935. */
  936. C.HmacSHA1 = Hasher._createHmacHelper(SHA1);
  937. }());
  938.  
  939. return CryptoJS;
  940.  
  941. }));
  942. // ===== dependencies end =====
  943.  
  944. function invirant(condition, message) {
  945. if (!condition) {
  946. throw '[豆瓣电影在线观看]', '获取电影名失败';
  947. }
  948. }
  949. function getMovieName() {
  950. var innerText = document.querySelector('.related-info').innerText;
  951. var movieName = innerText.substring(innerText, innerText.indexOf('的剧情简介'));
  952. invirant(movieName);
  953. return movieName;
  954. }
  955. function getMovieList(movieName) {
  956. const url = 'https://api.cupfox.app/api/v2/search/?text=' + movieName + '&type=0&from=0&size=10&token='+CryptoJS.SHA1(movieName+'URBBRGROUN').toString();
  957. return fetch(url)
  958. .then(function(res) {
  959. return res.json();
  960. })
  961. .then(function({resources}) {
  962. appendMovieLink(resources);
  963. })
  964. }
  965. function ensureContainer() {
  966. var movieContainer = document.querySelector('.gray_ad');
  967. if (movieContainer && movieContainer.innerText.includes('在哪儿看这部')) {
  968. return
  969. }
  970. var aside = document.querySelector('.aside');
  971. var grayad = document.createElement('div');
  972. grayad.className = 'gray_ad';
  973. grayad.innerHTML = [
  974. '<h2>',
  975. '在哪儿看这部电影 &nbsp;·&nbsp;·&nbsp;·&nbsp;·&nbsp;·&nbsp;·',
  976. '</h2>',
  977. '<ul class="bs">',
  978. '</ul>'
  979. ].join('');
  980. aside.prepend(grayad);
  981. }
  982. function appendMovieLink(resources) {
  983. var internalPlatform = ['爱奇艺', '腾讯视频', '优酷', 'bilibili'];
  984. var movieContainer = document.querySelector('.gray_ad');
  985. function append(resource) {
  986. if (internalPlatform.includes(resource.website)) {
  987. return;
  988. }
  989. var ul = movieContainer.querySelector('ul');
  990. var htmlContent = [
  991. '<a class="playBtn" target="_blank" href=', resource.url, '>',
  992. resource.website,
  993. '</a>',
  994. '<span class="buylink-price" style="left: 130px; position: absolute; color: #999;"><span>免费观看</span></span>'
  995. ].join('');
  996. var li = document.createElement('li');
  997. li.innerHTML = htmlContent;
  998. ul.append(li);
  999. }
  1000. resources.forEach(append);
  1001. }
  1002. (function() {
  1003. 'use strict';
  1004. ensureContainer();
  1005. var movieName = getMovieName();
  1006. getMovieList(movieName);
  1007. })();
  1008.  
  1009.  

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址