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.

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