You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1472 lines
36 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. import re
  4. import time
  5. import xml.etree.ElementTree as etree
  6. from .common import InfoExtractor
  7. from ..compat import compat_urlparse
  8. from ..utils import (
  9. unescapeHTML,
  10. urlencode_postdata,
  11. unified_timestamp,
  12. ExtractorError,
  13. )
  14. MSO_INFO = {
  15. 'DTV': {
  16. 'name': 'DIRECTV',
  17. 'username_field': 'username',
  18. 'password_field': 'password',
  19. },
  20. 'Rogers': {
  21. 'name': 'Rogers',
  22. 'username_field': 'UserName',
  23. 'password_field': 'UserPassword',
  24. },
  25. 'Comcast_SSO': {
  26. 'name': 'Comcast XFINITY',
  27. 'username_field': 'user',
  28. 'password_field': 'passwd',
  29. },
  30. 'thr030': {
  31. 'name': '3 Rivers Communications'
  32. },
  33. 'com140': {
  34. 'name': 'Access Montana'
  35. },
  36. 'acecommunications': {
  37. 'name': 'AcenTek'
  38. },
  39. 'acm010': {
  40. 'name': 'Acme Communications'
  41. },
  42. 'ada020': {
  43. 'name': 'Adams Cable Service'
  44. },
  45. 'alb020': {
  46. 'name': 'Albany Mutual Telephone'
  47. },
  48. 'algona': {
  49. 'name': 'Algona Municipal Utilities'
  50. },
  51. 'allwest': {
  52. 'name': 'All West Communications'
  53. },
  54. 'all025': {
  55. 'name': 'Allen\'s Communications'
  56. },
  57. 'spl010': {
  58. 'name': 'Alliance Communications'
  59. },
  60. 'all070': {
  61. 'name': 'ALLO Communications'
  62. },
  63. 'alpine': {
  64. 'name': 'Alpine Communications'
  65. },
  66. 'hun015': {
  67. 'name': 'American Broadband'
  68. },
  69. 'nwc010': {
  70. 'name': 'American Broadband Missouri'
  71. },
  72. 'com130-02': {
  73. 'name': 'American Community Networks'
  74. },
  75. 'com130-01': {
  76. 'name': 'American Warrior Networks'
  77. },
  78. 'tom020': {
  79. 'name': 'Amherst Telephone/Tomorrow Valley'
  80. },
  81. 'tvc020': {
  82. 'name': 'Andycable'
  83. },
  84. 'arkwest': {
  85. 'name': 'Arkwest Communications'
  86. },
  87. 'art030': {
  88. 'name': 'Arthur Mutual Telephone Company'
  89. },
  90. 'arvig': {
  91. 'name': 'Arvig'
  92. },
  93. 'nttcash010': {
  94. 'name': 'Ashland Home Net'
  95. },
  96. 'astound': {
  97. 'name': 'Astound (now Wave)'
  98. },
  99. 'dix030': {
  100. 'name': 'ATC Broadband'
  101. },
  102. 'ara010': {
  103. 'name': 'ATC Communications'
  104. },
  105. 'she030-02': {
  106. 'name': 'Ayersville Communications'
  107. },
  108. 'baldwin': {
  109. 'name': 'Baldwin Lightstream'
  110. },
  111. 'bal040': {
  112. 'name': 'Ballard TV'
  113. },
  114. 'cit025': {
  115. 'name': 'Bardstown Cable TV'
  116. },
  117. 'bay030': {
  118. 'name': 'Bay Country Communications'
  119. },
  120. 'tel095': {
  121. 'name': 'Beaver Creek Cooperative Telephone'
  122. },
  123. 'bea020': {
  124. 'name': 'Beaver Valley Cable'
  125. },
  126. 'bee010': {
  127. 'name': 'Bee Line Cable'
  128. },
  129. 'wir030': {
  130. 'name': 'Beehive Broadband'
  131. },
  132. 'bra020': {
  133. 'name': 'BELD'
  134. },
  135. 'bel020': {
  136. 'name': 'Bellevue Municipal Cable'
  137. },
  138. 'vol040-01': {
  139. 'name': 'Ben Lomand Connect / BLTV'
  140. },
  141. 'bev010': {
  142. 'name': 'BEVCOMM'
  143. },
  144. 'big020': {
  145. 'name': 'Big Sandy Broadband'
  146. },
  147. 'ble020': {
  148. 'name': 'Bledsoe Telephone Cooperative'
  149. },
  150. 'bvt010': {
  151. 'name': 'Blue Valley Tele-Communications'
  152. },
  153. 'bra050': {
  154. 'name': 'Brandenburg Telephone Co.'
  155. },
  156. 'bte010': {
  157. 'name': 'Bristol Tennessee Essential Services'
  158. },
  159. 'annearundel': {
  160. 'name': 'Broadstripe'
  161. },
  162. 'btc010': {
  163. 'name': 'BTC Communications'
  164. },
  165. 'btc040': {
  166. 'name': 'BTC Vision - Nahunta'
  167. },
  168. 'bul010': {
  169. 'name': 'Bulloch Telephone Cooperative'
  170. },
  171. 'but010': {
  172. 'name': 'Butler-Bremer Communications'
  173. },
  174. 'tel160-csp': {
  175. 'name': 'C Spire SNAP'
  176. },
  177. 'csicable': {
  178. 'name': 'Cable Services Inc.'
  179. },
  180. 'cableamerica': {
  181. 'name': 'CableAmerica'
  182. },
  183. 'cab038': {
  184. 'name': 'CableSouth Media 3'
  185. },
  186. 'weh010-camtel': {
  187. 'name': 'Cam-Tel Company'
  188. },
  189. 'car030': {
  190. 'name': 'Cameron Communications'
  191. },
  192. 'canbytel': {
  193. 'name': 'Canby Telcom'
  194. },
  195. 'crt020': {
  196. 'name': 'CapRock Tv'
  197. },
  198. 'car050': {
  199. 'name': 'Carnegie Cable'
  200. },
  201. 'cas': {
  202. 'name': 'CAS Cable'
  203. },
  204. 'casscomm': {
  205. 'name': 'CASSCOMM'
  206. },
  207. 'mid180-02': {
  208. 'name': 'Catalina Broadband Solutions'
  209. },
  210. 'cccomm': {
  211. 'name': 'CC Communications'
  212. },
  213. 'nttccde010': {
  214. 'name': 'CDE Lightband'
  215. },
  216. 'cfunet': {
  217. 'name': 'Cedar Falls Utilities'
  218. },
  219. 'dem010-01': {
  220. 'name': 'Celect-Bloomer Telephone Area'
  221. },
  222. 'dem010-02': {
  223. 'name': 'Celect-Bruce Telephone Area'
  224. },
  225. 'dem010-03': {
  226. 'name': 'Celect-Citizens Connected Area'
  227. },
  228. 'dem010-04': {
  229. 'name': 'Celect-Elmwood/Spring Valley Area'
  230. },
  231. 'dem010-06': {
  232. 'name': 'Celect-Mosaic Telecom'
  233. },
  234. 'dem010-05': {
  235. 'name': 'Celect-West WI Telephone Area'
  236. },
  237. 'net010-02': {
  238. 'name': 'Cellcom/Nsight Telservices'
  239. },
  240. 'cen100': {
  241. 'name': 'CentraCom'
  242. },
  243. 'nttccst010': {
  244. 'name': 'Central Scott / CSTV'
  245. },
  246. 'cha035': {
  247. 'name': 'Chaparral CableVision'
  248. },
  249. 'cha050': {
  250. 'name': 'Chariton Valley Communication Corporation, Inc.'
  251. },
  252. 'cha060': {
  253. 'name': 'Chatmoss Cablevision'
  254. },
  255. 'nttcche010': {
  256. 'name': 'Cherokee Communications'
  257. },
  258. 'che050': {
  259. 'name': 'Chesapeake Bay Communications'
  260. },
  261. 'cimtel': {
  262. 'name': 'Cim-Tel Cable, LLC.'
  263. },
  264. 'cit180': {
  265. 'name': 'Citizens Cablevision - Floyd, VA'
  266. },
  267. 'cit210': {
  268. 'name': 'Citizens Cablevision, Inc.'
  269. },
  270. 'cit040': {
  271. 'name': 'Citizens Fiber'
  272. },
  273. 'cit250': {
  274. 'name': 'Citizens Mutual'
  275. },
  276. 'war040': {
  277. 'name': 'Citizens Telephone Corporation'
  278. },
  279. 'wat025': {
  280. 'name': 'City Of Monroe'
  281. },
  282. 'wadsworth': {
  283. 'name': 'CityLink'
  284. },
  285. 'nor100': {
  286. 'name': 'CL Tel'
  287. },
  288. 'cla010': {
  289. 'name': 'Clarence Telephone and Cedar Communications'
  290. },
  291. 'ser060': {
  292. 'name': 'Clear Choice Communications'
  293. },
  294. 'tac020': {
  295. 'name': 'Click! Cable TV'
  296. },
  297. 'war020': {
  298. 'name': 'CLICK1.NET'
  299. },
  300. 'cml010': {
  301. 'name': 'CML Telephone Cooperative Association'
  302. },
  303. 'cns': {
  304. 'name': 'CNS'
  305. },
  306. 'com160': {
  307. 'name': 'Co-Mo Connect'
  308. },
  309. 'coa020': {
  310. 'name': 'Coast Communications'
  311. },
  312. 'coa030': {
  313. 'name': 'Coaxial Cable TV'
  314. },
  315. 'mid055': {
  316. 'name': 'Cobalt TV (Mid-State Community TV)'
  317. },
  318. 'col070': {
  319. 'name': 'Columbia Power & Water Systems'
  320. },
  321. 'col080': {
  322. 'name': 'Columbus Telephone'
  323. },
  324. 'nor105': {
  325. 'name': 'Communications 1 Cablevision, Inc.'
  326. },
  327. 'com150': {
  328. 'name': 'Community Cable & Broadband'
  329. },
  330. 'com020': {
  331. 'name': 'Community Communications Company'
  332. },
  333. 'coy010': {
  334. 'name': 'commZoom'
  335. },
  336. 'com025': {
  337. 'name': 'Complete Communication Services'
  338. },
  339. 'cat020': {
  340. 'name': 'Comporium'
  341. },
  342. 'com071': {
  343. 'name': 'ComSouth Telesys'
  344. },
  345. 'consolidatedcable': {
  346. 'name': 'Consolidated'
  347. },
  348. 'conwaycorp': {
  349. 'name': 'Conway Corporation'
  350. },
  351. 'coo050': {
  352. 'name': 'Coon Valley Telecommunications Inc'
  353. },
  354. 'coo080': {
  355. 'name': 'Cooperative Telephone Company'
  356. },
  357. 'cpt010': {
  358. 'name': 'CP-TEL'
  359. },
  360. 'cra010': {
  361. 'name': 'Craw-Kan Telephone'
  362. },
  363. 'crestview': {
  364. 'name': 'Crestview Cable Communications'
  365. },
  366. 'cross': {
  367. 'name': 'Cross TV'
  368. },
  369. 'cro030': {
  370. 'name': 'Crosslake Communications'
  371. },
  372. 'ctc040': {
  373. 'name': 'CTC - Brainerd MN'
  374. },
  375. 'phe030': {
  376. 'name': 'CTV-Beam - East Alabama'
  377. },
  378. 'cun010': {
  379. 'name': 'Cunningham Telephone & Cable'
  380. },
  381. 'dpc010': {
  382. 'name': 'D & P Communications'
  383. },
  384. 'dak030': {
  385. 'name': 'Dakota Central Telecommunications'
  386. },
  387. 'nttcdel010': {
  388. 'name': 'Delcambre Telephone LLC'
  389. },
  390. 'tel160-del': {
  391. 'name': 'Delta Telephone Company'
  392. },
  393. 'sal040': {
  394. 'name': 'DiamondNet'
  395. },
  396. 'ind060-dc': {
  397. 'name': 'Direct Communications'
  398. },
  399. 'doy010': {
  400. 'name': 'Doylestown Cable TV'
  401. },
  402. 'dic010': {
  403. 'name': 'DRN'
  404. },
  405. 'dtc020': {
  406. 'name': 'DTC'
  407. },
  408. 'dtc010': {
  409. 'name': 'DTC Cable (Delhi)'
  410. },
  411. 'dum010': {
  412. 'name': 'Dumont Telephone Company'
  413. },
  414. 'dun010': {
  415. 'name': 'Dunkerton Telephone Cooperative'
  416. },
  417. 'cci010': {
  418. 'name': 'Duo County Telecom'
  419. },
  420. 'eagle': {
  421. 'name': 'Eagle Communications'
  422. },
  423. 'weh010-east': {
  424. 'name': 'East Arkansas Cable TV'
  425. },
  426. 'eatel': {
  427. 'name': 'EATEL Video, LLC'
  428. },
  429. 'ell010': {
  430. 'name': 'ECTA'
  431. },
  432. 'emerytelcom': {
  433. 'name': 'Emery Telcom Video LLC'
  434. },
  435. 'nor200': {
  436. 'name': 'Empire Access'
  437. },
  438. 'endeavor': {
  439. 'name': 'Endeavor Communications'
  440. },
  441. 'sun045': {
  442. 'name': 'Enhanced Telecommunications Corporation'
  443. },
  444. 'mid030': {
  445. 'name': 'enTouch'
  446. },
  447. 'epb020': {
  448. 'name': 'EPB Smartnet'
  449. },
  450. 'jea010': {
  451. 'name': 'EPlus Broadband'
  452. },
  453. 'com065': {
  454. 'name': 'ETC'
  455. },
  456. 'ete010': {
  457. 'name': 'Etex Communications'
  458. },
  459. 'fbc-tele': {
  460. 'name': 'F&B Communications'
  461. },
  462. 'fal010': {
  463. 'name': 'Falcon Broadband'
  464. },
  465. 'fam010': {
  466. 'name': 'FamilyView CableVision'
  467. },
  468. 'far020': {
  469. 'name': 'Farmers Mutual Telephone Company'
  470. },
  471. 'fay010': {
  472. 'name': 'Fayetteville Public Utilities'
  473. },
  474. 'sal060': {
  475. 'name': 'fibrant'
  476. },
  477. 'fid010': {
  478. 'name': 'Fidelity Communications'
  479. },
  480. 'for030': {
  481. 'name': 'FJ Communications'
  482. },
  483. 'fli020': {
  484. 'name': 'Flint River Communications'
  485. },
  486. 'far030': {
  487. 'name': 'FMT - Jesup'
  488. },
  489. 'foo010': {
  490. 'name': 'Foothills Communications'
  491. },
  492. 'for080': {
  493. 'name': 'Forsyth CableNet'
  494. },
  495. 'fbcomm': {
  496. 'name': 'Frankfort Plant Board'
  497. },
  498. 'tel160-fra': {
  499. 'name': 'Franklin Telephone Company'
  500. },
  501. 'nttcftc010': {
  502. 'name': 'FTC'
  503. },
  504. 'fullchannel': {
  505. 'name': 'Full Channel, Inc.'
  506. },
  507. 'gar040': {
  508. 'name': 'Gardonville Cooperative Telephone Association'
  509. },
  510. 'gbt010': {
  511. 'name': 'GBT Communications, Inc.'
  512. },
  513. 'tec010': {
  514. 'name': 'Genuine Telecom'
  515. },
  516. 'clr010': {
  517. 'name': 'Giant Communications'
  518. },
  519. 'gla010': {
  520. 'name': 'Glasgow EPB'
  521. },
  522. 'gle010': {
  523. 'name': 'Glenwood Telecommunications'
  524. },
  525. 'gra060': {
  526. 'name': 'GLW Broadband Inc.'
  527. },
  528. 'goldenwest': {
  529. 'name': 'Golden West Cablevision'
  530. },
  531. 'vis030': {
  532. 'name': 'Grantsburg Telcom'
  533. },
  534. 'gpcom': {
  535. 'name': 'Great Plains Communications'
  536. },
  537. 'gri010': {
  538. 'name': 'Gridley Cable Inc'
  539. },
  540. 'hbc010': {
  541. 'name': 'H&B Cable Services'
  542. },
  543. 'hae010': {
  544. 'name': 'Haefele TV Inc.'
  545. },
  546. 'htc010': {
  547. 'name': 'Halstad Telephone Company'
  548. },
  549. 'har005': {
  550. 'name': 'Harlan Municipal Utilities'
  551. },
  552. 'har020': {
  553. 'name': 'Hart Communications'
  554. },
  555. 'ced010': {
  556. 'name': 'Hartelco TV'
  557. },
  558. 'hea040': {
  559. 'name': 'Heart of Iowa Communications Cooperative'
  560. },
  561. 'htc020': {
  562. 'name': 'Hickory Telephone Company'
  563. },
  564. 'nttchig010': {
  565. 'name': 'Highland Communication Services'
  566. },
  567. 'hig030': {
  568. 'name': 'Highland Media'
  569. },
  570. 'spc010': {
  571. 'name': 'Hilliary Communications'
  572. },
  573. 'hin020': {
  574. 'name': 'Hinton CATV Co.'
  575. },
  576. 'hometel': {
  577. 'name': 'HomeTel Entertainment, Inc.'
  578. },
  579. 'hoodcanal': {
  580. 'name': 'Hood Canal Communications'
  581. },
  582. 'weh010-hope': {
  583. 'name': 'Hope - Prescott Cable TV'
  584. },
  585. 'horizoncable': {
  586. 'name': 'Horizon Cable TV, Inc.'
  587. },
  588. 'hor040': {
  589. 'name': 'Horizon Chillicothe Telephone'
  590. },
  591. 'htc030': {
  592. 'name': 'HTC Communications Co. - IL'
  593. },
  594. 'htccomm': {
  595. 'name': 'HTC Communications, Inc. - IA'
  596. },
  597. 'wal005': {
  598. 'name': 'Huxley Communications'
  599. },
  600. 'imon': {
  601. 'name': 'ImOn Communications'
  602. },
  603. 'ind040': {
  604. 'name': 'Independence Telecommunications'
  605. },
  606. 'rrc010': {
  607. 'name': 'Inland Networks'
  608. },
  609. 'stc020': {
  610. 'name': 'Innovative Cable TV St Croix'
  611. },
  612. 'car100': {
  613. 'name': 'Innovative Cable TV St Thomas-St John'
  614. },
  615. 'icc010': {
  616. 'name': 'Inside Connect Cable'
  617. },
  618. 'int100': {
  619. 'name': 'Integra Telecom'
  620. },
  621. 'int050': {
  622. 'name': 'Interstate Telecommunications Coop'
  623. },
  624. 'irv010': {
  625. 'name': 'Irvine Cable'
  626. },
  627. 'k2c010': {
  628. 'name': 'K2 Communications'
  629. },
  630. 'kal010': {
  631. 'name': 'Kalida Telephone Company, Inc.'
  632. },
  633. 'kal030': {
  634. 'name': 'Kalona Cooperative Telephone Company'
  635. },
  636. 'kmt010': {
  637. 'name': 'KMTelecom'
  638. },
  639. 'kpu010': {
  640. 'name': 'KPU Telecommunications'
  641. },
  642. 'kuh010': {
  643. 'name': 'Kuhn Communications, Inc.'
  644. },
  645. 'lak130': {
  646. 'name': 'Lakeland Communications'
  647. },
  648. 'lan010': {
  649. 'name': 'Langco'
  650. },
  651. 'lau020': {
  652. 'name': 'Laurel Highland Total Communications, Inc.'
  653. },
  654. 'leh010': {
  655. 'name': 'Lehigh Valley Cooperative Telephone'
  656. },
  657. 'bra010': {
  658. 'name': 'Limestone Cable/Bracken Cable'
  659. },
  660. 'loc020': {
  661. 'name': 'LISCO'
  662. },
  663. 'lit020': {
  664. 'name': 'Litestream'
  665. },
  666. 'tel140': {
  667. 'name': 'LivCom'
  668. },
  669. 'loc010': {
  670. 'name': 'LocalTel Communications'
  671. },
  672. 'weh010-longview': {
  673. 'name': 'Longview - Kilgore Cable TV'
  674. },
  675. 'lon030': {
  676. 'name': 'Lonsdale Video Ventures, LLC'
  677. },
  678. 'lns010': {
  679. 'name': 'Lost Nation-Elwood Telephone Co.'
  680. },
  681. 'nttclpc010': {
  682. 'name': 'LPC Connect'
  683. },
  684. 'lumos': {
  685. 'name': 'Lumos Networks'
  686. },
  687. 'madison': {
  688. 'name': 'Madison Communications'
  689. },
  690. 'mad030': {
  691. 'name': 'Madison County Cable Inc.'
  692. },
  693. 'nttcmah010': {
  694. 'name': 'Mahaska Communication Group'
  695. },
  696. 'mar010': {
  697. 'name': 'Marne & Elk Horn Telephone Company'
  698. },
  699. 'mcc040': {
  700. 'name': 'McClure Telephone Co.'
  701. },
  702. 'mctv': {
  703. 'name': 'MCTV'
  704. },
  705. 'merrimac': {
  706. 'name': 'Merrimac Communications Ltd.'
  707. },
  708. 'metronet': {
  709. 'name': 'Metronet'
  710. },
  711. 'mhtc': {
  712. 'name': 'MHTC'
  713. },
  714. 'midhudson': {
  715. 'name': 'Mid-Hudson Cable'
  716. },
  717. 'midrivers': {
  718. 'name': 'Mid-Rivers Communications'
  719. },
  720. 'mid045': {
  721. 'name': 'Midstate Communications'
  722. },
  723. 'mil080': {
  724. 'name': 'Milford Communications'
  725. },
  726. 'min030': {
  727. 'name': 'MINET'
  728. },
  729. 'nttcmin010': {
  730. 'name': 'Minford TV'
  731. },
  732. 'san040-02': {
  733. 'name': 'Mitchell Telecom'
  734. },
  735. 'mlg010': {
  736. 'name': 'MLGC'
  737. },
  738. 'mon060': {
  739. 'name': 'Mon-Cre TVE'
  740. },
  741. 'mou110': {
  742. 'name': 'Mountain Telephone'
  743. },
  744. 'mou050': {
  745. 'name': 'Mountain Village Cable'
  746. },
  747. 'mtacomm': {
  748. 'name': 'MTA Communications, LLC'
  749. },
  750. 'mtc010': {
  751. 'name': 'MTC Cable'
  752. },
  753. 'med040': {
  754. 'name': 'MTC Technologies'
  755. },
  756. 'man060': {
  757. 'name': 'MTCC'
  758. },
  759. 'mtc030': {
  760. 'name': 'MTCO Communications'
  761. },
  762. 'mul050': {
  763. 'name': 'Mulberry Telecommunications'
  764. },
  765. 'mur010': {
  766. 'name': 'Murray Electric System'
  767. },
  768. 'musfiber': {
  769. 'name': 'MUS FiberNET'
  770. },
  771. 'mpw': {
  772. 'name': 'Muscatine Power & Water'
  773. },
  774. 'nttcsli010': {
  775. 'name': 'myEVTV.com'
  776. },
  777. 'nor115': {
  778. 'name': 'NCC'
  779. },
  780. 'nor260': {
  781. 'name': 'NDTC'
  782. },
  783. 'nctc': {
  784. 'name': 'Nebraska Central Telecom, Inc.'
  785. },
  786. 'nel020': {
  787. 'name': 'Nelsonville TV Cable'
  788. },
  789. 'nem010': {
  790. 'name': 'Nemont'
  791. },
  792. 'new075': {
  793. 'name': 'New Hope Telephone Cooperative'
  794. },
  795. 'nor240': {
  796. 'name': 'NICP'
  797. },
  798. 'cic010': {
  799. 'name': 'NineStar Connect'
  800. },
  801. 'nktelco': {
  802. 'name': 'NKTelco'
  803. },
  804. 'nortex': {
  805. 'name': 'Nortex Communications'
  806. },
  807. 'nor140': {
  808. 'name': 'North Central Telephone Cooperative'
  809. },
  810. 'nor030': {
  811. 'name': 'Northland Communications'
  812. },
  813. 'nor075': {
  814. 'name': 'Northwest Communications'
  815. },
  816. 'nor125': {
  817. 'name': 'Norwood Light Broadband'
  818. },
  819. 'net010': {
  820. 'name': 'Nsight Telservices'
  821. },
  822. 'dur010': {
  823. 'name': 'Ntec'
  824. },
  825. 'nts010': {
  826. 'name': 'NTS Communications'
  827. },
  828. 'new045': {
  829. 'name': 'NU-Telecom'
  830. },
  831. 'nulink': {
  832. 'name': 'NuLink'
  833. },
  834. 'jam030': {
  835. 'name': 'NVC'
  836. },
  837. 'far035': {
  838. 'name': 'OmniTel Communications'
  839. },
  840. 'onesource': {
  841. 'name': 'OneSource Communications'
  842. },
  843. 'cit230': {
  844. 'name': 'Opelika Power Services'
  845. },
  846. 'daltonutilities': {
  847. 'name': 'OptiLink'
  848. },
  849. 'mid140': {
  850. 'name': 'OPTURA'
  851. },
  852. 'ote010': {
  853. 'name': 'OTEC Communication Company'
  854. },
  855. 'cci020': {
  856. 'name': 'Packerland Broadband'
  857. },
  858. 'pan010': {
  859. 'name': 'Panora Telco/Guthrie Center Communications'
  860. },
  861. 'otter': {
  862. 'name': 'Park Region Telephone & Otter Tail Telcom'
  863. },
  864. 'mid050': {
  865. 'name': 'Partner Communications Cooperative'
  866. },
  867. 'fib010': {
  868. 'name': 'Pathway'
  869. },
  870. 'paulbunyan': {
  871. 'name': 'Paul Bunyan Communications'
  872. },
  873. 'pem020': {
  874. 'name': 'Pembroke Telephone Company'
  875. },
  876. 'mck010': {
  877. 'name': 'Peoples Rural Telephone Cooperative'
  878. },
  879. 'pul010': {
  880. 'name': 'PES Energize'
  881. },
  882. 'phi010': {
  883. 'name': 'Philippi Communications System'
  884. },
  885. 'phonoscope': {
  886. 'name': 'Phonoscope Cable'
  887. },
  888. 'pin070': {
  889. 'name': 'Pine Belt Communications, Inc.'
  890. },
  891. 'weh010-pine': {
  892. 'name': 'Pine Bluff Cable TV'
  893. },
  894. 'pin060': {
  895. 'name': 'Pineland Telephone Cooperative'
  896. },
  897. 'cam010': {
  898. 'name': 'Pinpoint Communications'
  899. },
  900. 'pio060': {
  901. 'name': 'Pioneer Broadband'
  902. },
  903. 'pioncomm': {
  904. 'name': 'Pioneer Communications'
  905. },
  906. 'pioneer': {
  907. 'name': 'Pioneer DTV'
  908. },
  909. 'pla020': {
  910. 'name': 'Plant TiftNet, Inc.'
  911. },
  912. 'par010': {
  913. 'name': 'PLWC'
  914. },
  915. 'pro035': {
  916. 'name': 'PMT'
  917. },
  918. 'vik011': {
  919. 'name': 'Polar Cablevision'
  920. },
  921. 'pottawatomie': {
  922. 'name': 'Pottawatomie Telephone Co.'
  923. },
  924. 'premiercomm': {
  925. 'name': 'Premier Communications'
  926. },
  927. 'psc010': {
  928. 'name': 'PSC'
  929. },
  930. 'pan020': {
  931. 'name': 'PTCI'
  932. },
  933. 'qco010': {
  934. 'name': 'QCOL'
  935. },
  936. 'qua010': {
  937. 'name': 'Quality Cablevision'
  938. },
  939. 'rad010': {
  940. 'name': 'Radcliffe Telephone Company'
  941. },
  942. 'car040': {
  943. 'name': 'Rainbow Communications'
  944. },
  945. 'rai030': {
  946. 'name': 'Rainier Connect'
  947. },
  948. 'ral010': {
  949. 'name': 'Ralls Technologies'
  950. },
  951. 'rct010': {
  952. 'name': 'RC Technologies'
  953. },
  954. 'red040': {
  955. 'name': 'Red River Communications'
  956. },
  957. 'ree010': {
  958. 'name': 'Reedsburg Utility Commission'
  959. },
  960. 'mol010': {
  961. 'name': 'Reliance Connects- Oregon'
  962. },
  963. 'res020': {
  964. 'name': 'Reserve Telecommunications'
  965. },
  966. 'weh010-resort': {
  967. 'name': 'Resort TV Cable'
  968. },
  969. 'rld010': {
  970. 'name': 'Richland Grant Telephone Cooperative, Inc.'
  971. },
  972. 'riv030': {
  973. 'name': 'River Valley Telecommunications Coop'
  974. },
  975. 'rockportcable': {
  976. 'name': 'Rock Port Cablevision'
  977. },
  978. 'rsf010': {
  979. 'name': 'RS Fiber'
  980. },
  981. 'rtc': {
  982. 'name': 'RTC Communication Corp'
  983. },
  984. 'res040': {
  985. 'name': 'RTC-Reservation Telephone Coop.'
  986. },
  987. 'rte010': {
  988. 'name': 'RTEC Communications'
  989. },
  990. 'stc010': {
  991. 'name': 'S&T'
  992. },
  993. 'san020': {
  994. 'name': 'San Bruno Cable TV'
  995. },
  996. 'san040-01': {
  997. 'name': 'Santel'
  998. },
  999. 'sav010': {
  1000. 'name': 'SCI Broadband-Savage Communications Inc.'
  1001. },
  1002. 'sco050': {
  1003. 'name': 'Scottsboro Electric Power Board'
  1004. },
  1005. 'scr010': {
  1006. 'name': 'Scranton Telephone Company'
  1007. },
  1008. 'selco': {
  1009. 'name': 'SELCO'
  1010. },
  1011. 'she010': {
  1012. 'name': 'Shentel'
  1013. },
  1014. 'she030': {
  1015. 'name': 'Sherwood Mutual Telephone Association, Inc.'
  1016. },
  1017. 'ind060-ssc': {
  1018. 'name': 'Silver Star Communications'
  1019. },
  1020. 'sjoberg': {
  1021. 'name': 'Sjoberg\'s Inc.'
  1022. },
  1023. 'sou025': {
  1024. 'name': 'SKT'
  1025. },
  1026. 'sky050': {
  1027. 'name': 'SkyBest TV'
  1028. },
  1029. 'nttcsmi010': {
  1030. 'name': 'Smithville Communications'
  1031. },
  1032. 'woo010': {
  1033. 'name': 'Solarus'
  1034. },
  1035. 'sou075': {
  1036. 'name': 'South Central Rural Telephone Cooperative'
  1037. },
  1038. 'sou065': {
  1039. 'name': 'South Holt Cablevision, Inc.'
  1040. },
  1041. 'sou035': {
  1042. 'name': 'South Slope Cooperative Communications'
  1043. },
  1044. 'spa020': {
  1045. 'name': 'Spanish Fork Community Network'
  1046. },
  1047. 'spe010': {
  1048. 'name': 'Spencer Municipal Utilities'
  1049. },
  1050. 'spi005': {
  1051. 'name': 'Spillway Communications, Inc.'
  1052. },
  1053. 'srt010': {
  1054. 'name': 'SRT'
  1055. },
  1056. 'cccsmc010': {
  1057. 'name': 'St. Maarten Cable TV'
  1058. },
  1059. 'sta025': {
  1060. 'name': 'Star Communications'
  1061. },
  1062. 'sco020': {
  1063. 'name': 'STE'
  1064. },
  1065. 'uin010': {
  1066. 'name': 'STRATA Networks'
  1067. },
  1068. 'sum010': {
  1069. 'name': 'Sumner Cable TV'
  1070. },
  1071. 'pie010': {
  1072. 'name': 'Surry TV/PCSI TV'
  1073. },
  1074. 'swa010': {
  1075. 'name': 'Swayzee Communications'
  1076. },
  1077. 'sweetwater': {
  1078. 'name': 'Sweetwater Cable Television Co'
  1079. },
  1080. 'weh010-talequah': {
  1081. 'name': 'Tahlequah Cable TV'
  1082. },
  1083. 'tct': {
  1084. 'name': 'TCT'
  1085. },
  1086. 'tel050': {
  1087. 'name': 'Tele-Media Company'
  1088. },
  1089. 'com050': {
  1090. 'name': 'The Community Agency'
  1091. },
  1092. 'thr020': {
  1093. 'name': 'Three River'
  1094. },
  1095. 'cab140': {
  1096. 'name': 'Town & Country Technologies'
  1097. },
  1098. 'tra010': {
  1099. 'name': 'Trans-Video'
  1100. },
  1101. 'tre010': {
  1102. 'name': 'Trenton TV Cable Company'
  1103. },
  1104. 'tcc': {
  1105. 'name': 'Tri County Communications Cooperative'
  1106. },
  1107. 'tri025': {
  1108. 'name': 'TriCounty Telecom'
  1109. },
  1110. 'tri110': {
  1111. 'name': 'TrioTel Communications, Inc.'
  1112. },
  1113. 'tro010': {
  1114. 'name': 'Troy Cablevision, Inc.'
  1115. },
  1116. 'tsc': {
  1117. 'name': 'TSC'
  1118. },
  1119. 'cit220': {
  1120. 'name': 'Tullahoma Utilities Board'
  1121. },
  1122. 'tvc030': {
  1123. 'name': 'TV Cable of Rensselaer'
  1124. },
  1125. 'tvc015': {
  1126. 'name': 'TVC Cable'
  1127. },
  1128. 'cab180': {
  1129. 'name': 'TVision'
  1130. },
  1131. 'twi040': {
  1132. 'name': 'Twin Lakes'
  1133. },
  1134. 'tvtinc': {
  1135. 'name': 'Twin Valley'
  1136. },
  1137. 'uis010': {
  1138. 'name': 'Union Telephone Company'
  1139. },
  1140. 'uni110': {
  1141. 'name': 'United Communications - TN'
  1142. },
  1143. 'uni120': {
  1144. 'name': 'United Services'
  1145. },
  1146. 'uss020': {
  1147. 'name': 'US Sonet'
  1148. },
  1149. 'cab060': {
  1150. 'name': 'USA Communications'
  1151. },
  1152. 'she005': {
  1153. 'name': 'USA Communications/Shellsburg, IA'
  1154. },
  1155. 'val040': {
  1156. 'name': 'Valley TeleCom Group'
  1157. },
  1158. 'val025': {
  1159. 'name': 'Valley Telecommunications'
  1160. },
  1161. 'val030': {
  1162. 'name': 'Valparaiso Broadband'
  1163. },
  1164. 'cla050': {
  1165. 'name': 'Vast Broadband'
  1166. },
  1167. 'sul015': {
  1168. 'name': 'Venture Communications Cooperative, Inc.'
  1169. },
  1170. 'ver025': {
  1171. 'name': 'Vernon Communications Co-op'
  1172. },
  1173. 'weh010-vicksburg': {
  1174. 'name': 'Vicksburg Video'
  1175. },
  1176. 'vis070': {
  1177. 'name': 'Vision Communications'
  1178. },
  1179. 'volcanotel': {
  1180. 'name': 'Volcano Vision, Inc.'
  1181. },
  1182. 'vol040-02': {
  1183. 'name': 'VolFirst / BLTV'
  1184. },
  1185. 'ver070': {
  1186. 'name': 'VTel'
  1187. },
  1188. 'nttcvtx010': {
  1189. 'name': 'VTX1'
  1190. },
  1191. 'bci010-02': {
  1192. 'name': 'Vyve Broadband'
  1193. },
  1194. 'wab020': {
  1195. 'name': 'Wabash Mutual Telephone'
  1196. },
  1197. 'waitsfield': {
  1198. 'name': 'Waitsfield Cable'
  1199. },
  1200. 'wal010': {
  1201. 'name': 'Walnut Communications'
  1202. },
  1203. 'wavebroadband': {
  1204. 'name': 'Wave'
  1205. },
  1206. 'wav030': {
  1207. 'name': 'Waverly Communications Utility'
  1208. },
  1209. 'wbi010': {
  1210. 'name': 'WBI'
  1211. },
  1212. 'web020': {
  1213. 'name': 'Webster-Calhoun Cooperative Telephone Association'
  1214. },
  1215. 'wes005': {
  1216. 'name': 'West Alabama TV Cable'
  1217. },
  1218. 'carolinata': {
  1219. 'name': 'West Carolina Communications'
  1220. },
  1221. 'wct010': {
  1222. 'name': 'West Central Telephone Association'
  1223. },
  1224. 'wes110': {
  1225. 'name': 'West River Cooperative Telephone Company'
  1226. },
  1227. 'ani030': {
  1228. 'name': 'WesTel Systems'
  1229. },
  1230. 'westianet': {
  1231. 'name': 'Western Iowa Networks'
  1232. },
  1233. 'nttcwhi010': {
  1234. 'name': 'Whidbey Telecom'
  1235. },
  1236. 'weh010-white': {
  1237. 'name': 'White County Cable TV'
  1238. },
  1239. 'wes130': {
  1240. 'name': 'Wiatel'
  1241. },
  1242. 'wik010': {
  1243. 'name': 'Wiktel'
  1244. },
  1245. 'wil070': {
  1246. 'name': 'Wilkes Communications, Inc./RiverStreet Networks'
  1247. },
  1248. 'wil015': {
  1249. 'name': 'Wilson Communications'
  1250. },
  1251. 'win010': {
  1252. 'name': 'Windomnet/SMBS'
  1253. },
  1254. 'win090': {
  1255. 'name': 'Windstream Cable TV'
  1256. },
  1257. 'wcta': {
  1258. 'name': 'Winnebago Cooperative Telecom Association'
  1259. },
  1260. 'wtc010': {
  1261. 'name': 'WTC'
  1262. },
  1263. 'wil040': {
  1264. 'name': 'WTC Communications, Inc.'
  1265. },
  1266. 'wya010': {
  1267. 'name': 'Wyandotte Cable'
  1268. },
  1269. 'hin020-02': {
  1270. 'name': 'X-Stream Services'
  1271. },
  1272. 'xit010': {
  1273. 'name': 'XIT Communications'
  1274. },
  1275. 'yel010': {
  1276. 'name': 'Yelcot Communications'
  1277. },
  1278. 'mid180-01': {
  1279. 'name': 'yondoo'
  1280. },
  1281. 'cou060': {
  1282. 'name': 'Zito Media'
  1283. },
  1284. }
  1285. class AdobePassIE(InfoExtractor):
  1286. _SERVICE_PROVIDER_TEMPLATE = 'https://sp.auth.adobe.com/adobe-services/%s'
  1287. _USER_AGENT = 'Mozilla/5.0 (X11; Linux i686; rv:47.0) Gecko/20100101 Firefox/47.0'
  1288. _MVPD_CACHE = 'ap-mvpd'
  1289. @staticmethod
  1290. def _get_mvpd_resource(provider_id, title, guid, rating):
  1291. channel = etree.Element('channel')
  1292. channel_title = etree.SubElement(channel, 'title')
  1293. channel_title.text = provider_id
  1294. item = etree.SubElement(channel, 'item')
  1295. resource_title = etree.SubElement(item, 'title')
  1296. resource_title.text = title
  1297. resource_guid = etree.SubElement(item, 'guid')
  1298. resource_guid.text = guid
  1299. resource_rating = etree.SubElement(item, 'media:rating')
  1300. resource_rating.attrib = {'scheme': 'urn:v-chip'}
  1301. resource_rating.text = rating
  1302. return '<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">' + etree.tostring(channel).decode() + '</rss>'
  1303. def _extract_mvpd_auth(self, url, video_id, requestor_id, resource):
  1304. def xml_text(xml_str, tag):
  1305. return self._search_regex(
  1306. '<%s>(.+?)</%s>' % (tag, tag), xml_str, tag)
  1307. def is_expired(token, date_ele):
  1308. token_expires = unified_timestamp(re.sub(r'[_ ]GMT', '', xml_text(token, date_ele)))
  1309. return token_expires and token_expires <= int(time.time())
  1310. def post_form(form_page_res, note, data={}):
  1311. form_page, urlh = form_page_res
  1312. post_url = self._html_search_regex(r'<form[^>]+action=(["\'])(?P<url>.+?)\1', form_page, 'post url', group='url')
  1313. if not re.match(r'https?://', post_url):
  1314. post_url = compat_urlparse.urljoin(urlh.geturl(), post_url)
  1315. form_data = self._hidden_inputs(form_page)
  1316. form_data.update(data)
  1317. return self._download_webpage_handle(
  1318. post_url, video_id, note, data=urlencode_postdata(form_data), headers={
  1319. 'Content-Type': 'application/x-www-form-urlencoded',
  1320. })
  1321. def raise_mvpd_required():
  1322. raise ExtractorError(
  1323. 'This video is only available for users of participating TV providers. '
  1324. 'Use --ap-mso to specify Adobe Pass Multiple-system operator Identifier '
  1325. 'and --ap-username and --ap-password or --netrc to provide account credentials.', expected=True)
  1326. mvpd_headers = {
  1327. 'ap_42': 'anonymous',
  1328. 'ap_11': 'Linux i686',
  1329. 'ap_z': self._USER_AGENT,
  1330. 'User-Agent': self._USER_AGENT,
  1331. }
  1332. guid = xml_text(resource, 'guid') if '<' in resource else resource
  1333. count = 0
  1334. while count < 2:
  1335. requestor_info = self._downloader.cache.load(self._MVPD_CACHE, requestor_id) or {}
  1336. authn_token = requestor_info.get('authn_token')
  1337. if authn_token and is_expired(authn_token, 'simpleTokenExpires'):
  1338. authn_token = None
  1339. if not authn_token:
  1340. # TODO add support for other TV Providers
  1341. mso_id = self._downloader.params.get('ap_mso')
  1342. if not mso_id:
  1343. raise_mvpd_required()
  1344. username, password = self._get_login_info('ap_username', 'ap_password', mso_id)
  1345. if not username or not password:
  1346. raise_mvpd_required()
  1347. mso_info = MSO_INFO[mso_id]
  1348. provider_redirect_page_res = self._download_webpage_handle(
  1349. self._SERVICE_PROVIDER_TEMPLATE % 'authenticate/saml', video_id,
  1350. 'Downloading Provider Redirect Page', query={
  1351. 'noflash': 'true',
  1352. 'mso_id': mso_id,
  1353. 'requestor_id': requestor_id,
  1354. 'no_iframe': 'false',
  1355. 'domain_name': 'adobe.com',
  1356. 'redirect_url': url,
  1357. })
  1358. if mso_id == 'Comcast_SSO':
  1359. # Comcast page flow varies by video site and whether you
  1360. # are on Comcast's network.
  1361. provider_redirect_page, urlh = provider_redirect_page_res
  1362. # Check for Comcast auto login
  1363. if 'automatically signing you in' in provider_redirect_page:
  1364. oauth_redirect_url = self._html_search_regex(
  1365. r'window\.location\s*=\s*[\'"]([^\'"]+)',
  1366. provider_redirect_page, 'oauth redirect')
  1367. # Just need to process the request. No useful data comes back
  1368. self._download_webpage(
  1369. oauth_redirect_url, video_id, 'Confirming auto login')
  1370. else:
  1371. if '<form name="signin"' in provider_redirect_page:
  1372. # already have the form, just fill it
  1373. provider_login_page_res = provider_redirect_page_res
  1374. elif 'http-equiv="refresh"' in provider_redirect_page:
  1375. # redirects to the login page
  1376. oauth_redirect_url = self._html_search_regex(
  1377. r'content="0;\s*url=([^\'"]+)',
  1378. provider_redirect_page, 'meta refresh redirect')
  1379. provider_login_page_res = self._download_webpage_handle(
  1380. oauth_redirect_url,
  1381. video_id, 'Downloading Provider Login Page')
  1382. else:
  1383. provider_login_page_res = post_form(
  1384. provider_redirect_page_res, 'Downloading Provider Login Page')
  1385. mvpd_confirm_page_res = post_form(provider_login_page_res, 'Logging in', {
  1386. mso_info.get('username_field', 'username'): username,
  1387. mso_info.get('password_field', 'password'): password,
  1388. })
  1389. mvpd_confirm_page, urlh = mvpd_confirm_page_res
  1390. if '<button class="submit" value="Resume">Resume</button>' in mvpd_confirm_page:
  1391. post_form(mvpd_confirm_page_res, 'Confirming Login')
  1392. else:
  1393. # Normal, non-Comcast flow
  1394. provider_login_page_res = post_form(
  1395. provider_redirect_page_res, 'Downloading Provider Login Page')
  1396. mvpd_confirm_page_res = post_form(provider_login_page_res, 'Logging in', {
  1397. mso_info.get('username_field', 'username'): username,
  1398. mso_info.get('password_field', 'password'): password,
  1399. })
  1400. if mso_id != 'Rogers':
  1401. post_form(mvpd_confirm_page_res, 'Confirming Login')
  1402. session = self._download_webpage(
  1403. self._SERVICE_PROVIDER_TEMPLATE % 'session', video_id,
  1404. 'Retrieving Session', data=urlencode_postdata({
  1405. '_method': 'GET',
  1406. 'requestor_id': requestor_id,
  1407. }), headers=mvpd_headers)
  1408. if '<pendingLogout' in session:
  1409. self._downloader.cache.store(self._MVPD_CACHE, requestor_id, {})
  1410. count += 1
  1411. continue
  1412. authn_token = unescapeHTML(xml_text(session, 'authnToken'))
  1413. requestor_info['authn_token'] = authn_token
  1414. self._downloader.cache.store(self._MVPD_CACHE, requestor_id, requestor_info)
  1415. authz_token = requestor_info.get(guid)
  1416. if authz_token and is_expired(authz_token, 'simpleTokenTTL'):
  1417. authz_token = None
  1418. if not authz_token:
  1419. authorize = self._download_webpage(
  1420. self._SERVICE_PROVIDER_TEMPLATE % 'authorize', video_id,
  1421. 'Retrieving Authorization Token', data=urlencode_postdata({
  1422. 'resource_id': resource,
  1423. 'requestor_id': requestor_id,
  1424. 'authentication_token': authn_token,
  1425. 'mso_id': xml_text(authn_token, 'simpleTokenMsoID'),
  1426. 'userMeta': '1',
  1427. }), headers=mvpd_headers)
  1428. if '<pendingLogout' in authorize:
  1429. self._downloader.cache.store(self._MVPD_CACHE, requestor_id, {})
  1430. count += 1
  1431. continue
  1432. authz_token = unescapeHTML(xml_text(authorize, 'authzToken'))
  1433. requestor_info[guid] = authz_token
  1434. self._downloader.cache.store(self._MVPD_CACHE, requestor_id, requestor_info)
  1435. mvpd_headers.update({
  1436. 'ap_19': xml_text(authn_token, 'simpleSamlNameID'),
  1437. 'ap_23': xml_text(authn_token, 'simpleSamlSessionIndex'),
  1438. })
  1439. short_authorize = self._download_webpage(
  1440. self._SERVICE_PROVIDER_TEMPLATE % 'shortAuthorize',
  1441. video_id, 'Retrieving Media Token', data=urlencode_postdata({
  1442. 'authz_token': authz_token,
  1443. 'requestor_id': requestor_id,
  1444. 'session_guid': xml_text(authn_token, 'simpleTokenAuthenticationGuid'),
  1445. 'hashed_guid': 'false',
  1446. }), headers=mvpd_headers)
  1447. if '<pendingLogout' in short_authorize:
  1448. self._downloader.cache.store(self._MVPD_CACHE, requestor_id, {})
  1449. count += 1
  1450. continue
  1451. return short_authorize