[ie/twitter:spaces] Support video spaces (#10789)
[yt-dlp3.git] / yt_dlp / extractor / adobepass.py
blobeb7e597e52d7586df3a24f41a5b20a7635b6034b
1 import getpass
2 import json
3 import re
4 import time
5 import urllib.parse
6 import xml.etree.ElementTree as etree
8 from .common import InfoExtractor
9 from ..networking.exceptions import HTTPError
10 from ..utils import (
11 NO_DEFAULT,
12 ExtractorError,
13 unescapeHTML,
14 unified_timestamp,
15 urlencode_postdata,
18 MSO_INFO = {
19 'DTV': {
20 'name': 'DIRECTV',
21 'username_field': 'username',
22 'password_field': 'password',
24 'ATT': {
25 'name': 'AT&T U-verse',
26 'username_field': 'userid',
27 'password_field': 'password',
29 'ATTOTT': {
30 'name': 'DIRECTV NOW',
31 'username_field': 'email',
32 'password_field': 'loginpassword',
34 'RCN': {
35 'name': 'RCN',
36 'username_field': 'username',
37 'password_field': 'password',
39 'Rogers': {
40 'name': 'Rogers',
41 'username_field': 'UserName',
42 'password_field': 'UserPassword',
44 'Comcast_SSO': {
45 'name': 'Comcast XFINITY',
46 'username_field': 'user',
47 'password_field': 'passwd',
49 'TWC': {
50 'name': 'Time Warner Cable | Spectrum',
51 'username_field': 'Ecom_User_ID',
52 'password_field': 'Ecom_Password',
54 'Brighthouse': {
55 'name': 'Bright House Networks | Spectrum',
56 'username_field': 'j_username',
57 'password_field': 'j_password',
59 'Charter_Direct': {
60 'name': 'Charter Spectrum',
61 'username_field': 'IDToken1',
62 'password_field': 'IDToken2',
64 'Spectrum': {
65 'name': 'Spectrum',
66 'username_field': 'IDToken1',
67 'password_field': 'IDToken2',
69 'Philo': {
70 'name': 'Philo',
71 'username_field': 'ident',
73 'Verizon': {
74 'name': 'Verizon FiOS',
75 'username_field': 'IDToken1',
76 'password_field': 'IDToken2',
78 'Cablevision': {
79 'name': 'Optimum/Cablevision',
80 'username_field': 'j_username',
81 'password_field': 'j_password',
83 'thr030': {
84 'name': '3 Rivers Communications',
86 'com140': {
87 'name': 'Access Montana',
89 'acecommunications': {
90 'name': 'AcenTek',
92 'acm010': {
93 'name': 'Acme Communications',
95 'ada020': {
96 'name': 'Adams Cable Service',
98 'alb020': {
99 'name': 'Albany Mutual Telephone',
101 'algona': {
102 'name': 'Algona Municipal Utilities',
104 'allwest': {
105 'name': 'All West Communications',
107 'all025': {
108 'name': 'Allen\'s Communications',
110 'spl010': {
111 'name': 'Alliance Communications',
113 'all070': {
114 'name': 'ALLO Communications',
116 'alpine': {
117 'name': 'Alpine Communications',
119 'hun015': {
120 'name': 'American Broadband',
122 'nwc010': {
123 'name': 'American Broadband Missouri',
125 'com130-02': {
126 'name': 'American Community Networks',
128 'com130-01': {
129 'name': 'American Warrior Networks',
131 'tom020': {
132 'name': 'Amherst Telephone/Tomorrow Valley',
134 'tvc020': {
135 'name': 'Andycable',
137 'arkwest': {
138 'name': 'Arkwest Communications',
140 'art030': {
141 'name': 'Arthur Mutual Telephone Company',
143 'arvig': {
144 'name': 'Arvig',
146 'nttcash010': {
147 'name': 'Ashland Home Net',
149 'astound': {
150 'name': 'Astound (now Wave)',
152 'dix030': {
153 'name': 'ATC Broadband',
155 'ara010': {
156 'name': 'ATC Communications',
158 'she030-02': {
159 'name': 'Ayersville Communications',
161 'baldwin': {
162 'name': 'Baldwin Lightstream',
164 'bal040': {
165 'name': 'Ballard TV',
167 'cit025': {
168 'name': 'Bardstown Cable TV',
170 'bay030': {
171 'name': 'Bay Country Communications',
173 'tel095': {
174 'name': 'Beaver Creek Cooperative Telephone',
176 'bea020': {
177 'name': 'Beaver Valley Cable',
179 'bee010': {
180 'name': 'Bee Line Cable',
182 'wir030': {
183 'name': 'Beehive Broadband',
185 'bra020': {
186 'name': 'BELD',
188 'bel020': {
189 'name': 'Bellevue Municipal Cable',
191 'vol040-01': {
192 'name': 'Ben Lomand Connect / BLTV',
194 'bev010': {
195 'name': 'BEVCOMM',
197 'big020': {
198 'name': 'Big Sandy Broadband',
200 'ble020': {
201 'name': 'Bledsoe Telephone Cooperative',
203 'bvt010': {
204 'name': 'Blue Valley Tele-Communications',
206 'bra050': {
207 'name': 'Brandenburg Telephone Co.',
209 'bte010': {
210 'name': 'Bristol Tennessee Essential Services',
212 'annearundel': {
213 'name': 'Broadstripe',
215 'btc010': {
216 'name': 'BTC Communications',
218 'btc040': {
219 'name': 'BTC Vision - Nahunta',
221 'bul010': {
222 'name': 'Bulloch Telephone Cooperative',
224 'but010': {
225 'name': 'Butler-Bremer Communications',
227 'tel160-csp': {
228 'name': 'C Spire SNAP',
230 'csicable': {
231 'name': 'Cable Services Inc.',
233 'cableamerica': {
234 'name': 'CableAmerica',
236 'cab038': {
237 'name': 'CableSouth Media 3',
239 'weh010-camtel': {
240 'name': 'Cam-Tel Company',
242 'car030': {
243 'name': 'Cameron Communications',
245 'canbytel': {
246 'name': 'Canby Telcom',
248 'crt020': {
249 'name': 'CapRock Tv',
251 'car050': {
252 'name': 'Carnegie Cable',
254 'cas': {
255 'name': 'CAS Cable',
257 'casscomm': {
258 'name': 'CASSCOMM',
260 'mid180-02': {
261 'name': 'Catalina Broadband Solutions',
263 'cccomm': {
264 'name': 'CC Communications',
266 'nttccde010': {
267 'name': 'CDE Lightband',
269 'cfunet': {
270 'name': 'Cedar Falls Utilities',
272 'dem010-01': {
273 'name': 'Celect-Bloomer Telephone Area',
275 'dem010-02': {
276 'name': 'Celect-Bruce Telephone Area',
278 'dem010-03': {
279 'name': 'Celect-Citizens Connected Area',
281 'dem010-04': {
282 'name': 'Celect-Elmwood/Spring Valley Area',
284 'dem010-06': {
285 'name': 'Celect-Mosaic Telecom',
287 'dem010-05': {
288 'name': 'Celect-West WI Telephone Area',
290 'net010-02': {
291 'name': 'Cellcom/Nsight Telservices',
293 'cen100': {
294 'name': 'CentraCom',
296 'nttccst010': {
297 'name': 'Central Scott / CSTV',
299 'cha035': {
300 'name': 'Chaparral CableVision',
302 'cha050': {
303 'name': 'Chariton Valley Communication Corporation, Inc.',
305 'cha060': {
306 'name': 'Chatmoss Cablevision',
308 'nttcche010': {
309 'name': 'Cherokee Communications',
311 'che050': {
312 'name': 'Chesapeake Bay Communications',
314 'cimtel': {
315 'name': 'Cim-Tel Cable, LLC.',
317 'cit180': {
318 'name': 'Citizens Cablevision - Floyd, VA',
320 'cit210': {
321 'name': 'Citizens Cablevision, Inc.',
323 'cit040': {
324 'name': 'Citizens Fiber',
326 'cit250': {
327 'name': 'Citizens Mutual',
329 'war040': {
330 'name': 'Citizens Telephone Corporation',
332 'wat025': {
333 'name': 'City Of Monroe',
335 'wadsworth': {
336 'name': 'CityLink',
338 'nor100': {
339 'name': 'CL Tel',
341 'cla010': {
342 'name': 'Clarence Telephone and Cedar Communications',
344 'ser060': {
345 'name': 'Clear Choice Communications',
347 'tac020': {
348 'name': 'Click! Cable TV',
350 'war020': {
351 'name': 'CLICK1.NET',
353 'cml010': {
354 'name': 'CML Telephone Cooperative Association',
356 'cns': {
357 'name': 'CNS',
359 'com160': {
360 'name': 'Co-Mo Connect',
362 'coa020': {
363 'name': 'Coast Communications',
365 'coa030': {
366 'name': 'Coaxial Cable TV',
368 'mid055': {
369 'name': 'Cobalt TV (Mid-State Community TV)',
371 'col070': {
372 'name': 'Columbia Power & Water Systems',
374 'col080': {
375 'name': 'Columbus Telephone',
377 'nor105': {
378 'name': 'Communications 1 Cablevision, Inc.',
380 'com150': {
381 'name': 'Community Cable & Broadband',
383 'com020': {
384 'name': 'Community Communications Company',
386 'coy010': {
387 'name': 'commZoom',
389 'com025': {
390 'name': 'Complete Communication Services',
392 'cat020': {
393 'name': 'Comporium',
395 'com071': {
396 'name': 'ComSouth Telesys',
398 'consolidatedcable': {
399 'name': 'Consolidated',
401 'conwaycorp': {
402 'name': 'Conway Corporation',
404 'coo050': {
405 'name': 'Coon Valley Telecommunications Inc',
407 'coo080': {
408 'name': 'Cooperative Telephone Company',
410 'cpt010': {
411 'name': 'CP-TEL',
413 'cra010': {
414 'name': 'Craw-Kan Telephone',
416 'crestview': {
417 'name': 'Crestview Cable Communications',
419 'cross': {
420 'name': 'Cross TV',
422 'cro030': {
423 'name': 'Crosslake Communications',
425 'ctc040': {
426 'name': 'CTC - Brainerd MN',
428 'phe030': {
429 'name': 'CTV-Beam - East Alabama',
431 'cun010': {
432 'name': 'Cunningham Telephone & Cable',
434 'dpc010': {
435 'name': 'D & P Communications',
437 'dak030': {
438 'name': 'Dakota Central Telecommunications',
440 'nttcdel010': {
441 'name': 'Delcambre Telephone LLC',
443 'tel160-del': {
444 'name': 'Delta Telephone Company',
446 'sal040': {
447 'name': 'DiamondNet',
449 'ind060-dc': {
450 'name': 'Direct Communications',
452 'doy010': {
453 'name': 'Doylestown Cable TV',
455 'dic010': {
456 'name': 'DRN',
458 'dtc020': {
459 'name': 'DTC',
461 'dtc010': {
462 'name': 'DTC Cable (Delhi)',
464 'dum010': {
465 'name': 'Dumont Telephone Company',
467 'dun010': {
468 'name': 'Dunkerton Telephone Cooperative',
470 'cci010': {
471 'name': 'Duo County Telecom',
473 'eagle': {
474 'name': 'Eagle Communications',
476 'weh010-east': {
477 'name': 'East Arkansas Cable TV',
479 'eatel': {
480 'name': 'EATEL Video, LLC',
482 'ell010': {
483 'name': 'ECTA',
485 'emerytelcom': {
486 'name': 'Emery Telcom Video LLC',
488 'nor200': {
489 'name': 'Empire Access',
491 'endeavor': {
492 'name': 'Endeavor Communications',
494 'sun045': {
495 'name': 'Enhanced Telecommunications Corporation',
497 'mid030': {
498 'name': 'enTouch',
500 'epb020': {
501 'name': 'EPB Smartnet',
503 'jea010': {
504 'name': 'EPlus Broadband',
506 'com065': {
507 'name': 'ETC',
509 'ete010': {
510 'name': 'Etex Communications',
512 'fbc-tele': {
513 'name': 'F&B Communications',
515 'fal010': {
516 'name': 'Falcon Broadband',
518 'fam010': {
519 'name': 'FamilyView CableVision',
521 'far020': {
522 'name': 'Farmers Mutual Telephone Company',
524 'fay010': {
525 'name': 'Fayetteville Public Utilities',
527 'sal060': {
528 'name': 'fibrant',
530 'fid010': {
531 'name': 'Fidelity Communications',
533 'for030': {
534 'name': 'FJ Communications',
536 'fli020': {
537 'name': 'Flint River Communications',
539 'far030': {
540 'name': 'FMT - Jesup',
542 'foo010': {
543 'name': 'Foothills Communications',
545 'for080': {
546 'name': 'Forsyth CableNet',
548 'fbcomm': {
549 'name': 'Frankfort Plant Board',
551 'tel160-fra': {
552 'name': 'Franklin Telephone Company',
554 'nttcftc010': {
555 'name': 'FTC',
557 'fullchannel': {
558 'name': 'Full Channel, Inc.',
560 'gar040': {
561 'name': 'Gardonville Cooperative Telephone Association',
563 'gbt010': {
564 'name': 'GBT Communications, Inc.',
566 'tec010': {
567 'name': 'Genuine Telecom',
569 'clr010': {
570 'name': 'Giant Communications',
572 'gla010': {
573 'name': 'Glasgow EPB',
575 'gle010': {
576 'name': 'Glenwood Telecommunications',
578 'gra060': {
579 'name': 'GLW Broadband Inc.',
581 'goldenwest': {
582 'name': 'Golden West Cablevision',
584 'vis030': {
585 'name': 'Grantsburg Telcom',
587 'gpcom': {
588 'name': 'Great Plains Communications',
590 'gri010': {
591 'name': 'Gridley Cable Inc',
593 'hbc010': {
594 'name': 'H&B Cable Services',
596 'hae010': {
597 'name': 'Haefele TV Inc.',
599 'htc010': {
600 'name': 'Halstad Telephone Company',
602 'har005': {
603 'name': 'Harlan Municipal Utilities',
605 'har020': {
606 'name': 'Hart Communications',
608 'ced010': {
609 'name': 'Hartelco TV',
611 'hea040': {
612 'name': 'Heart of Iowa Communications Cooperative',
614 'htc020': {
615 'name': 'Hickory Telephone Company',
617 'nttchig010': {
618 'name': 'Highland Communication Services',
620 'hig030': {
621 'name': 'Highland Media',
623 'spc010': {
624 'name': 'Hilliary Communications',
626 'hin020': {
627 'name': 'Hinton CATV Co.',
629 'hometel': {
630 'name': 'HomeTel Entertainment, Inc.',
632 'hoodcanal': {
633 'name': 'Hood Canal Communications',
635 'weh010-hope': {
636 'name': 'Hope - Prescott Cable TV',
638 'horizoncable': {
639 'name': 'Horizon Cable TV, Inc.',
641 'hor040': {
642 'name': 'Horizon Chillicothe Telephone',
644 'htc030': {
645 'name': 'HTC Communications Co. - IL',
647 'htccomm': {
648 'name': 'HTC Communications, Inc. - IA',
650 'wal005': {
651 'name': 'Huxley Communications',
653 'imon': {
654 'name': 'ImOn Communications',
656 'ind040': {
657 'name': 'Independence Telecommunications',
659 'rrc010': {
660 'name': 'Inland Networks',
662 'stc020': {
663 'name': 'Innovative Cable TV St Croix',
665 'car100': {
666 'name': 'Innovative Cable TV St Thomas-St John',
668 'icc010': {
669 'name': 'Inside Connect Cable',
671 'int100': {
672 'name': 'Integra Telecom',
674 'int050': {
675 'name': 'Interstate Telecommunications Coop',
677 'irv010': {
678 'name': 'Irvine Cable',
680 'k2c010': {
681 'name': 'K2 Communications',
683 'kal010': {
684 'name': 'Kalida Telephone Company, Inc.',
686 'kal030': {
687 'name': 'Kalona Cooperative Telephone Company',
689 'kmt010': {
690 'name': 'KMTelecom',
692 'kpu010': {
693 'name': 'KPU Telecommunications',
695 'kuh010': {
696 'name': 'Kuhn Communications, Inc.',
698 'lak130': {
699 'name': 'Lakeland Communications',
701 'lan010': {
702 'name': 'Langco',
704 'lau020': {
705 'name': 'Laurel Highland Total Communications, Inc.',
707 'leh010': {
708 'name': 'Lehigh Valley Cooperative Telephone',
710 'bra010': {
711 'name': 'Limestone Cable/Bracken Cable',
713 'loc020': {
714 'name': 'LISCO',
716 'lit020': {
717 'name': 'Litestream',
719 'tel140': {
720 'name': 'LivCom',
722 'loc010': {
723 'name': 'LocalTel Communications',
725 'weh010-longview': {
726 'name': 'Longview - Kilgore Cable TV',
728 'lon030': {
729 'name': 'Lonsdale Video Ventures, LLC',
731 'lns010': {
732 'name': 'Lost Nation-Elwood Telephone Co.',
734 'nttclpc010': {
735 'name': 'LPC Connect',
737 'lumos': {
738 'name': 'Lumos Networks',
740 'madison': {
741 'name': 'Madison Communications',
743 'mad030': {
744 'name': 'Madison County Cable Inc.',
746 'nttcmah010': {
747 'name': 'Mahaska Communication Group',
749 'mar010': {
750 'name': 'Marne & Elk Horn Telephone Company',
752 'mcc040': {
753 'name': 'McClure Telephone Co.',
755 'mctv': {
756 'name': 'MCTV',
758 'merrimac': {
759 'name': 'Merrimac Communications Ltd.',
761 'metronet': {
762 'name': 'Metronet',
764 'mhtc': {
765 'name': 'MHTC',
767 'midhudson': {
768 'name': 'Mid-Hudson Cable',
770 'midrivers': {
771 'name': 'Mid-Rivers Communications',
773 'mid045': {
774 'name': 'Midstate Communications',
776 'mil080': {
777 'name': 'Milford Communications',
779 'min030': {
780 'name': 'MINET',
782 'nttcmin010': {
783 'name': 'Minford TV',
785 'san040-02': {
786 'name': 'Mitchell Telecom',
788 'mlg010': {
789 'name': 'MLGC',
791 'mon060': {
792 'name': 'Mon-Cre TVE',
794 'mou110': {
795 'name': 'Mountain Telephone',
797 'mou050': {
798 'name': 'Mountain Village Cable',
800 'mtacomm': {
801 'name': 'MTA Communications, LLC',
803 'mtc010': {
804 'name': 'MTC Cable',
806 'med040': {
807 'name': 'MTC Technologies',
809 'man060': {
810 'name': 'MTCC',
812 'mtc030': {
813 'name': 'MTCO Communications',
815 'mul050': {
816 'name': 'Mulberry Telecommunications',
818 'mur010': {
819 'name': 'Murray Electric System',
821 'musfiber': {
822 'name': 'MUS FiberNET',
824 'mpw': {
825 'name': 'Muscatine Power & Water',
827 'nttcsli010': {
828 'name': 'myEVTV.com',
830 'nor115': {
831 'name': 'NCC',
833 'nor260': {
834 'name': 'NDTC',
836 'nctc': {
837 'name': 'Nebraska Central Telecom, Inc.',
839 'nel020': {
840 'name': 'Nelsonville TV Cable',
842 'nem010': {
843 'name': 'Nemont',
845 'new075': {
846 'name': 'New Hope Telephone Cooperative',
848 'nor240': {
849 'name': 'NICP',
851 'cic010': {
852 'name': 'NineStar Connect',
854 'nktelco': {
855 'name': 'NKTelco',
857 'nortex': {
858 'name': 'Nortex Communications',
860 'nor140': {
861 'name': 'North Central Telephone Cooperative',
863 'nor030': {
864 'name': 'Northland Communications',
866 'nor075': {
867 'name': 'Northwest Communications',
869 'nor125': {
870 'name': 'Norwood Light Broadband',
872 'net010': {
873 'name': 'Nsight Telservices',
875 'dur010': {
876 'name': 'Ntec',
878 'nts010': {
879 'name': 'NTS Communications',
881 'new045': {
882 'name': 'NU-Telecom',
884 'nulink': {
885 'name': 'NuLink',
887 'jam030': {
888 'name': 'NVC',
890 'far035': {
891 'name': 'OmniTel Communications',
893 'onesource': {
894 'name': 'OneSource Communications',
896 'cit230': {
897 'name': 'Opelika Power Services',
899 'daltonutilities': {
900 'name': 'OptiLink',
902 'mid140': {
903 'name': 'OPTURA',
905 'ote010': {
906 'name': 'OTEC Communication Company',
908 'cci020': {
909 'name': 'Packerland Broadband',
911 'pan010': {
912 'name': 'Panora Telco/Guthrie Center Communications',
914 'otter': {
915 'name': 'Park Region Telephone & Otter Tail Telcom',
917 'mid050': {
918 'name': 'Partner Communications Cooperative',
920 'fib010': {
921 'name': 'Pathway',
923 'paulbunyan': {
924 'name': 'Paul Bunyan Communications',
926 'pem020': {
927 'name': 'Pembroke Telephone Company',
929 'mck010': {
930 'name': 'Peoples Rural Telephone Cooperative',
932 'pul010': {
933 'name': 'PES Energize',
935 'phi010': {
936 'name': 'Philippi Communications System',
938 'phonoscope': {
939 'name': 'Phonoscope Cable',
941 'pin070': {
942 'name': 'Pine Belt Communications, Inc.',
944 'weh010-pine': {
945 'name': 'Pine Bluff Cable TV',
947 'pin060': {
948 'name': 'Pineland Telephone Cooperative',
950 'cam010': {
951 'name': 'Pinpoint Communications',
953 'pio060': {
954 'name': 'Pioneer Broadband',
956 'pioncomm': {
957 'name': 'Pioneer Communications',
959 'pioneer': {
960 'name': 'Pioneer DTV',
962 'pla020': {
963 'name': 'Plant TiftNet, Inc.',
965 'par010': {
966 'name': 'PLWC',
968 'pro035': {
969 'name': 'PMT',
971 'vik011': {
972 'name': 'Polar Cablevision',
974 'pottawatomie': {
975 'name': 'Pottawatomie Telephone Co.',
977 'premiercomm': {
978 'name': 'Premier Communications',
980 'psc010': {
981 'name': 'PSC',
983 'pan020': {
984 'name': 'PTCI',
986 'qco010': {
987 'name': 'QCOL',
989 'qua010': {
990 'name': 'Quality Cablevision',
992 'rad010': {
993 'name': 'Radcliffe Telephone Company',
995 'car040': {
996 'name': 'Rainbow Communications',
998 'rai030': {
999 'name': 'Rainier Connect',
1001 'ral010': {
1002 'name': 'Ralls Technologies',
1004 'rct010': {
1005 'name': 'RC Technologies',
1007 'red040': {
1008 'name': 'Red River Communications',
1010 'ree010': {
1011 'name': 'Reedsburg Utility Commission',
1013 'mol010': {
1014 'name': 'Reliance Connects- Oregon',
1016 'res020': {
1017 'name': 'Reserve Telecommunications',
1019 'weh010-resort': {
1020 'name': 'Resort TV Cable',
1022 'rld010': {
1023 'name': 'Richland Grant Telephone Cooperative, Inc.',
1025 'riv030': {
1026 'name': 'River Valley Telecommunications Coop',
1028 'rockportcable': {
1029 'name': 'Rock Port Cablevision',
1031 'rsf010': {
1032 'name': 'RS Fiber',
1034 'rtc': {
1035 'name': 'RTC Communication Corp',
1037 'res040': {
1038 'name': 'RTC-Reservation Telephone Coop.',
1040 'rte010': {
1041 'name': 'RTEC Communications',
1043 'stc010': {
1044 'name': 'S&T',
1046 'san020': {
1047 'name': 'San Bruno Cable TV',
1049 'san040-01': {
1050 'name': 'Santel',
1052 'sav010': {
1053 'name': 'SCI Broadband-Savage Communications Inc.',
1055 'sco050': {
1056 'name': 'Scottsboro Electric Power Board',
1058 'scr010': {
1059 'name': 'Scranton Telephone Company',
1061 'selco': {
1062 'name': 'SELCO',
1064 'she010': {
1065 'name': 'Shentel',
1067 'she030': {
1068 'name': 'Sherwood Mutual Telephone Association, Inc.',
1070 'ind060-ssc': {
1071 'name': 'Silver Star Communications',
1073 'sjoberg': {
1074 'name': 'Sjoberg\'s Inc.',
1076 'sou025': {
1077 'name': 'SKT',
1079 'sky050': {
1080 'name': 'SkyBest TV',
1082 'nttcsmi010': {
1083 'name': 'Smithville Communications',
1085 'woo010': {
1086 'name': 'Solarus',
1088 'sou075': {
1089 'name': 'South Central Rural Telephone Cooperative',
1091 'sou065': {
1092 'name': 'South Holt Cablevision, Inc.',
1094 'sou035': {
1095 'name': 'South Slope Cooperative Communications',
1097 'spa020': {
1098 'name': 'Spanish Fork Community Network',
1100 'spe010': {
1101 'name': 'Spencer Municipal Utilities',
1103 'spi005': {
1104 'name': 'Spillway Communications, Inc.',
1106 'srt010': {
1107 'name': 'SRT',
1109 'cccsmc010': {
1110 'name': 'St. Maarten Cable TV',
1112 'sta025': {
1113 'name': 'Star Communications',
1115 'sco020': {
1116 'name': 'STE',
1118 'uin010': {
1119 'name': 'STRATA Networks',
1121 'sum010': {
1122 'name': 'Sumner Cable TV',
1124 'pie010': {
1125 'name': 'Surry TV/PCSI TV',
1127 'swa010': {
1128 'name': 'Swayzee Communications',
1130 'sweetwater': {
1131 'name': 'Sweetwater Cable Television Co',
1133 'weh010-talequah': {
1134 'name': 'Tahlequah Cable TV',
1136 'tct': {
1137 'name': 'TCT',
1139 'tel050': {
1140 'name': 'Tele-Media Company',
1142 'com050': {
1143 'name': 'The Community Agency',
1145 'thr020': {
1146 'name': 'Three River',
1148 'cab140': {
1149 'name': 'Town & Country Technologies',
1151 'tra010': {
1152 'name': 'Trans-Video',
1154 'tre010': {
1155 'name': 'Trenton TV Cable Company',
1157 'tcc': {
1158 'name': 'Tri County Communications Cooperative',
1160 'tri025': {
1161 'name': 'TriCounty Telecom',
1163 'tri110': {
1164 'name': 'TrioTel Communications, Inc.',
1166 'tro010': {
1167 'name': 'Troy Cablevision, Inc.',
1169 'tsc': {
1170 'name': 'TSC',
1172 'cit220': {
1173 'name': 'Tullahoma Utilities Board',
1175 'tvc030': {
1176 'name': 'TV Cable of Rensselaer',
1178 'tvc015': {
1179 'name': 'TVC Cable',
1181 'cab180': {
1182 'name': 'TVision',
1184 'twi040': {
1185 'name': 'Twin Lakes',
1187 'tvtinc': {
1188 'name': 'Twin Valley',
1190 'uis010': {
1191 'name': 'Union Telephone Company',
1193 'uni110': {
1194 'name': 'United Communications - TN',
1196 'uni120': {
1197 'name': 'United Services',
1199 'uss020': {
1200 'name': 'US Sonet',
1202 'cab060': {
1203 'name': 'USA Communications',
1205 'she005': {
1206 'name': 'USA Communications/Shellsburg, IA',
1208 'val040': {
1209 'name': 'Valley TeleCom Group',
1211 'val025': {
1212 'name': 'Valley Telecommunications',
1214 'val030': {
1215 'name': 'Valparaiso Broadband',
1217 'cla050': {
1218 'name': 'Vast Broadband',
1220 'sul015': {
1221 'name': 'Venture Communications Cooperative, Inc.',
1223 'ver025': {
1224 'name': 'Vernon Communications Co-op',
1226 'weh010-vicksburg': {
1227 'name': 'Vicksburg Video',
1229 'vis070': {
1230 'name': 'Vision Communications',
1232 'volcanotel': {
1233 'name': 'Volcano Vision, Inc.',
1235 'vol040-02': {
1236 'name': 'VolFirst / BLTV',
1238 'ver070': {
1239 'name': 'VTel',
1241 'nttcvtx010': {
1242 'name': 'VTX1',
1244 'bci010-02': {
1245 'name': 'Vyve Broadband',
1247 'wab020': {
1248 'name': 'Wabash Mutual Telephone',
1250 'waitsfield': {
1251 'name': 'Waitsfield Cable',
1253 'wal010': {
1254 'name': 'Walnut Communications',
1256 'wavebroadband': {
1257 'name': 'Wave',
1259 'wav030': {
1260 'name': 'Waverly Communications Utility',
1262 'wbi010': {
1263 'name': 'WBI',
1265 'web020': {
1266 'name': 'Webster-Calhoun Cooperative Telephone Association',
1268 'wes005': {
1269 'name': 'West Alabama TV Cable',
1271 'carolinata': {
1272 'name': 'West Carolina Communications',
1274 'wct010': {
1275 'name': 'West Central Telephone Association',
1277 'wes110': {
1278 'name': 'West River Cooperative Telephone Company',
1280 'ani030': {
1281 'name': 'WesTel Systems',
1283 'westianet': {
1284 'name': 'Western Iowa Networks',
1286 'nttcwhi010': {
1287 'name': 'Whidbey Telecom',
1289 'weh010-white': {
1290 'name': 'White County Cable TV',
1292 'wes130': {
1293 'name': 'Wiatel',
1295 'wik010': {
1296 'name': 'Wiktel',
1298 'wil070': {
1299 'name': 'Wilkes Communications, Inc./RiverStreet Networks',
1301 'wil015': {
1302 'name': 'Wilson Communications',
1304 'win010': {
1305 'name': 'Windomnet/SMBS',
1307 'win090': {
1308 'name': 'Windstream Cable TV',
1310 'wcta': {
1311 'name': 'Winnebago Cooperative Telecom Association',
1313 'wtc010': {
1314 'name': 'WTC',
1316 'wil040': {
1317 'name': 'WTC Communications, Inc.',
1319 'wya010': {
1320 'name': 'Wyandotte Cable',
1322 'hin020-02': {
1323 'name': 'X-Stream Services',
1325 'xit010': {
1326 'name': 'XIT Communications',
1328 'yel010': {
1329 'name': 'Yelcot Communications',
1331 'mid180-01': {
1332 'name': 'yondoo',
1334 'cou060': {
1335 'name': 'Zito Media',
1337 'slingtv': {
1338 'name': 'Sling TV',
1339 'username_field': 'username',
1340 'password_field': 'password',
1342 'Suddenlink': {
1343 'name': 'Suddenlink',
1344 'username_field': 'username',
1345 'password_field': 'password',
1347 'AlticeOne': {
1348 'name': 'Optimum TV',
1349 'username_field': 'j_username',
1350 'password_field': 'j_password',
1355 class AdobePassIE(InfoExtractor): # XXX: Conventionally, base classes should end with BaseIE/InfoExtractor
1356 _SERVICE_PROVIDER_TEMPLATE = 'https://sp.auth.adobe.com/adobe-services/%s'
1357 _USER_AGENT = 'Mozilla/5.0 (X11; Linux i686; rv:47.0) Gecko/20100101 Firefox/47.0'
1358 _MVPD_CACHE = 'ap-mvpd'
1360 _DOWNLOADING_LOGIN_PAGE = 'Downloading Provider Login Page'
1362 def _download_webpage_handle(self, *args, **kwargs):
1363 headers = self.geo_verification_headers()
1364 headers.update(kwargs.get('headers', {}))
1365 kwargs['headers'] = headers
1366 return super()._download_webpage_handle(
1367 *args, **kwargs)
1369 @staticmethod
1370 def _get_mvpd_resource(provider_id, title, guid, rating):
1371 channel = etree.Element('channel')
1372 channel_title = etree.SubElement(channel, 'title')
1373 channel_title.text = provider_id
1374 item = etree.SubElement(channel, 'item')
1375 resource_title = etree.SubElement(item, 'title')
1376 resource_title.text = title
1377 resource_guid = etree.SubElement(item, 'guid')
1378 resource_guid.text = guid
1379 resource_rating = etree.SubElement(item, 'media:rating')
1380 resource_rating.attrib = {'scheme': 'urn:v-chip'}
1381 resource_rating.text = rating
1382 return '<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">' + etree.tostring(channel).decode() + '</rss>'
1384 def _extract_mvpd_auth(self, url, video_id, requestor_id, resource):
1385 def xml_text(xml_str, tag):
1386 return self._search_regex(
1387 f'<{tag}>(.+?)</{tag}>', xml_str, tag)
1389 def is_expired(token, date_ele):
1390 token_expires = unified_timestamp(re.sub(r'[_ ]GMT', '', xml_text(token, date_ele)))
1391 return token_expires and token_expires <= int(time.time())
1393 def post_form(form_page_res, note, data={}):
1394 form_page, urlh = form_page_res
1395 post_url = self._html_search_regex(r'<form[^>]+action=(["\'])(?P<url>.+?)\1', form_page, 'post url', group='url')
1396 if not re.match(r'https?://', post_url):
1397 post_url = urllib.parse.urljoin(urlh.url, post_url)
1398 form_data = self._hidden_inputs(form_page)
1399 form_data.update(data)
1400 return self._download_webpage_handle(
1401 post_url, video_id, note, data=urlencode_postdata(form_data), headers={
1402 'Content-Type': 'application/x-www-form-urlencoded',
1405 def raise_mvpd_required():
1406 raise ExtractorError(
1407 'This video is only available for users of participating TV providers. '
1408 'Use --ap-mso to specify Adobe Pass Multiple-system operator Identifier '
1409 'and --ap-username and --ap-password or --netrc to provide account credentials.', expected=True)
1411 def extract_redirect_url(html, url=None, fatal=False):
1412 # TODO: eliminate code duplication with generic extractor and move
1413 # redirection code into _download_webpage_handle
1414 REDIRECT_REGEX = r'[0-9]{,2};\s*(?:URL|url)=\'?([^\'"]+)'
1415 redirect_url = self._search_regex(
1416 r'(?i)<meta\s+(?=(?:[a-z-]+="[^"]+"\s+)*http-equiv="refresh")'
1417 rf'(?:[a-z-]+="[^"]+"\s+)*?content="{REDIRECT_REGEX}',
1418 html, 'meta refresh redirect',
1419 default=NO_DEFAULT if fatal else None, fatal=fatal)
1420 if not redirect_url:
1421 return None
1422 if url:
1423 redirect_url = urllib.parse.urljoin(url, unescapeHTML(redirect_url))
1424 return redirect_url
1426 mvpd_headers = {
1427 'ap_42': 'anonymous',
1428 'ap_11': 'Linux i686',
1429 'ap_z': self._USER_AGENT,
1430 'User-Agent': self._USER_AGENT,
1433 guid = xml_text(resource, 'guid') if '<' in resource else resource
1434 count = 0
1435 while count < 2:
1436 requestor_info = self.cache.load(self._MVPD_CACHE, requestor_id) or {}
1437 authn_token = requestor_info.get('authn_token')
1438 if authn_token and is_expired(authn_token, 'simpleTokenExpires'):
1439 authn_token = None
1440 if not authn_token:
1441 mso_id = self.get_param('ap_mso')
1442 if mso_id:
1443 username, password = self._get_login_info('ap_username', 'ap_password', mso_id)
1444 if not username or not password:
1445 raise_mvpd_required()
1446 mso_info = MSO_INFO[mso_id]
1448 provider_redirect_page_res = self._download_webpage_handle(
1449 self._SERVICE_PROVIDER_TEMPLATE % 'authenticate/saml', video_id,
1450 'Downloading Provider Redirect Page', query={
1451 'noflash': 'true',
1452 'mso_id': mso_id,
1453 'requestor_id': requestor_id,
1454 'no_iframe': 'false',
1455 'domain_name': 'adobe.com',
1456 'redirect_url': url,
1458 elif not self._cookies_passed:
1459 raise_mvpd_required()
1461 if not mso_id:
1462 pass
1463 elif mso_id == 'Comcast_SSO':
1464 # Comcast page flow varies by video site and whether you
1465 # are on Comcast's network.
1466 provider_redirect_page, urlh = provider_redirect_page_res
1467 if 'automatically signing you in' in provider_redirect_page:
1468 oauth_redirect_url = self._html_search_regex(
1469 r'window\.location\s*=\s*[\'"]([^\'"]+)',
1470 provider_redirect_page, 'oauth redirect')
1471 self._download_webpage(
1472 oauth_redirect_url, video_id, 'Confirming auto login')
1473 elif 'automatically signed in with' in provider_redirect_page:
1474 # Seems like comcast is rolling up new way of automatically signing customers
1475 oauth_redirect_url = self._html_search_regex(
1476 r'continue:\s*"(https://oauth\.xfinity\.com/oauth/authorize\?.+)"', provider_redirect_page,
1477 'oauth redirect (signed)')
1478 # Just need to process the request. No useful data comes back
1479 self._download_webpage(oauth_redirect_url, video_id, 'Confirming auto login')
1480 else:
1481 if '<form name="signin"' in provider_redirect_page:
1482 provider_login_page_res = provider_redirect_page_res
1483 elif 'http-equiv="refresh"' in provider_redirect_page:
1484 oauth_redirect_url = extract_redirect_url(
1485 provider_redirect_page, fatal=True)
1486 provider_login_page_res = self._download_webpage_handle(
1487 oauth_redirect_url, video_id,
1488 self._DOWNLOADING_LOGIN_PAGE)
1489 else:
1490 provider_login_page_res = post_form(
1491 provider_redirect_page_res,
1492 self._DOWNLOADING_LOGIN_PAGE)
1494 mvpd_confirm_page_res = post_form(
1495 provider_login_page_res, 'Logging in', {
1496 mso_info['username_field']: username,
1497 mso_info['password_field']: password,
1499 mvpd_confirm_page, urlh = mvpd_confirm_page_res
1500 if '<button class="submit" value="Resume">Resume</button>' in mvpd_confirm_page:
1501 post_form(mvpd_confirm_page_res, 'Confirming Login')
1502 elif mso_id == 'Philo':
1503 # Philo has very unique authentication method
1504 self._download_webpage(
1505 'https://idp.philo.com/auth/init/login_code', video_id, 'Requesting auth code', data=urlencode_postdata({
1506 'ident': username,
1507 'device': 'web',
1508 'send_confirm_link': False,
1509 'send_token': True,
1511 philo_code = getpass.getpass('Type auth code you have received [Return]: ')
1512 self._download_webpage(
1513 'https://idp.philo.com/auth/update/login_code', video_id, 'Submitting token', data=urlencode_postdata({
1514 'token': philo_code,
1516 mvpd_confirm_page_res = self._download_webpage_handle('https://idp.philo.com/idp/submit', video_id, 'Confirming Philo Login')
1517 post_form(mvpd_confirm_page_res, 'Confirming Login')
1518 elif mso_id == 'Verizon':
1519 # In general, if you're connecting from a Verizon-assigned IP,
1520 # you will not actually pass your credentials.
1521 provider_redirect_page, urlh = provider_redirect_page_res
1522 # From non-Verizon IP, still gave 'Please wait', but noticed N==Y; will need to try on Verizon IP
1523 if 'Please wait ...' in provider_redirect_page and '\'N\'== "Y"' not in provider_redirect_page:
1524 saml_redirect_url = self._html_search_regex(
1525 r'self\.parent\.location=(["\'])(?P<url>.+?)\1',
1526 provider_redirect_page,
1527 'SAML Redirect URL', group='url')
1528 saml_login_page = self._download_webpage(
1529 saml_redirect_url, video_id,
1530 'Downloading SAML Login Page')
1531 elif 'Verizon FiOS - sign in' in provider_redirect_page:
1532 # FXNetworks from non-Verizon IP
1533 saml_login_page_res = post_form(
1534 provider_redirect_page_res, 'Logging in', {
1535 mso_info['username_field']: username,
1536 mso_info['password_field']: password,
1538 saml_login_page, urlh = saml_login_page_res
1539 if 'Please try again.' in saml_login_page:
1540 raise ExtractorError(
1541 'We\'re sorry, but either the User ID or Password entered is not correct.')
1542 else:
1543 # ABC from non-Verizon IP
1544 saml_redirect_url = self._html_search_regex(
1545 r'var\surl\s*=\s*(["\'])(?P<url>.+?)\1',
1546 provider_redirect_page,
1547 'SAML Redirect URL', group='url')
1548 saml_redirect_url = saml_redirect_url.replace(r'\/', '/')
1549 saml_redirect_url = saml_redirect_url.replace(r'\-', '-')
1550 saml_redirect_url = saml_redirect_url.replace(r'\x26', '&')
1551 saml_login_page = self._download_webpage(
1552 saml_redirect_url, video_id,
1553 'Downloading SAML Login Page')
1554 saml_login_page, urlh = post_form(
1555 [saml_login_page, saml_redirect_url], 'Logging in', {
1556 mso_info['username_field']: username,
1557 mso_info['password_field']: password,
1559 if 'Please try again.' in saml_login_page:
1560 raise ExtractorError(
1561 'Failed to login, incorrect User ID or Password.')
1562 saml_login_url = self._search_regex(
1563 r'xmlHttp\.open\("POST"\s*,\s*(["\'])(?P<url>.+?)\1',
1564 saml_login_page, 'SAML Login URL', group='url')
1565 saml_response_json = self._download_json(
1566 saml_login_url, video_id, 'Downloading SAML Response',
1567 headers={'Content-Type': 'text/xml'})
1568 self._download_webpage(
1569 saml_response_json['targetValue'], video_id,
1570 'Confirming Login', data=urlencode_postdata({
1571 'SAMLResponse': saml_response_json['SAMLResponse'],
1572 'RelayState': saml_response_json['RelayState'],
1573 }), headers={
1574 'Content-Type': 'application/x-www-form-urlencoded',
1576 elif mso_id in ('Spectrum', 'Charter_Direct'):
1577 # Spectrum's login for is dynamically loaded via JS so we need to hardcode the flow
1578 # as a one-off implementation.
1579 provider_redirect_page, urlh = provider_redirect_page_res
1580 provider_login_page_res = post_form(
1581 provider_redirect_page_res, self._DOWNLOADING_LOGIN_PAGE)
1582 saml_login_page, urlh = provider_login_page_res
1583 relay_state = self._search_regex(
1584 r'RelayState\s*=\s*"(?P<relay>.+?)";',
1585 saml_login_page, 'RelayState', group='relay')
1586 saml_request = self._search_regex(
1587 r'SAMLRequest\s*=\s*"(?P<saml_request>.+?)";',
1588 saml_login_page, 'SAMLRequest', group='saml_request')
1589 login_json = {
1590 mso_info['username_field']: username,
1591 mso_info['password_field']: password,
1592 'RelayState': relay_state,
1593 'SAMLRequest': saml_request,
1595 saml_response_json = self._download_json(
1596 'https://tveauthn.spectrum.net/tveauthentication/api/v1/manualAuth', video_id,
1597 'Downloading SAML Response',
1598 data=json.dumps(login_json).encode(),
1599 headers={
1600 'Content-Type': 'application/json',
1601 'Accept': 'application/json',
1603 self._download_webpage(
1604 saml_response_json['SAMLRedirectUri'], video_id,
1605 'Confirming Login', data=urlencode_postdata({
1606 'SAMLResponse': saml_response_json['SAMLResponse'],
1607 'RelayState': relay_state,
1608 }), headers={
1609 'Content-Type': 'application/x-www-form-urlencoded',
1611 elif mso_id == 'slingtv':
1612 # SlingTV has a meta-refresh based authentication, but also
1613 # looks at the tab history to count the number of times the
1614 # browser has been on a page
1616 first_bookend_page, urlh = provider_redirect_page_res
1618 hidden_data = self._hidden_inputs(first_bookend_page)
1619 hidden_data['history'] = 1
1621 provider_login_page_res = self._download_webpage_handle(
1622 urlh.url, video_id, 'Sending first bookend',
1623 query=hidden_data)
1625 provider_association_redirect, urlh = post_form(
1626 provider_login_page_res, 'Logging in', {
1627 mso_info['username_field']: username,
1628 mso_info['password_field']: password,
1631 provider_refresh_redirect_url = extract_redirect_url(
1632 provider_association_redirect, url=urlh.url)
1634 last_bookend_page, urlh = self._download_webpage_handle(
1635 provider_refresh_redirect_url, video_id,
1636 'Downloading Auth Association Redirect Page')
1637 hidden_data = self._hidden_inputs(last_bookend_page)
1638 hidden_data['history'] = 3
1640 mvpd_confirm_page_res = self._download_webpage_handle(
1641 urlh.url, video_id, 'Sending final bookend',
1642 query=hidden_data)
1644 post_form(mvpd_confirm_page_res, 'Confirming Login')
1645 elif mso_id == 'Suddenlink':
1646 # Suddenlink is similar to SlingTV in using a tab history count and a meta refresh,
1647 # but they also do a dynmaic redirect using javascript that has to be followed as well
1648 first_bookend_page, urlh = post_form(
1649 provider_redirect_page_res, 'Pressing Continue...')
1651 hidden_data = self._hidden_inputs(first_bookend_page)
1652 hidden_data['history_val'] = 1
1654 provider_login_redirect_page_res = self._download_webpage_handle(
1655 urlh.url, video_id, 'Sending First Bookend',
1656 query=hidden_data)
1658 provider_login_redirect_page, urlh = provider_login_redirect_page_res
1660 # Some website partners seem to not have the extra ajaxurl redirect step, so we check if we already
1661 # have the login prompt or not
1662 if 'id="password" type="password" name="password"' in provider_login_redirect_page:
1663 provider_login_page_res = provider_login_redirect_page_res
1664 else:
1665 provider_tryauth_url = self._html_search_regex(
1666 r'url:\s*[\'"]([^\'"]+)', provider_login_redirect_page, 'ajaxurl')
1667 provider_tryauth_page = self._download_webpage(
1668 provider_tryauth_url, video_id, 'Submitting TryAuth',
1669 query=hidden_data)
1671 provider_login_page_res = self._download_webpage_handle(
1672 f'https://authorize.suddenlink.net/saml/module.php/authSynacor/login.php?AuthState={provider_tryauth_page}',
1673 video_id, 'Getting Login Page',
1674 query=hidden_data)
1676 provider_association_redirect, urlh = post_form(
1677 provider_login_page_res, 'Logging in', {
1678 mso_info['username_field']: username,
1679 mso_info['password_field']: password,
1682 provider_refresh_redirect_url = extract_redirect_url(
1683 provider_association_redirect, url=urlh.url)
1685 last_bookend_page, urlh = self._download_webpage_handle(
1686 provider_refresh_redirect_url, video_id,
1687 'Downloading Auth Association Redirect Page')
1689 hidden_data = self._hidden_inputs(last_bookend_page)
1690 hidden_data['history_val'] = 3
1692 mvpd_confirm_page_res = self._download_webpage_handle(
1693 urlh.url, video_id, 'Sending Final Bookend',
1694 query=hidden_data)
1696 post_form(mvpd_confirm_page_res, 'Confirming Login')
1697 else:
1698 # Some providers (e.g. DIRECTV NOW) have another meta refresh
1699 # based redirect that should be followed.
1700 provider_redirect_page, urlh = provider_redirect_page_res
1701 provider_refresh_redirect_url = extract_redirect_url(
1702 provider_redirect_page, url=urlh.url)
1703 if provider_refresh_redirect_url:
1704 provider_redirect_page_res = self._download_webpage_handle(
1705 provider_refresh_redirect_url, video_id,
1706 'Downloading Provider Redirect Page (meta refresh)')
1707 provider_login_page_res = post_form(
1708 provider_redirect_page_res, self._DOWNLOADING_LOGIN_PAGE)
1709 form_data = {
1710 mso_info.get('username_field', 'username'): username,
1711 mso_info.get('password_field', 'password'): password,
1713 if mso_id in ('Cablevision', 'AlticeOne'):
1714 form_data['_eventId_proceed'] = ''
1715 mvpd_confirm_page_res = post_form(provider_login_page_res, 'Logging in', form_data)
1716 if mso_id != 'Rogers':
1717 post_form(mvpd_confirm_page_res, 'Confirming Login')
1719 try:
1720 session = self._download_webpage(
1721 self._SERVICE_PROVIDER_TEMPLATE % 'session', video_id,
1722 'Retrieving Session', data=urlencode_postdata({
1723 '_method': 'GET',
1724 'requestor_id': requestor_id,
1725 }), headers=mvpd_headers)
1726 except ExtractorError as e:
1727 if not mso_id and isinstance(e.cause, HTTPError) and e.cause.status == 401:
1728 raise_mvpd_required()
1729 raise
1730 if '<pendingLogout' in session:
1731 self.cache.store(self._MVPD_CACHE, requestor_id, {})
1732 count += 1
1733 continue
1734 authn_token = unescapeHTML(xml_text(session, 'authnToken'))
1735 requestor_info['authn_token'] = authn_token
1736 self.cache.store(self._MVPD_CACHE, requestor_id, requestor_info)
1738 authz_token = requestor_info.get(guid)
1739 if authz_token and is_expired(authz_token, 'simpleTokenTTL'):
1740 authz_token = None
1741 if not authz_token:
1742 authorize = self._download_webpage(
1743 self._SERVICE_PROVIDER_TEMPLATE % 'authorize', video_id,
1744 'Retrieving Authorization Token', data=urlencode_postdata({
1745 'resource_id': resource,
1746 'requestor_id': requestor_id,
1747 'authentication_token': authn_token,
1748 'mso_id': xml_text(authn_token, 'simpleTokenMsoID'),
1749 'userMeta': '1',
1750 }), headers=mvpd_headers)
1751 if '<pendingLogout' in authorize:
1752 self.cache.store(self._MVPD_CACHE, requestor_id, {})
1753 count += 1
1754 continue
1755 if '<error' in authorize:
1756 raise ExtractorError(xml_text(authorize, 'details'), expected=True)
1757 authz_token = unescapeHTML(xml_text(authorize, 'authzToken'))
1758 requestor_info[guid] = authz_token
1759 self.cache.store(self._MVPD_CACHE, requestor_id, requestor_info)
1761 mvpd_headers.update({
1762 'ap_19': xml_text(authn_token, 'simpleSamlNameID'),
1763 'ap_23': xml_text(authn_token, 'simpleSamlSessionIndex'),
1766 short_authorize = self._download_webpage(
1767 self._SERVICE_PROVIDER_TEMPLATE % 'shortAuthorize',
1768 video_id, 'Retrieving Media Token', data=urlencode_postdata({
1769 'authz_token': authz_token,
1770 'requestor_id': requestor_id,
1771 'session_guid': xml_text(authn_token, 'simpleTokenAuthenticationGuid'),
1772 'hashed_guid': 'false',
1773 }), headers=mvpd_headers)
1774 if '<pendingLogout' in short_authorize:
1775 self.cache.store(self._MVPD_CACHE, requestor_id, {})
1776 count += 1
1777 continue
1778 return short_authorize