]>
 
 
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/dotsub.py 
 
 
 
 
 
 
 
 
   5  from  . common 
import  InfoExtractor
 
   8  class  DotsubIE ( InfoExtractor
):  
   9      _VALID_URL 
=  r
'(?:http://)?(?:www\.)?dotsub\.com/view/([^/]+)'  
  11          u
'url' :  u
'http://dotsub.com/view/aed3b8b2-1889-4df5-ae63-ad85f5572f27' ,  
  12          u
'file' :  u
'aed3b8b2-1889-4df5-ae63-ad85f5572f27.flv' ,  
  13          u
'md5' :  u
'0914d4d69605090f623b7ac329fea66e' ,  
  15              u
"title" :  u
"Pyramids of Waste (2010), AKA The Lightbulb Conspiracy - Planned obsolescence documentary" ,  
  16              u
"uploader" :  u
"4v4l0n42" ,  
  17              u
'description' :  u
'Pyramids of Waste (2010) also known as "The lightbulb conspiracy" is a documentary about how our economic system based on consumerism  and planned obsolescence is breaking our planet down. \r\n\r\n Solutions to this can be found at: \r\n http://robotswillstealyourjob.com \r\n http://www.federicopistono.org \r\n\r\n http://opensourceecology.org \r\n http://thezeitgeistmovement.com' ,  
  18              u
'thumbnail' :  u
'http://dotsub.com/media/aed3b8b2-1889-4df5-ae63-ad85f5572f27/p' ,  
  19              u
'upload_date' :  u
'20101213' ,  
  23      def  _real_extract ( self
,  url
):  
  24          mobj 
=  re
. match ( self
._ VALID
_U RL
,  url
)  
  25          video_id 
=  mobj
. group ( 1 )  
  26          info_url 
=  "https://dotsub.com/api/media/ %s /metadata"  %(video_id)  
  27          webpage 
=  self
._ download
_ webpage
( info_url
,  video_id
)  
  28          info 
=  json
. loads ( webpage
)  
  29          date 
=  time
. gmtime ( info
[ 'dateCreated' ]/ 1000 )  # The timestamp is in miliseconds  
  33              'url' :          info
[ 'mediaURI' ],  
  35              'title' :        info
[ 'title' ],  
  36              'thumbnail' :    info
[ 'screenshotURI' ],  
  37              'description' :  info
[ 'description' ],  
  38              'uploader' :     info
[ 'user' ],  
  39              'view_count' :   info
[ 'numberOfViews' ],  
  40              'upload_date' :  u
' %0 4i %0 2i %0 2i'  % ( date
. tm_year
,  date
. tm_mon
,  date
. tm_mday
),