
    V|h"                     F    S SK r SSKJr  SSKJrJrJrJr   " S S\5      rg)    N   )InfoExtractor   )ExtractorErrortry_callunified_timestampurlencode_postdatac            
           \ rS rSrSrSrSrSS/rSSSS	S
SS.SSS./ SQS.SSSS	SS\S.SSS./ SQS.SSSS	SSS.SSS./ SQS.SSS S	S!S"S.SSS./ SQS./r	S#r
S$ rS% rS&rg')(	EplusIbIE   eplusu   e+ (イープラス)zGhttps?://live\.eplus\.jp/ex/player\?ib=(?P<id>(?:\w|%2B|%2F){86}%3D%3D)z+https?://live\.eplus\.jp/(?P<id>sample|\d+)zhttps://live.eplus.jp/ex/player?ib=41K6Wzbr3PlcMD%2FOKHFlC%2FcZCe2Eaw7FK%2BpJS1ooUHki8d0vGSy2mYqxillQBe1dSnOxU%2B8%2FzXKls4XPBSb3vw%3D%3Dz335699-0001-006uz   少女☆歌劇 レヴュースタァライト -The LIVE 青嵐- BLUE GLITTER <定点映像配信>【Streaming+(配信)】was_live20201221i r_)idtitlelive_statusrelease_daterelease_timestampT)skip_downloadignore_no_formats_error)z This event may not be accessiblezNo video formats found!Requested format is not available)url	info_dictparamsexpected_warningszhttps://live.eplus.jp/ex/player?ib=6QSsQdyRAwOFZrEHWlhRm7vocgV%2FO0YzBZ%2BaBEBg1XR%2FmbLn0R%2F048dUoAY038%2F%2F92MJ73BsoAtvUpbV6RLtDQ%3D%3D&show_id=2371511z348021-0054-001uf   ラブライブ!スーパースター!! Liella! First LoveLive! Tour ～Starlines～【東京/DAY.1】20220115i a)r   r   r   r   r   description)ACould not find the playlist URL. This event may not be accessibleNo video formats found!r   zhttps://live.eplus.jp/samplezstream1ng20210719-test-005zOnline streaming test for DRM20210719i``)r   r   r   zThis video is DRM protectedzhttps://live.eplus.jp/2053935z331320-0001-001uR   丘みどり2020配信LIVE Vol.2 ～秋麗～ 【Streaming+(配信チケット)】20200920i (g_z}Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0c                 $   U R                  S5      R                  S5      (       d  [        S5      eUR                  R                  S5      nU(       d  [        S5      eU R	                  SSU5        U R                  SS SS	S
UR                  USS.[        R                  " UUS.5      R                  5       S9nUR                  S5      (       d
  [        SSS9eU R                  UR                  S SS[        UUUSS.5      SUR                  0S9  g )Nzhttps://live.eplus.jp/
ci_sessionzUnable to get ci_session cookiezX-CLTFT-TokenzUnable to get X-CLTFT-Tokenzlive.eplus.jpz/https://live.eplus.jp/member/api/v1/FTAuth/idpwzSending pre-login infozUnable to send pre-login infozapplication/json; charset=UTF-8z*/*)zContent-TypeRefererzX-Cltft-TokenAccept)loginIdloginPassword)noteerrnoteheadersdata	isSuccessz$Login failed: Invalid id or passwordTexpectedz
Logging inzUnable to log innextPage)r&   r'   zToken.Defaultopr$   )r(   r)   r+   r*   )_get_cookiesgetr   r*   _set_cookie_download_jsonr   jsondumpsencode_request_webpager	   )selfusernamepasswordurlhcltft_token
login_jsons         P/home/james-whalen/.local/lib/python3.13/site-packages/yt_dlp/extractor/eplus.py_loginEplusIbIE._login`   s      !9:>>|LL !BCCll&&7 !>??/;G((=t)3R A88!,	]
 JJ#!)   vx ) 

 ~~k** !GRVWWHHd7I##!)!, 	% 
 #DHH- 	 	/    c           	      `  ^ U R                  U5      nU R                  XSU R                  0S9u  p4UR                  R	                  S5      (       aW  U R                  5       u  pVU(       d  U R                  5         U R                  XVU5        U R                  XSU R                  0S9nU R                  SUSU5      mTR                  S5      S:X  a  U R                  U5        TR                  S5      S	:X  a
  [        S
SS9eTR                  S5      nTR                  S5      n[        U4S j5      n	TR                  S5      n
U R                  SU SU 35        US:X  a  SnOKUS:X  a  SnOBUS:X  a  US:w  a
  [        SSS9eSnO)US:X  a  SnO US:X  a  SnOU R                  SU S35        Sn/ nU R                  SUS US!/ S"9nU(       d,  US:X  a  U R!                  S#U
 S$3SS9  OU R!                  S%SS9  OUS:X  a  U R!                  S&U
 S$3SS9  OtUS:X  a  U R!                  S'SS9  O]U H#  nUR#                  U R%                  X5      5        M%     S(nUS:X  a  U R                  U5        OUS:X  a  U R                  U S)35        TS*   TR                  S+5      UUTR                  S,5      U	S-.$ ).Nz
User-Agent)r*   z!https://live.eplus.jp/member/authz<script>\s*var app\s*=z	data jsondrm_modeONis_pass_ticketYESz6This URL is for a pass ticket instead of a player pageTr-   delivery_statusarchive_modec                  &   > [        T S   5      S-
  $ )Nevent_datetimei~  )r   )	data_jsons   r?   <lambda>)EplusIbIE._real_extract.<locals>.<lambda>   s    ->yIY?Z-[^c-crB   event_datetime_textzdelivery_status = z, archive_mode = 	PREPARINGis_upcomingSTARTEDis_liveSTOPPEDz;This event has ended and there is no archive for this event	post_liveWAIT_CONFIRM_ARCHIVEDCONFIRMED_ARCHIVEr   zUnknown delivery_status z, treat it as a livezvar\s+listChannels\s*=zhls URLsz\[.+\])contains_patterndefaultz?Could not find the playlist URL. This live event will begin at z JSTr   zThis live event will begin at z?This event has ended, and the archive will be available shortlyzMDue to technical limitations, the download will be interrupted after one hourz*. You can restart to continue the downloadapp_idapp_namecontent)r   r   formatsr   r   r   )	_match_id_download_webpage_handle_USER_AGENTr   
startswith_get_login_inforaise_login_requiredr@   _download_webpage_search_jsonr2   
report_drmr   r   write_debugreport_warningraise_no_formatsextend_extract_m3u8_formats)r9   r   video_idwebpager<   r:   r;   rH   rI   r   release_timestamp_strr   r]   m3u8_playlist_urlsm3u8_playlist_urlwarningrL   s                   @r?   _real_extractEplusIbIE._real_extract   s0   >>#&55L$2B2B#C 6 E88BCC!%!5!5!7H))+KKD1,,d6F6F'G - IG %%&?+W_`	==$,OOH%==)*e3 HSWY Y $--(9: }}^4$%cd ).C D-o->>OP\~^_k)'K	)#K	)t#$Q\`b b%K 77%K 33$K":?:KK_ `a#K!..%w
HW`jl / n!m+%%UVkUllpq  }A & B %%Wbf & hM)!!$BCXBYY]"^im!nK'!!"cnr!s%7!t99:KVW &8 fGi'##G,
*##wi/Y$Z[ H%]]:.&$==3!2
 	
rB    N)__name__
__module____qualname____firstlineno___NETRC_MACHINEIE_NAMEIE_DESC
_VALID_URLstr_TESTSr`   r@   rr   __static_attributes__rt   rB   r?   r   r      s   NG$G\@BJ [# R%&!+
 "'+

& m#}%&!+
 "'+

( ..4%&!+
 "'+

( /#i%&!+
 "'+

qJFX RK/@M
rB   r   )	r5   commonr   utilsr   r   r   r	   r   rt   rB   r?   <module>r      s#     ! A
 A
rB   