logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git

test_jsinterp.py (25455B)


  1. #!/usr/bin/env python
  2. from __future__ import unicode_literals
  3. # Allow direct execution
  4. import os
  5. import sys
  6. import unittest
  7. sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
  8. import math
  9. import re
  10. from youtube_dl.jsinterp import JS_Undefined, JSInterpreter
  11. class TestJSInterpreter(unittest.TestCase):
  12. def test_basic(self):
  13. jsi = JSInterpreter('function x(){;}')
  14. self.assertEqual(jsi.call_function('x'), None)
  15. self.assertEqual(repr(jsi.extract_function('x')), 'F<x>')
  16. jsi = JSInterpreter('function x3(){return 42;}')
  17. self.assertEqual(jsi.call_function('x3'), 42)
  18. jsi = JSInterpreter('function x3(){42}')
  19. self.assertEqual(jsi.call_function('x3'), None)
  20. jsi = JSInterpreter('var x5 = function(){return 42;}')
  21. self.assertEqual(jsi.call_function('x5'), 42)
  22. def test_calc(self):
  23. jsi = JSInterpreter('function x4(a){return 2*a+1;}')
  24. self.assertEqual(jsi.call_function('x4', 3), 7)
  25. def test_add(self):
  26. jsi = JSInterpreter('function f(){return 42 + 7;}')
  27. self.assertEqual(jsi.call_function('f'), 49)
  28. jsi = JSInterpreter('function f(){return 42 + undefined;}')
  29. self.assertTrue(math.isnan(jsi.call_function('f')))
  30. jsi = JSInterpreter('function f(){return 42 + null;}')
  31. self.assertEqual(jsi.call_function('f'), 42)
  32. def test_sub(self):
  33. jsi = JSInterpreter('function f(){return 42 - 7;}')
  34. self.assertEqual(jsi.call_function('f'), 35)
  35. jsi = JSInterpreter('function f(){return 42 - undefined;}')
  36. self.assertTrue(math.isnan(jsi.call_function('f')))
  37. jsi = JSInterpreter('function f(){return 42 - null;}')
  38. self.assertEqual(jsi.call_function('f'), 42)
  39. def test_mul(self):
  40. jsi = JSInterpreter('function f(){return 42 * 7;}')
  41. self.assertEqual(jsi.call_function('f'), 294)
  42. jsi = JSInterpreter('function f(){return 42 * undefined;}')
  43. self.assertTrue(math.isnan(jsi.call_function('f')))
  44. jsi = JSInterpreter('function f(){return 42 * null;}')
  45. self.assertEqual(jsi.call_function('f'), 0)
  46. def test_div(self):
  47. jsi = JSInterpreter('function f(a, b){return a / b;}')
  48. self.assertTrue(math.isnan(jsi.call_function('f', 0, 0)))
  49. self.assertTrue(math.isnan(jsi.call_function('f', JS_Undefined, 1)))
  50. self.assertTrue(math.isinf(jsi.call_function('f', 2, 0)))
  51. self.assertEqual(jsi.call_function('f', 0, 3), 0)
  52. def test_mod(self):
  53. jsi = JSInterpreter('function f(){return 42 % 7;}')
  54. self.assertEqual(jsi.call_function('f'), 0)
  55. jsi = JSInterpreter('function f(){return 42 % 0;}')
  56. self.assertTrue(math.isnan(jsi.call_function('f')))
  57. jsi = JSInterpreter('function f(){return 42 % undefined;}')
  58. self.assertTrue(math.isnan(jsi.call_function('f')))
  59. def test_exp(self):
  60. jsi = JSInterpreter('function f(){return 42 ** 2;}')
  61. self.assertEqual(jsi.call_function('f'), 1764)
  62. jsi = JSInterpreter('function f(){return 42 ** undefined;}')
  63. self.assertTrue(math.isnan(jsi.call_function('f')))
  64. jsi = JSInterpreter('function f(){return 42 ** null;}')
  65. self.assertEqual(jsi.call_function('f'), 1)
  66. jsi = JSInterpreter('function f(){return undefined ** 42;}')
  67. self.assertTrue(math.isnan(jsi.call_function('f')))
  68. def test_empty_return(self):
  69. jsi = JSInterpreter('function f(){return; y()}')
  70. self.assertEqual(jsi.call_function('f'), None)
  71. def test_morespace(self):
  72. jsi = JSInterpreter('function x (a) { return 2 * a + 1 ; }')
  73. self.assertEqual(jsi.call_function('x', 3), 7)
  74. jsi = JSInterpreter('function f () { x = 2 ; return x; }')
  75. self.assertEqual(jsi.call_function('f'), 2)
  76. def test_strange_chars(self):
  77. jsi = JSInterpreter('function $_xY1 ($_axY1) { var $_axY2 = $_axY1 + 1; return $_axY2; }')
  78. self.assertEqual(jsi.call_function('$_xY1', 20), 21)
  79. def test_operators(self):
  80. jsi = JSInterpreter('function f(){return 1 << 5;}')
  81. self.assertEqual(jsi.call_function('f'), 32)
  82. jsi = JSInterpreter('function f(){return 2 ** 5}')
  83. self.assertEqual(jsi.call_function('f'), 32)
  84. jsi = JSInterpreter('function f(){return 19 & 21;}')
  85. self.assertEqual(jsi.call_function('f'), 17)
  86. jsi = JSInterpreter('function f(){return 11 >> 2;}')
  87. self.assertEqual(jsi.call_function('f'), 2)
  88. jsi = JSInterpreter('function f(){return []? 2+3: 4;}')
  89. self.assertEqual(jsi.call_function('f'), 5)
  90. jsi = JSInterpreter('function f(){return 1 == 2}')
  91. self.assertEqual(jsi.call_function('f'), False)
  92. jsi = JSInterpreter('function f(){return 0 && 1 || 2;}')
  93. self.assertEqual(jsi.call_function('f'), 2)
  94. jsi = JSInterpreter('function f(){return 0 ?? 42;}')
  95. self.assertEqual(jsi.call_function('f'), 0)
  96. jsi = JSInterpreter('function f(){return "life, the universe and everything" < 42;}')
  97. self.assertFalse(jsi.call_function('f'))
  98. def test_array_access(self):
  99. jsi = JSInterpreter('function f(){var x = [1,2,3]; x[0] = 4; x[0] = 5; x[2.0] = 7; return x;}')
  100. self.assertEqual(jsi.call_function('f'), [5, 2, 7])
  101. def test_parens(self):
  102. jsi = JSInterpreter('function f(){return (1) + (2) * ((( (( (((((3)))))) )) ));}')
  103. self.assertEqual(jsi.call_function('f'), 7)
  104. jsi = JSInterpreter('function f(){return (1 + 2) * 3;}')
  105. self.assertEqual(jsi.call_function('f'), 9)
  106. def test_quotes(self):
  107. jsi = JSInterpreter(r'function f(){return "a\"\\("}')
  108. self.assertEqual(jsi.call_function('f'), r'a"\(')
  109. def test_assignments(self):
  110. jsi = JSInterpreter('function f(){var x = 20; x = 30 + 1; return x;}')
  111. self.assertEqual(jsi.call_function('f'), 31)
  112. jsi = JSInterpreter('function f(){var x = 20; x += 30 + 1; return x;}')
  113. self.assertEqual(jsi.call_function('f'), 51)
  114. jsi = JSInterpreter('function f(){var x = 20; x -= 30 + 1; return x;}')
  115. self.assertEqual(jsi.call_function('f'), -11)
  116. def test_comments(self):
  117. 'Skipping: Not yet fully implemented'
  118. return
  119. jsi = JSInterpreter('''
  120. function x() {
  121. var x = /* 1 + */ 2;
  122. var y = /* 30
  123. * 40 */ 50;
  124. return x + y;
  125. }
  126. ''')
  127. self.assertEqual(jsi.call_function('x'), 52)
  128. jsi = JSInterpreter('''
  129. function f() {
  130. var x = "/*";
  131. var y = 1 /* comment */ + 2;
  132. return y;
  133. }
  134. ''')
  135. self.assertEqual(jsi.call_function('f'), 3)
  136. def test_precedence(self):
  137. jsi = JSInterpreter('''
  138. function x() {
  139. var a = [10, 20, 30, 40, 50];
  140. var b = 6;
  141. a[0]=a[b%a.length];
  142. return a;
  143. }''')
  144. self.assertEqual(jsi.call_function('x'), [20, 20, 30, 40, 50])
  145. def test_builtins(self):
  146. jsi = JSInterpreter('''
  147. function x() { return NaN }
  148. ''')
  149. self.assertTrue(math.isnan(jsi.call_function('x')))
  150. def test_Date(self):
  151. jsi = JSInterpreter('''
  152. function x(dt) { return new Date(dt) - 0; }
  153. ''')
  154. self.assertEqual(jsi.call_function('x', 'Wednesday 31 December 1969 18:01:26 MDT'), 86000)
  155. # date format m/d/y
  156. self.assertEqual(jsi.call_function('x', '12/31/1969 18:01:26 MDT'), 86000)
  157. # epoch 0
  158. self.assertEqual(jsi.call_function('x', '1 January 1970 00:00:00 UTC'), 0)
  159. def test_call(self):
  160. jsi = JSInterpreter('''
  161. function x() { return 2; }
  162. function y(a) { return x() + (a?a:0); }
  163. function z() { return y(3); }
  164. ''')
  165. self.assertEqual(jsi.call_function('z'), 5)
  166. self.assertEqual(jsi.call_function('y'), 2)
  167. def test_if(self):
  168. jsi = JSInterpreter('''
  169. function x() {
  170. let a = 9;
  171. if (0==0) {a++}
  172. return a
  173. }''')
  174. self.assertEqual(jsi.call_function('x'), 10)
  175. jsi = JSInterpreter('''
  176. function x() {
  177. if (0==0) {return 10}
  178. }''')
  179. self.assertEqual(jsi.call_function('x'), 10)
  180. jsi = JSInterpreter('''
  181. function x() {
  182. if (0!=0) {return 1}
  183. else {return 10}
  184. }''')
  185. self.assertEqual(jsi.call_function('x'), 10)
  186. """ # Unsupported
  187. jsi = JSInterpreter('''
  188. function x() {
  189. if (0!=0) return 1;
  190. else {return 10}
  191. }''')
  192. self.assertEqual(jsi.call_function('x'), 10)
  193. """
  194. def test_elseif(self):
  195. jsi = JSInterpreter('''
  196. function x() {
  197. if (0!=0) {return 1}
  198. else if (1==0) {return 2}
  199. else {return 10}
  200. }''')
  201. self.assertEqual(jsi.call_function('x'), 10)
  202. """ # Unsupported
  203. jsi = JSInterpreter('''
  204. function x() {
  205. if (0!=0) return 1;
  206. else if (1==0) {return 2}
  207. else {return 10}
  208. }''')
  209. self.assertEqual(jsi.call_function('x'), 10)
  210. # etc
  211. """
  212. def test_for_loop(self):
  213. # function x() { a=0; for (i=0; i-10; i++) {a++} a }
  214. jsi = JSInterpreter('''
  215. function x() { a=0; for (i=0; i-10; i++) {a++} return a }
  216. ''')
  217. self.assertEqual(jsi.call_function('x'), 10)
  218. def test_while_loop(self):
  219. # function x() { a=0; while (a<10) {a++} a }
  220. jsi = JSInterpreter('''
  221. function x() { a=0; while (a<10) {a++} return a }
  222. ''')
  223. self.assertEqual(jsi.call_function('x'), 10)
  224. def test_switch(self):
  225. jsi = JSInterpreter('''
  226. function x(f) { switch(f){
  227. case 1:f+=1;
  228. case 2:f+=2;
  229. case 3:f+=3;break;
  230. case 4:f+=4;
  231. default:f=0;
  232. } return f }
  233. ''')
  234. self.assertEqual(jsi.call_function('x', 1), 7)
  235. self.assertEqual(jsi.call_function('x', 3), 6)
  236. self.assertEqual(jsi.call_function('x', 5), 0)
  237. def test_switch_default(self):
  238. jsi = JSInterpreter('''
  239. function x(f) { switch(f){
  240. case 2: f+=2;
  241. default: f-=1;
  242. case 5:
  243. case 6: f+=6;
  244. case 0: break;
  245. case 1: f+=1;
  246. } return f }
  247. ''')
  248. self.assertEqual(jsi.call_function('x', 1), 2)
  249. self.assertEqual(jsi.call_function('x', 5), 11)
  250. self.assertEqual(jsi.call_function('x', 9), 14)
  251. def test_try(self):
  252. jsi = JSInterpreter('''
  253. function x() { try{return 10} catch(e){return 5} }
  254. ''')
  255. self.assertEqual(jsi.call_function('x'), 10)
  256. def test_catch(self):
  257. jsi = JSInterpreter('''
  258. function x() { try{throw 10} catch(e){return 5} }
  259. ''')
  260. self.assertEqual(jsi.call_function('x'), 5)
  261. def test_finally(self):
  262. jsi = JSInterpreter('''
  263. function x() { try{throw 10} finally {return 42} }
  264. ''')
  265. self.assertEqual(jsi.call_function('x'), 42)
  266. jsi = JSInterpreter('''
  267. function x() { try{throw 10} catch(e){return 5} finally {return 42} }
  268. ''')
  269. self.assertEqual(jsi.call_function('x'), 42)
  270. def test_nested_try(self):
  271. jsi = JSInterpreter('''
  272. function x() {try {
  273. try{throw 10} finally {throw 42}
  274. } catch(e){return 5} }
  275. ''')
  276. self.assertEqual(jsi.call_function('x'), 5)
  277. def test_for_loop_continue(self):
  278. jsi = JSInterpreter('''
  279. function x() { a=0; for (i=0; i-10; i++) { continue; a++ } return a }
  280. ''')
  281. self.assertEqual(jsi.call_function('x'), 0)
  282. def test_for_loop_break(self):
  283. jsi = JSInterpreter('''
  284. function x() { a=0; for (i=0; i-10; i++) { break; a++ } return a }
  285. ''')
  286. self.assertEqual(jsi.call_function('x'), 0)
  287. def test_for_loop_try(self):
  288. jsi = JSInterpreter('''
  289. function x() {
  290. for (i=0; i-10; i++) { try { if (i == 5) throw i} catch {return 10} finally {break} };
  291. return 42 }
  292. ''')
  293. self.assertEqual(jsi.call_function('x'), 42)
  294. def test_literal_list(self):
  295. jsi = JSInterpreter('''
  296. function x() { return [1, 2, "asdf", [5, 6, 7]][3] }
  297. ''')
  298. self.assertEqual(jsi.call_function('x'), [5, 6, 7])
  299. def test_comma(self):
  300. jsi = JSInterpreter('''
  301. function x() { a=5; a -= 1, a+=3; return a }
  302. ''')
  303. self.assertEqual(jsi.call_function('x'), 7)
  304. jsi = JSInterpreter('''
  305. function x() { a=5; return (a -= 1, a+=3, a); }
  306. ''')
  307. self.assertEqual(jsi.call_function('x'), 7)
  308. jsi = JSInterpreter('''
  309. function x() { return (l=[0,1,2,3], function(a, b){return a+b})((l[1], l[2]), l[3]) }
  310. ''')
  311. self.assertEqual(jsi.call_function('x'), 5)
  312. def test_void(self):
  313. jsi = JSInterpreter('''
  314. function x() { return void 42; }
  315. ''')
  316. self.assertEqual(jsi.call_function('x'), None)
  317. def test_return_function(self):
  318. jsi = JSInterpreter('''
  319. function x() { return [1, function(){return 1}][1] }
  320. ''')
  321. self.assertEqual(jsi.call_function('x')([]), 1)
  322. def test_null(self):
  323. jsi = JSInterpreter('''
  324. function x() { return null; }
  325. ''')
  326. self.assertIs(jsi.call_function('x'), None)
  327. jsi = JSInterpreter('''
  328. function x() { return [null > 0, null < 0, null == 0, null === 0]; }
  329. ''')
  330. self.assertEqual(jsi.call_function('x'), [False, False, False, False])
  331. jsi = JSInterpreter('''
  332. function x() { return [null >= 0, null <= 0]; }
  333. ''')
  334. self.assertEqual(jsi.call_function('x'), [True, True])
  335. def test_undefined(self):
  336. jsi = JSInterpreter('''
  337. function x() { return undefined === undefined; }
  338. ''')
  339. self.assertTrue(jsi.call_function('x'))
  340. jsi = JSInterpreter('''
  341. function x() { return undefined; }
  342. ''')
  343. self.assertIs(jsi.call_function('x'), JS_Undefined)
  344. jsi = JSInterpreter('''
  345. function x() { let v; return v; }
  346. ''')
  347. self.assertIs(jsi.call_function('x'), JS_Undefined)
  348. jsi = JSInterpreter('''
  349. function x() { return [undefined === undefined, undefined == undefined, undefined < undefined, undefined > undefined]; }
  350. ''')
  351. self.assertEqual(jsi.call_function('x'), [True, True, False, False])
  352. jsi = JSInterpreter('''
  353. function x() { return [undefined === 0, undefined == 0, undefined < 0, undefined > 0]; }
  354. ''')
  355. self.assertEqual(jsi.call_function('x'), [False, False, False, False])
  356. jsi = JSInterpreter('''
  357. function x() { return [undefined >= 0, undefined <= 0]; }
  358. ''')
  359. self.assertEqual(jsi.call_function('x'), [False, False])
  360. jsi = JSInterpreter('''
  361. function x() { return [undefined > null, undefined < null, undefined == null, undefined === null]; }
  362. ''')
  363. self.assertEqual(jsi.call_function('x'), [False, False, True, False])
  364. jsi = JSInterpreter('''
  365. function x() { return [undefined === null, undefined == null, undefined < null, undefined > null]; }
  366. ''')
  367. self.assertEqual(jsi.call_function('x'), [False, True, False, False])
  368. jsi = JSInterpreter('''
  369. function x() { let v; return [42+v, v+42, v**42, 42**v, 0**v]; }
  370. ''')
  371. for y in jsi.call_function('x'):
  372. self.assertTrue(math.isnan(y))
  373. jsi = JSInterpreter('''
  374. function x() { let v; return v**0; }
  375. ''')
  376. self.assertEqual(jsi.call_function('x'), 1)
  377. jsi = JSInterpreter('''
  378. function x() { let v; return [v>42, v<=42, v&&42, 42&&v]; }
  379. ''')
  380. self.assertEqual(jsi.call_function('x'), [False, False, JS_Undefined, JS_Undefined])
  381. jsi = JSInterpreter('function x(){return undefined ?? 42; }')
  382. self.assertEqual(jsi.call_function('x'), 42)
  383. def test_object(self):
  384. jsi = JSInterpreter('''
  385. function x() { return {}; }
  386. ''')
  387. self.assertEqual(jsi.call_function('x'), {})
  388. jsi = JSInterpreter('''
  389. function x() { let a = {m1: 42, m2: 0 }; return [a["m1"], a.m2]; }
  390. ''')
  391. self.assertEqual(jsi.call_function('x'), [42, 0])
  392. jsi = JSInterpreter('''
  393. function x() { let a; return a?.qq; }
  394. ''')
  395. self.assertIs(jsi.call_function('x'), JS_Undefined)
  396. jsi = JSInterpreter('''
  397. function x() { let a = {m1: 42, m2: 0 }; return a?.qq; }
  398. ''')
  399. self.assertIs(jsi.call_function('x'), JS_Undefined)
  400. def test_regex(self):
  401. jsi = JSInterpreter('''
  402. function x() { let a=/,,[/,913,/](,)}/; }
  403. ''')
  404. self.assertIs(jsi.call_function('x'), None)
  405. jsi = JSInterpreter('''
  406. function x() { let a=/,,[/,913,/](,)}/; "".replace(a, ""); return a; }
  407. ''')
  408. attrs = set(('findall', 'finditer', 'match', 'scanner', 'search',
  409. 'split', 'sub', 'subn'))
  410. if sys.version_info >= (2, 7):
  411. # documented for 2.6 but may not be found
  412. attrs.update(('flags', 'groupindex', 'groups', 'pattern'))
  413. self.assertSetEqual(set(dir(jsi.call_function('x'))) & attrs, attrs)
  414. jsi = JSInterpreter('''
  415. function x() { let a=/,,[/,913,/](,)}/i; return a; }
  416. ''')
  417. self.assertEqual(jsi.call_function('x').flags & ~re.U, re.I)
  418. jsi = JSInterpreter(r'''
  419. function x() { let a="data-name".replace("data-", ""); return a }
  420. ''')
  421. self.assertEqual(jsi.call_function('x'), 'name')
  422. jsi = JSInterpreter(r'''
  423. function x() { let a="data-name".replace(new RegExp("^.+-"), ""); return a; }
  424. ''')
  425. self.assertEqual(jsi.call_function('x'), 'name')
  426. jsi = JSInterpreter(r'''
  427. function x() { let a="data-name".replace(/^.+-/, ""); return a; }
  428. ''')
  429. self.assertEqual(jsi.call_function('x'), 'name')
  430. jsi = JSInterpreter(r'''
  431. function x() { let a="data-name".replace(/a/g, "o"); return a; }
  432. ''')
  433. self.assertEqual(jsi.call_function('x'), 'doto-nome')
  434. jsi = JSInterpreter(r'''
  435. function x() { let a="data-name".replaceAll("a", "o"); return a; }
  436. ''')
  437. self.assertEqual(jsi.call_function('x'), 'doto-nome')
  438. jsi = JSInterpreter(r'''
  439. function x() { let a=[/[)\\]/]; return a[0]; }
  440. ''')
  441. self.assertEqual(jsi.call_function('x').pattern, r'[)\\]')
  442. """ # fails
  443. jsi = JSInterpreter(r'''
  444. function x() { let a=100; a/=/[0-9]+/.exec('divide by 20 today')[0]; }
  445. ''')
  446. self.assertEqual(jsi.call_function('x'), 5)
  447. """
  448. def test_char_code_at(self):
  449. jsi = JSInterpreter('function x(i){return "test".charCodeAt(i)}')
  450. self.assertEqual(jsi.call_function('x', 0), 116)
  451. self.assertEqual(jsi.call_function('x', 1), 101)
  452. self.assertEqual(jsi.call_function('x', 2), 115)
  453. self.assertEqual(jsi.call_function('x', 3), 116)
  454. self.assertEqual(jsi.call_function('x', 4), None)
  455. self.assertEqual(jsi.call_function('x', 'not_a_number'), 116)
  456. def test_bitwise_operators_overflow(self):
  457. jsi = JSInterpreter('function x(){return -524999584 << 5}')
  458. self.assertEqual(jsi.call_function('x'), 379882496)
  459. jsi = JSInterpreter('function x(){return 1236566549 << 5}')
  460. self.assertEqual(jsi.call_function('x'), 915423904)
  461. def test_bitwise_operators_madness(self):
  462. jsi = JSInterpreter('function x(){return null << 5}')
  463. self.assertEqual(jsi.call_function('x'), 0)
  464. jsi = JSInterpreter('function x(){return undefined >> 5}')
  465. self.assertEqual(jsi.call_function('x'), 0)
  466. jsi = JSInterpreter('function x(){return 42 << NaN}')
  467. self.assertEqual(jsi.call_function('x'), 42)
  468. jsi = JSInterpreter('function x(){return 42 << Infinity}')
  469. self.assertEqual(jsi.call_function('x'), 42)
  470. def test_32066(self):
  471. jsi = JSInterpreter("function x(){return Math.pow(3, 5) + new Date('1970-01-01T08:01:42.000+08:00') / 1000 * -239 - -24205;}")
  472. self.assertEqual(jsi.call_function('x'), 70)
  473. def test_unary_operators(self):
  474. jsi = JSInterpreter('function f(){return 2 - - - 2;}')
  475. self.assertEqual(jsi.call_function('f'), 0)
  476. # fails
  477. # jsi = JSInterpreter('function f(){return 2 + - + - - 2;}')
  478. # self.assertEqual(jsi.call_function('f'), 0)
  479. """ # fails so far
  480. def test_packed(self):
  481. jsi = JSInterpreter('''function x(p,a,c,k,e,d){while(c--)if(k[c])p=p.replace(new RegExp('\\b'+c.toString(a)+'\\b','g'),k[c]);return p}''')
  482. self.assertEqual(jsi.call_function('x', '''h 7=g("1j");7.7h({7g:[{33:"w://7f-7e-7d-7c.v.7b/7a/79/78/77/76.74?t=73&s=2s&e=72&f=2t&71=70.0.0.1&6z=6y&6x=6w"}],6v:"w://32.v.u/6u.31",16:"r%",15:"r%",6t:"6s",6r:"",6q:"l",6p:"l",6o:"6n",6m:\'6l\',6k:"6j",9:[{33:"/2u?b=6i&n=50&6h=w://32.v.u/6g.31",6f:"6e"}],1y:{6d:1,6c:\'#6b\',6a:\'#69\',68:"67",66:30,65:r,},"64":{63:"%62 2m%m%61%5z%5y%5x.u%5w%5v%5u.2y%22 2k%m%1o%22 5t%m%1o%22 5s%m%1o%22 2j%m%5r%22 16%m%5q%22 15%m%5p%22 5o%2z%5n%5m%2z",5l:"w://v.u/d/1k/5k.2y",5j:[]},\'5i\':{"5h":"5g"},5f:"5e",5d:"w://v.u",5c:{},5b:l,1x:[0.25,0.50,0.75,1,1.25,1.5,2]});h 1m,1n,5a;h 59=0,58=0;h 7=g("1j");h 2x=0,57=0,56=0;$.55({54:{\'53-52\':\'2i-51\'}});7.j(\'4z\',6(x){c(5>0&&x.1l>=5&&1n!=1){1n=1;$(\'q.4y\').4x(\'4w\')}});7.j(\'13\',6(x){2x=x.1l});7.j(\'2g\',6(x){2w(x)});7.j(\'4v\',6(){$(\'q.2v\').4u()});6 2w(x){$(\'q.2v\').4t();c(1m)19;1m=1;17=0;c(4s.4r===l){17=1}$.4q(\'/2u?b=4p&2l=1k&4o=2t-4n-4m-2s-4l&4k=&4j=&4i=&17=\'+17,6(2r){$(\'#4h\').4g(2r)});$(\'.3-8-4f-4e:4d("4c")\').2h(6(e){2q();g().4b(0);g().4a(l)});6 2q(){h $14=$("<q />").2p({1l:"49",16:"r%",15:"r%",48:0,2n:0,2o:47,46:"45(10%, 10%, 10%, 0.4)","44-43":"42"});$("<41 />").2p({16:"60%",15:"60%",2o:40,"3z-2n":"3y"}).3x({\'2m\':\'/?b=3w&2l=1k\',\'2k\':\'0\',\'2j\':\'2i\'}).2f($14);$14.2h(6(){$(3v).3u();g().2g()});$14.2f($(\'#1j\'))}g().13(0);}6 3t(){h 9=7.1b(2e);2d.2c(9);c(9.n>1){1r(i=0;i<9.n;i++){c(9[i].1a==2e){2d.2c(\'!!=\'+i);7.1p(i)}}}}7.j(\'3s\',6(){g().1h("/2a/3r.29","3q 10 28",6(){g().13(g().27()+10)},"2b");$("q[26=2b]").23().21(\'.3-20-1z\');g().1h("/2a/3p.29","3o 10 28",6(){h 12=g().27()-10;c(12<0)12=0;g().13(12)},"24");$("q[26=24]").23().21(\'.3-20-1z\');});6 1i(){}7.j(\'3n\',6(){1i()});7.j(\'3m\',6(){1i()});7.j("k",6(y){h 9=7.1b();c(9.n<2)19;$(\'.3-8-3l-3k\').3j(6(){$(\'#3-8-a-k\').1e(\'3-8-a-z\');$(\'.3-a-k\').p(\'o-1f\',\'11\')});7.1h("/3i/3h.3g","3f 3e",6(){$(\'.3-1w\').3d(\'3-8-1v\');$(\'.3-8-1y, .3-8-1x\').p(\'o-1g\',\'11\');c($(\'.3-1w\').3c(\'3-8-1v\')){$(\'.3-a-k\').p(\'o-1g\',\'l\');$(\'.3-a-k\').p(\'o-1f\',\'l\');$(\'.3-8-a\').1e(\'3-8-a-z\');$(\'.3-8-a:1u\').3b(\'3-8-a-z\')}3a{$(\'.3-a-k\').p(\'o-1g\',\'11\');$(\'.3-a-k\').p(\'o-1f\',\'11\');$(\'.3-8-a:1u\').1e(\'3-8-a-z\')}},"39");7.j("38",6(y){1d.37(\'1c\',y.9[y.36].1a)});c(1d.1t(\'1c\')){35("1s(1d.1t(\'1c\'));",34)}});h 18;6 1s(1q){h 9=7.1b();c(9.n>1){1r(i=0;i<9.n;i++){c(9[i].1a==1q){c(i==18){19}18=i;7.1p(i)}}}}',36,270,'|||jw|||function|player|settings|tracks|submenu||if||||jwplayer|var||on|audioTracks|true|3D|length|aria|attr|div|100|||sx|filemoon|https||event|active||false|tt|seek|dd|height|width|adb|current_audio|return|name|getAudioTracks|default_audio|localStorage|removeClass|expanded|checked|addButton|callMeMaybe|vplayer|0fxcyc2ajhp1|position|vvplay|vvad|220|setCurrentAudioTrack|audio_name|for|audio_set|getItem|last|open|controls|playbackRates|captions|rewind|icon|insertAfter||detach|ff00||button|getPosition|sec|png|player8|ff11|log|console|track_name|appendTo|play|click|no|scrolling|frameborder|file_code|src|top|zIndex|css|showCCform|data|1662367683|383371|dl|video_ad|doPlay|prevt|mp4|3E||jpg|thumbs|file|300|setTimeout|currentTrack|setItem|audioTrackChanged|dualSound|else|addClass|hasClass|toggleClass|Track|Audio|svg|dualy|images|mousedown|buttons|topbar|playAttemptFailed|beforePlay|Rewind|fr|Forward|ff|ready|set_audio_track|remove|this|upload_srt|prop|50px|margin|1000001|iframe|center|align|text|rgba|background|1000000|left|absolute|pause|setCurrentCaptions|Upload|contains|item|content|html|fviews|referer|prem|embed|3e57249ef633e0d03bf76ceb8d8a4b65|216|83|hash|view|get|TokenZir|window|hide|show|complete|slow|fadeIn|video_ad_fadein|time||cache|Cache|Content|headers|ajaxSetup|v2done|tott|vastdone2|vastdone1|vvbefore|playbackRateControls|cast|aboutlink|FileMoon|abouttext|UHD|1870|qualityLabels|sites|GNOME_POWER|link|2Fiframe|3C|allowfullscreen|22360|22640|22no|marginheight|marginwidth|2FGNOME_POWER|2F0fxcyc2ajhp1|2Fe|2Ffilemoon|2F|3A||22https|3Ciframe|code|sharing|fontOpacity|backgroundOpacity|Tahoma|fontFamily|303030|backgroundColor|FFFFFF|color|userFontScale|thumbnails|kind|0fxcyc2ajhp10000|url|get_slides|start|startparam|none|preload|html5|primary|hlshtml|androidhls|duration|uniform|stretching|0fxcyc2ajhp1_xt|image|2048|sp|6871|asn|127|srv|43200|_g3XlBcu2lmD9oDexD2NLWSmah2Nu3XcDrl93m9PwXY|m3u8||master|0fxcyc2ajhp1_x|00076|01|hls2|to|s01|delivery|storage|moon|sources|setup'''.split('|')))
  483. """
  484. if __name__ == '__main__':
  485. unittest.main()