U
    $Pfh                     @   s@   d dl mZ d dlZddlmZ ddlmZ G dd deZdS )	    )unicode_literalsN   )InfoExtractor   )ExtractorErrorc                   @   s>   e Zd ZdZdZdZdddddd	d
dddgZdd ZdS )	TinyPicIEZtinypicztinypic.com videoszBhttps?://(?:.+?\.)?tinypic\.com/player\.php\?v=(?P<id>[^&]+)&s=\d+z:http://tinypic.com/player.php?v=6xw7tc%3E&s=5#.UtqZmbRFCM8Z 609b74432465364e72727ebc6203f044Z6xw7tcZflvzshadow phenomenon weird)idexttitle)urlmd5Z	info_dictz-http://de.tinypic.com/player.php?v=dy90yh&s=8T)r   Zonly_matchingc                 C   s   t | j|}|d}| ||d}t d|}|d krJtd| dd|d}|d}d	}| d
|d}||r|d t	|  nd}	d||f }
d||f }||
||	dS )Nr   zDownloading pagezi(?m)fo\.addVariable\("file",\s"(?P<fileid>[\da-z]+)"\);\n\s+fo\.addVariable\("s",\s"(?P<serverid>\d+)"\);zVideo %s does not existT)expectedZfileidZserveridzL, Video, images, photos, videos, myspace, ebay, video hosting, photo hostingkeywordsr
    zhttp://v%s.tinypic.com/%s.flvz http://v%s.tinypic.com/%s_th.jpg)r   r   	thumbnailr
   )
rematch
_VALID_URLgroupZ_download_webpagesearchr   Z_html_search_metaendswithlen)selfr   ZmobjZvideo_idZwebpageZfile_idZ	server_idZKEYWORDS_SUFFIXr   r
   Z	video_urlr    r   @/tmp/pip-unpacked-wheel-7zdooeg3/youtube_dl/extractor/tinypic.py_real_extract   s(    


 zTinyPicIE._real_extractN)__name__
__module____qualname__ZIE_NAMEZIE_DESCr   Z_TESTSr   r   r   r   r   r   	   s   
r   )
__future__r   r   commonr   utilsr   r   r   r   r   r   <module>   s   