
    VGh                     Z    d dl Z d dlZddlmZ ddlmZmZmZmZ ddl	m
Z
  G d de      Zy)	    N   )InfoExtractor   )int_or_nonejoin_nonemptymimetype2exturl_or_none)traverse_objc                       e Zd Zg dZddj	                  e       dZddddd	d
ddddg dddd	ddiddddddddg dddd	ddiddddddd dg d!d"dd	ddidd#ddd$ddd%ddd&ddd'ddd(ddd)ddgZd* Zd+ Zy,)-	VidflexIE)z[^.]+\.vidflex\.tvz(?:www\.)?acactv\.caz (?:www\.)?albertalacrossetv\.comz(?:www\.)?cjfltv\.comz"(?:www\.)?figureitoutbaseball\.comz(?:www\.)?ocaalive\.comz(?:www\.)?pegasussports\.tvz(?:www\.)?praxisseries\.caz(?:www\.)?silenticetv\.comz(?:www\.)?tuffhedemantv\.comz(?:www\.)?watchfuntv\.comzlive\.ofsaa\.on\.caztv\.procoro\.caztv\.realcastmedia\.netztv\.fringetheatre\.cazvideo\.haisla\.cazvideo\.hockeycanada\.cazvideo\.huuayaht\.orgzvideo\.turningpointensemble\.cazvideos\.livingworks\.netz'videos\.telusworldofscienceedmonton\.cazwatch\.binghamtonbulldogs\.comzwatch\.rekindle\.tvzwatch\.wpca\.comzhttps?://(?:|z.)/[a-z]{2}(?:-[a-z]{2})?/c/[\w-]+\.(?P<id>\d+)zLhttps://video.hockeycanada.ca/en/c/nwt-micd-up-with-jamie-lee-rattray.107486T)urlonly_matchingzOhttps://video.hockeycanada.ca/en-us/c/nwt-micd-up-with-jamie-lee-rattray.107486107486u&   NWT: Mic’d up with Jamie Lee Rattraymp4s   i	ia20211015)English2021zNational Women's Teamz$md5:efb1cf6165b48cc3f5555c4262dd5b23z@re:^https?://wpmedia01-a\.akamaihd\.net/en/asset/public/image/.+)	idtitleextduration	timestampupload_datetagsdescription	thumbnailskip_download)r   	info_dictparamszOhttps://video.hockeycanada.ca/en/c/mwc-remembering-the-wild-ride-in-riga.112307112307z&MWC: Remembering the wild ride in RigaiB  iWKf20240520)r   2024National Men's TeamIIHF World ChampionshipFanu'   re:.+Canada’s National Men’s Team.+zThttps://video.hockeycanada.ca/fr/c/cmm-retour-sur-un-parcours-endiable-a-riga.112304112304u.   CMM : Retour sur un parcours endiablé à RigaiKf)Frenchr$   r%   r&   r'   z$md5:cf825222882a3dab1cd62cffcf3b4d1fz9https://myfbcgreenville.vidflex.tv/en/c/may-12th-2024.658zrhttps://www.figureitoutbaseball.com/en/c/fiob-podcast-14-dan-bertolini-ncaa-d1-head-coach-recorded-11-29-2018.1367zUhttps://videos.telusworldofscienceedmonton.ca/en/c/the-aurora-project-timelapse-4.577zQhttps://www.tuffhedemantv.com/en/c/2022-tuff-hedeman-tour-hobbs-nm-january-22.227zJhttps://www.albertalacrossetv.com/en/c/up-floor-ground-balls-one-more.3449zShttps://www.silenticetv.com/en/c/jp-unlocked-day-in-the-life-of-langley-ha-15u.5197zOhttps://jphl.vidflex.tv/en/c/jp-unlocked-day-in-the-life-of-langley-ha-15u.5197c                    | j                  |      }| j                  ||      }| j                  d|dd      }t        | j	                  ||      dt
        j                  ht        j                  ht        j                  ht        hf      }|t        | j                  ||            d| j                  |j                  dd      j                  d	d      |      S )
Nz6content_api:\s*(["\'])(?P<url>https?://(?:(?!\1).)+)\1zcontent api urlr   )groupconfig)r   formatsz/*<![CDATA[*/ z/*]]>*/)	_match_id_download_webpage_html_search_regexr
   _download_jsonbase64	b64decodebytesdecodejsonloadsdictlist_yield_formats_search_json_ldreplace)selfr   video_idwebpagedata_urlmedia_configs         a/var/www/it7/html/youtubeDownloader/venv/lib/python3.12/site-packages/yt_dlp/extractor/vidflex.py_real_extractzVidflexIE._real_extractp   s    >>#&((h7**EwPain + p#(3(()ELL>DJJ<$PR
 D//hGH
 ""4<<YKXW
 	
    c              #   :  K   t        |ddd f      D ]  }|d   }t        |j                  d            }|dk(  r| j                  ||dd	      E d {    E|d
k(  r2| j	                  d|dd       }t        d|      |d
t        |      d |||d  y 7 Fw)Nmediasourcec                     t        |d         S )Nsrc)r	   )_vs     rC   <lambda>z*VidflexIE._yield_formats.<locals>.<lambda>   s    XcdefkdlXm rE   rJ   typem3u8Fhls)fatalm3u8_idr   z_(\d+)k\.mp4bitrate)defaulthttp)	format_idr   r   tbr)r   r   )r
   r   get_extract_m3u8_formats_search_regexr   r   )r>   rB   r?   media_source	media_url
media_typerS   s          rC   r;   zVidflexIE._yield_formats   s     (Km7no 	L$U+I%l&6&6v&>?JV#55iQV`e5fffu$,,_i\`,a!.vw!?$ &w/	  %% 	
 gs   ABBABN)	__name__
__module____qualname___DOMAINS_REjoin
_VALID_URL_TESTSrD   r;    rE   rC   r   r      sD   K4 !+!6 77ijJ]
 a=#%@A\

 #D)  a=#%`E\

 #D)  fE#%_A\

 #D)  K D g c \ e aCDFL
"rE   r   )r3   r7   commonr   utilsr   r   r   r	   utils.traversalr
   r   re   rE   rC   <module>ri      s+      !  +F FrE   