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