
    VGh                     h    d dl Z ddlmZ ddlmZmZmZmZmZm	Z	m
Z
  G d de      Z G d d	e      Zy)
    N   )InfoExtractor   )
clean_htmlget_element_by_classget_elements_by_classjoin_nonemptytraverse_objunified_timestampurljoinc                   .    e Zd ZdZdddddddd	gZd
 Zy)CamFMShowIEz4https?://(?:www\.)?camfm\.co\.uk/shows/(?P<id>[^/]+)   z&https://camfm.co.uk/shows/soul-mining/zsoul-miningz$md5:6a873091f92c936f23bdcce80f75e66azSoul MiningzITelling the stories of jazz, funk and soul from all corners of the world.)id	thumbnailtitledescription)playlist_mincounturl	info_dictc                 j   | j                  |      }| j                  ||      }d|t        j                  d|      D cg c]"  }| j	                  t        d|      t              $ c}t        d| j                  d|dd            | j                  d|d	d      t        t        d
|            dS c c}w )Nplaylistz-javascript:popup\('(/player/[^']+)', 'listen'https://camfm.co.ukz/<img[^>]+class="thumb-expand"[^>]+src="([^"]+)"r   Ffatalz<h1>([^<]+)</h1>r   zsmall-12 medium-8 cell)_typer   entriesr   r   r   )	_match_id_download_webpagerefindall
url_resultr   CamFMEpisodeIE_search_regex_html_search_regexr   r   )selfr   show_idpageis        _/var/www/it7/html/youtubeDownloader/venv/lib/python3.12/site-packages/yt_dlp/extractor/camfm.py_real_extractzCamFMShowIE._real_extract   s    ..%%%c73  !#,\^b!ce 0Eq(I>Z e !68J8JBD+]b 9K 9d e,,-?wV[,\%&:;SUY&Z[	
 		
es   'B0N__name__
__module____qualname__
_VALID_URL_TESTSr+        r*   r   r      s/    HJ7?"f	
	 	F
r3   r   c                   :    e Zd ZdZdddddddd	d
ddgd	dgZd Zy)r#   z5https?://(?:www\.)?camfm\.co\.uk/player/(?P<id>[^/]+)z https://camfm.co.uk/player/43336zIEpisode will expire - don't actually know when, but it will go eventually43336z2AITAA: Am I the Agony Aunt? - 19:00 Tue 16/05/2023mp320230516z$md5:f165144f94927c0f1bfa2ee6e6ab7bbficdzAITAA: Am I the Agony Aunt?z$md5:5980a831360d0744c3764551be3d09c1Entertainment)	r   r   extupload_dater   	timestampseriesr   
categories)r   skipr   c                    | j                  |      }| j                  ||      }| j                  d||      }t        d|      }t	        t        j                  dd|            }t        d|      }| j                  d|dd	      }|t        ||d
      t        |d      t        |      |t	        t        j                  dd|            t        d| j                  d|dd	            t        d|      dd	S )Nzhttps://audio.camfm.co.ukcaptionz<span[^<]+<[^<]+> zcard-sectionz>Aired at ([^<]+)<zair dateFr   z - )delim).formats.z<b>[^<]+</b><br[^>]+/>r   z:<div[^>]+class="cover-art"[^>]+style="[^"]+url\(\'([^\']+)r   labelT)	r   r   rC   r;   r<   r   r   r=   was_live)r   r   _parse_html5_media_entriesr   r   r    subr%   r	   r
   r   r   r$   r   )	r&   r   
episode_idr(   audiosr@   r<   card_sectiondates	            r*   r+   zCamFMEpisodeIE._real_extract>   s   ^^C(
%%c:6001LdT^_&y$7BFF#7WEF+NDA&&';\:]b&c "64u=#F,AB*40%bff-FL&YZ !68J8JMk 9K 90 1 0A
 	
r3   Nr,   r2   r3   r*   r#   r#   ,   sA    IJ1\I%A#3?*+

 F 
r3   r#   )r    commonr   utilsr   r   r   r	   r
   r   r   r   r#   r2   r3   r*   <module>rN      s2    	 !  
- 
:)
] )
r3   