U
    $Pf                     @   sP   d dl mZ d dlZddlmZ ddlmZ ddlmZm	Z	 G dd	 d	eZ
dS )
    )unicode_literalsN   )InfoExtractor   )
compat_str)int_or_noneExtractorErrorc                   @   s   e Zd ZdZdZdZdddddd	d
ddddeeedddddddgdddddddddddd d!d"eeed#d$d%d&d'd(d)gdd*dd+d,d-dd.d/d0d1d2d3d4eeed5d6d7d8gdd*dd9d:d;dd<d=d>d?d@dAdBeeedCd%dDdEd&dFdGgdd*dgZdHdI ZdJS )KVubeIEZvubezVube.comz6https?://vube\.com/(?:[^/]+/)+(?P<id>[\da-zA-Z]{10})\bz3http://vube.com/trending/William+Wei/Y8NUZ69Tf7?t=sZ e7aabe1f8f1aa826b9e4735e1f9cee42Z
Y8NUZ69Tf7Zmp4zBest Drummer Ever [HD]z$md5:2d63c4b277b85c2277761c2cf7337d71zre:^https?://.*\.jpgZWilliami<SZ20140801gA` p@ZamazingZhdzbest drummer everzwilliam weizbucket drummingzstreet drummerzepic street drumming)idexttitledescription	thumbnailuploader	timestampZupload_dateduration
like_countdislike_countcomment_count
categoriesz$Not accessible from Travis CI server)urlmd5Z	info_dictskipz6http://vube.com/Chiara+Grispo+Video+Channel/YL2qNPkqonZ db7aba89d4603dadd627e9d1973946feZ
YL2qNPkqonz%Chiara Grispo - Price Tag by Jessie Jz$md5:8ea652a1f36818352428cb5134933313z_re:^http://frame\.thestaticvube\.com/snap/[0-9x]+/102e7e63057-5ebc-4f5c-4065-6ce4ebde131f\.jpg$zChiara.GrispoiRZ20140103gRQe@popZmusicZcoverZsingingzjessie jz	price tagzchiara grispozRemoved due to DMCAzdhttp://vube.com/SerainaMusic/my-7-year-old-sister-and-i-singing-alive-by-krewella/UeBhTudbfS?t=s&n=1Z 5d4a52492d76f72712117ce6b0d98d08Z
UeBhTudbfSz6My 7 year old Sister and I singing "Alive" by Krewellaz$md5:40bcacb97796339f1690642c21d56f4az_re:^http://frame\.thestaticvube\.com/snap/[0-9x]+/102265d5a9f-0f17-4f6b-5753-adf08484ee1e\.jpg$ZSerainai<SZ20140403gCln@ZserainaZjessicaZkrewellaalivez2http://vube.com/vote/Siren+Gene/0nmsMY5vEq?n=2&t=sZ 0584fc13b50f887127d9d1007589d27fZ
0nmsMY5vEqz&Frozen - Let It Go Cover by Siren Genez<My rendition of "Let It Go" originally sung by Idina Menzel.z_re:^http://frame\.thestaticvube\.com/snap/[0-9x]+/10283ab622a-86c9-4681-51f2-30d1f65774af\.jpg$ZSireni,SZ20140322gK7k@z	let it gozidina menzelfrozenZdisneyz
siren genec                 C   s  t | j|}|d}| d| |d}|d }g }|d dg |d dg  D ]l}|d d	krhqVd
|d |f t|d t|d d}t|d }	|	r||	t|d d |	| qV| 
| |s|ddkrtddd|d }
|d}| j|ddd}|dp&|d}t|d}|d }|d}|d }|d!}|d"}d }|d kr| jd#| |d$d%d&}|d k	rt|d'}nt|}d(d) |d* D }|||
||||||||||d+S ),Nr
   z!http://vube.com/t-api/v1/video/%szDownloading video JSON	public_idmediavideoaudioZtranscoding_status	processedz.http://video.thestaticvube.com/video/%s/%s.mp4Zmedia_resolution_idZaudio_bitrate)r   ZabrZ	format_idZvideo_bitrateheight)vbrr!   ZvstZdmcaznThis video has been removed in response to a complaint received under the US Digital Millennium Copyright Act.T)expectedr   r   Zthumbnail_srczhttp:)schemeZ
user_aliasZchannelZupload_timer   Zraw_view_countZtotal_likesZtotal_hatescommentsz$http://vube.com/api/video/%s/commentzDownloading video comment JSONF)fataltotalc                 S   s   g | ]}|d  qS )text ).0tagr)   r)   =/tmp/pip-unpacked-wheel-7zdooeg3/youtube_dl/extractor/vube.py
<listcomp>   s     z(VubeIE._real_extract.<locals>.<listcomp>tags)r
   formatsr   r   r   r   r   r   
view_countr   r   r   r   )rematch
_VALID_URLgroupZ_download_jsongetintr   updateappendZ_sort_formatsr   Z_proto_relative_urlr   len)selfr   ZmobjZvideo_idr   r   r/   r   fmtr"   r   r   r   r   r   r   r0   r   r   r%   r   Zcomment_datar   r)   r)   r,   _real_extracte   s    
  $









  
zVubeIE._real_extractN)	__name__
__module____qualname__ZIE_NAMEZIE_DESCr3   r6   Z_TESTSr<   r)   r)   r)   r,   r	      s   
Qr	   )
__future__r   r1   commonr   compatr   utilsr   r   r	   r)   r)   r)   r,   <module>   s
   