
    VGh)                     \    d dl Z d dlZddlmZ ddlmZmZ  G d de      Z G d d	e      Zy)
    N   )InfoExtractor   )InAdvancePagedListtraverse_objc                       e Zd ZdZdd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ddd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y))*LeFigaroVideoEmbedIEz8https?://video\.lefigaro\.fr/embed/[^?#]+/(?P<id>[\w-]+)zhttps://video.lefigaro.fr/embed/figaro/video/les-francais-ne-veulent-ils-plus-travailler-suivez-en-direct-le-club-le-figaro-idees/ a0c3069b7e4c4526abf0053a7713f56fg9j7EovouQ   Les Français ne veulent-ils plus travailler ? Retrouvez Le Club Le Figaro Idéesz$md5:862b8813148ba4bf10763a65a69dfe4120230216ici  z!re:^https?://[^?#]+\.(?:jpeg|jpg)mp4)idtitledescriptionupload_date	timestampduration	thumbnailext)urlmd5	info_dictzZhttps://video.lefigaro.fr/embed/figaro/video/intelligence-artificielle-faut-il-sen-mefier/ 319c662943dd777bab835cae1e2d73a5LeAgybycu4   Intelligence artificielle : faut-il s’en méfier ?z$md5:249d136e3e5934a67c8cb704f8abf4d220230124i!ci\  znhttps://video.lefigaro.fr/figaro/video/suivez-en-direct-le-club-le-figaro-international-avec-philippe-gelie-9/ 6289f9489efb969e38245f31721596feQChnbPYAuP   Où en est le couple franco-allemand ? Retrouvez Le Club Le Figaro Internationalz$md5:6f47235b7e7c93b366fd8ebfa10572ac20230123iciQ  r   )	r   r   r   r   r   r   r   	age_limitr   zhhttps://video.lefigaro.fr/figaro/video/la-philosophe-nathalie-sarthou-lajus-est-linvitee-du-figaro-live/ f6df814cae53e85937621599d2967520QJzqoNbfuD   La philosophe Nathalie Sarthou-Lajus est l’invitée du Figaro Livez$md5:c586793bb72e726c83aa257f99a8c8c420230217ici  c                    | j                  |      }| j                  ||      }| j                  ||      d   d   d   d   d   }| j                  d|d    |j	                  d      |j	                  d	      |j	                  d
            S )Nprops	pagePropsinitialPropspageData
playerDatazjwplatform:videoIdr   r   posterr   r   r   )	_match_id_download_webpage_search_nextjs_data
url_resultget)selfr   
display_idwebpageplayer_datas        b/var/www/it7/html/youtubeDownloader/venv/lib/python3.12/site-packages/yt_dlp/extractor/lefigaro.py_real_extractz"LeFigaroVideoEmbedIE._real_extractH   s    ^^C(
((j9..Z!!(**577EGGQSS_a +i012+//':R#6+//RZB[  ] 	]    N)__name__
__module____qualname__
_VALID_URL_TESTS_WEBPAGE_TESTSr6    r7   r5   r	   r	      s    LJ T1hA%#=	
 l1KA%#=	
F: @1gA%#=

 z1[A%#=

N<	]r7   r	   c                   F    e Zd ZdZdddddddd	d
dddgZdZddZd Zy)LeFigaroVideoSectionIEz>https?://video\.lefigaro\.fr/figaro/(?P<id>[\w-]+)/?(?:[#?]|$)z9https://video.lefigaro.fr/figaro/le-club-le-figaro-idees/zle-club-le-figaro-ideesu   Le Club Le Figaro Idées)r   r      )r   r   playlist_mincountz'https://video.lefigaro.fr/figaro/factu/factuFactui     Nc                     | j                  d||dt        j                  || j                  dd|d      j	                         d      S )Nz'https://api-graphql.lefigaro.fr/graphqlz]flive-website_UpdateListPage_1fb260f996bca2d78960805ac382544186b3225f5bedb43ad08b9b8abef79af6DESCPUBLISHED_AT)slugvideosLimitsortorderpage)r   	variables)notequery)_download_jsonjsondumps
_PAGE_SIZEencode)r1   r2   page_numrO   s       r5   _get_api_responsez(LeFigaroVideoSectionIE._get_api_responsei   sV    ""5zu!ZZ&#'??"+$)  68	 #  	r7   c                       j                  |       j                  d      d   d   } fd}t        |t        j                  |d    j
                  z         j
                        } j                  ||j                  d            S )	Nr   )rV   dataplaylistc                     j                  | dz   d| dz          }|d   d   d   d   d   D cg c]+  } j                  |d	   t        fi t        |d
ddd      - c}S c c}w )Nr   zDownloading page )rO   rY   rZ   jsonLdr   itemListElementembedUrlnamer   thumbnailUrlr+   )rW   r/   r	   r   )rV   api_responsevideor2   r1   s      r5   	page_funcz7LeFigaroVideoSectionIE._real_extract.<locals>.page_func{   s    11*hlSdempqeqdrQs1tL ".f!5j!A(!KA!NO`!ac
  $DOOj!#7;G##0!/P < c c cs   0A%
videoCountr   )playlist_idplaylist_title)r,   rW   r   mathceilrT   playlist_resultr0   )r1   r   initial_responserc   entriesr2   s   `    @r5   r6   z$LeFigaroVideoSectionIE._real_extractw   s    ^^C(
11*q1I&QR\]	c %tyy!1,!?$//!QRTXTcTce ##GTdThThipTq#rrr7   )N)r8   r9   r:   r;   r<   rT   rW   r6   r>   r7   r5   r@   r@   T   sU    RJ K+/
   9
 !F  Jsr7   r@   )	rR   rg   commonr   utilsr   r   r	   r@   r>   r7   r5   <module>rn      s2      !F]= F]R4s] 4sr7   