
    VGh!                     h    d dl Z d dlZddlmZ ddlmZmZmZm	Z	m
Z
  G d de      Z G d d	e      Zy)
    N   )InfoExtractor   )ExtractorError
clean_htmldetermine_extint_or_noneparse_durationc                       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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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dgZd& Zy')(	XVideosIEa  (?x)
                    https?://
                        (?:
                            (?:[^/]+\.)?xvideos2?\.com/video\.?|
                            (?:www\.)?xvideos\.es/video\.?|
                            (?:www|flashservice)\.xvideos\.com/embedframe/|
                            static-hw\.xvideos\.com/swf/xv-player\.swf\?.*?\bid_video=
                        )
                        (?P<id>[0-9a-z]+)
                    zrhttp://xvideos.com/video.ucuvbkfda4e/a_beautiful_red-haired_stranger_was_refused_but_still_came_to_my_room_for_sex 396255a900a6bddb3e98985f0b86c3fducuvbkfda4emp4zNA Beautiful Red-Haired Stranger Was Refused, But Still Came To My Room For Sexi     z.re:^https://cdn\d+-pic.xvideos-cdn.com/.+\.jpg)idexttitleduration	age_limit	thumbnailurlmd5	info_dictz5https://www.xvideos.com/video65982001/what_s_her_name 56742808292c8fa1418e4538c262c58b65982001zwhat's her name?x   z3https://flashservice.xvideos.com/embedframe/4588838T)r   only_matchingz*https://www.xvideos.com/embedframe/4588838z?http://static-hw.xvideos.com/swf/xv-player.swf?id_video=4588838z4http://xvideos.com/video4588838/biker_takes_his_girlz5https://xvideos.com/video4588838/biker_takes_his_girlz4https://xvideos.es/video4588838/biker_takes_his_girlz8https://www.xvideos.es/video4588838/biker_takes_his_girlz3http://xvideos.es/video4588838/biker_takes_his_girlz7http://www.xvideos.es/video4588838/biker_takes_his_girlz7http://fr.xvideos.com/video4588838/biker_takes_his_girlz8https://fr.xvideos.com/video4588838/biker_takes_his_girlz7http://it.xvideos.com/video4588838/biker_takes_his_girlz8https://it.xvideos.com/video4588838/biker_takes_his_girlz7http://de.xvideos.com/video4588838/biker_takes_his_girlz8https://de.xvideos.com/video4588838/biker_takes_his_girlz7https://flashservice.xvideos.com/embedframe/ucuvbkfda4ez.https://www.xvideos.com/embedframe/ucuvbkfda4ezChttp://static-hw.xvideos.com/swf/xv-player.swf?id_video=ucuvbkfda4ezrhttps://xvideos.es/video.ucuvbkfda4e/a_beautiful_red-haired_stranger_was_refused_but_still_came_to_my_room_for_sexc           
      P   | j                  |      }| j                  ||      }t        j                  d|      }|r4t	        | j
                   dt        |j                  d             d      | j                  d|dd d      xs | j                  |      }g }t        d	      D ]6  \  }}| j                  d
| d|dd d      }	|	s#|j                  |	|d       8 t        | j                  d|d             xs t        | j                  d|dd            }
g }t         j"                  j%                  | j                  d|dd            }|r|j                  |dd       t        j&                  d|      D ]  \  }}}|j)                         }|dk(  r;| j+                  ||dddd      }| j-                  ||       |j/                  |       W|dv s\|j                  |dj1                  t3        |d      |dd        |j5                  d       rd!nd d"        ||||
|d#d$S )%Nz"<h1 class="inlineError">(.+?)</h1>z said: r   T)expected)z <title>(?P<title>.+?)\s+-\s+XVIDz5setVideoTitle\s*\(\s*(["\'])(?P<title>(?:(?!\1).)+)\1r   )defaultgroup) 169setThumbUrlz)\(\s*(["\'])(?P<thumbnail>(?:(?!\1).)+)\1r   )r   
preferencer   )r!   z4<span[^>]+class=["\']duration["\'][^>]*>.*?(\d[^<]+)F)fatalzflv_url=(.+?)&z	video URLr#   flv)r   	format_idz%setVideo([^(]+)\((["\'])(http.+?)\2\)hlsr   m3u8_native)entry_protocolm3u8_idr'   )urllowurlhighz{}-{}   low)r   r)   qualityr   )r   formatsr   r   
thumbnailsr   )	_match_id_download_webpageresearchr   IE_NAMEr   r"   _html_search_regex_og_search_title	enumerate_search_regexappendr	   _og_search_propertyr
   urllibparseunquotefindalllower_extract_m3u8_formats_check_formatsextendformatr   endswith)selfr   video_idwebpagemobjr   r5   r&   r   thumbnail_urlr   r4   	video_urlkind_
format_urlr)   hls_formatss                     a/var/www/it7/html/youtubeDownloader/venv/lib/python3.12/site-packages/yt_dlp/extractor/xvideos.py_real_extractzXVideosIE._real_extractk   s   >>#&((h7yy>H DLL>DJJqM9R8S!T_cdd''GWd	 (  = #33G<	 	 
%.{%; 	!J	 ..yk)RSd+ / GM !!(",# 	 t77  8  / 0 33AG5  243 	 LL((););wR *< *A B	NN " 
 $&::8'$C 	D!Z

IE!"88%#0%u 9 N ##K:{+33%!(j%0PR[\]\^R_!`%.%7%7%>rD  	"  $
 	
    N)__name__
__module____qualname__
_VALID_URL_TESTSrV    rW   rU   r   r      sl   	J D1eJ
 G1(J
	 E < Q F G F J E I I J I J I J I @ U D[PFd@
rW   r   c                   ~    e Zd 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dddd
dddddddddd
ddgZd Zy)XVideosQuickiesIEzxvideos:quickieszphttps?://(?P<domain>(?:[^/?#]+\.)?xvideos2?\.com)/(?:profiles/|amateur-channels/)?[^/?#]+#quickies/a/(?P<id>\w+)z8https://www.xvideos.com/lili_love#quickies/a/ipdtikh1a4c f9e4f518ff1de14b99a400bbd0fc5ee0ipdtikh1a4cr   u   Mexican chichóna putisimar   Q   z-re:^https://cdn.*-pic.xvideos-cdn.com/.+\.jpg)r   r   r   r   r   r   r   zAhttps://www.xvideos.com/profiles/lili_love#quickies/a/ipphaob6fd1 5340938aac6b46e19ebdd1d84535862eipphaob6fd1z Puta chichona mexicana squirting8   zIhttps://www.xvideos.com/amateur-channels/lili_love#quickies/a/hfmffmd7661 92428518bbabcb4c513e55922e022491hfmffmd7661zChichona mexican slut	   zEhttps://www.xvideos.com/amateur-channels/wifeluna#quickies/a/47258683 16e322a93282667f1963915568f782c147258683zVerification video   c                     | j                  |      j                  dd      \  }}| j                  d| d|j                         rdnd | dt        |      S )Ndomainr   zhttps://z/videor#   .z/_)_match_valid_urlr"   
url_result	isdecimalr   )rK   r   rm   id_s       rU   rV   zXVideosQuickiesIE._real_extract   sZ    ++C066xF&cmmoSV7WX[W\\^_ajlopprW   N)rX   rY   rZ   r:   r[   r\   rV   r]   rW   rU   r_   r_      s     G EJI11I
 S17I
 [1,I
 W1)I
C,F\qrW   r_   )r8   urllib.parserA   commonr   utilsr   r   r   r	   r
   r   r_   r]   rW   rU   <module>rv      s5    	  ! ]
 ]
@3q 3qrW   