]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/dotsub.py 
   1  from  __future__ 
import  unicode_literals
   6  from  . common 
import  InfoExtractor
   9  class  DotsubIE ( InfoExtractor
):   10      _VALID_URL 
=  r
'http://(?:www\.)?dotsub\.com/view/(?P<id>[^/]+)'   12          'url' :  'http://dotsub.com/view/aed3b8b2-1889-4df5-ae63-ad85f5572f27' ,   13          'md5' :  '0914d4d69605090f623b7ac329fea66e' ,   15              'id' :  'aed3b8b2-1889-4df5-ae63-ad85f5572f27' ,   17              'title' :  'Pyramids of Waste (2010), AKA The Lightbulb Conspiracy - Planned obsolescence documentary' ,   18              'uploader' :  '4v4l0n42' ,   19              'description' :  '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' ,   20              'thumbnail' :  'http://dotsub.com/media/aed3b8b2-1889-4df5-ae63-ad85f5572f27/p' ,   21              'upload_date' :  '20101213' ,   25      def  _real_extract ( self
,  url
):   26          mobj 
=  re
. match ( self
._ VALID
_U RL
,  url
)   27          video_id 
=  mobj
. group ( 'id' )   28          info_url 
=  "https://dotsub.com/api/media/ %s /metadata"  %  video_id
  29          info 
=  self
._ download
_ json
( info_url
,  video_id
)   30          date 
=  time
. gmtime ( info
[ 'dateCreated' ]/ 1000 )  # The timestamp is in miliseconds   34              'url' :  info
[ 'mediaURI' ],   36              'title' :  info
[ 'title' ],   37              'thumbnail' :  info
[ 'screenshotURI' ],   38              'description' :  info
[ 'description' ],   39              'uploader' :  info
[ 'user' ],   40              'view_count' :  info
[ 'numberOfViews' ],   41              'upload_date' :  ' %0 4i %0 2i %0 2i'  % ( date
. tm_year
,  date
. tm_mon
,  date
. tm_mday
),