]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/sztvhu.py 
   1  # -*- coding: utf-8 -*-    5  from  . common 
import  InfoExtractor
   6  from  .. utils 
import  determine_ext
   9  class  SztvHuIE ( InfoExtractor
):   10      _VALID_URL 
=  r
'(?:http://)?(?:(?:www\.)?sztv\.hu|www\.tvszombathely\.hu)/(?:[^/]+)/.+-(?P<id>[0-9]+)'   12          u
'url' :  u
'http://sztv.hu/hirek/cserkeszek-nepszerusitettek-a-kornyezettudatos-eletmodot-a-savaria-teren-20130909' ,   13          u
'file' :  u
'20130909.mp4' ,   14          u
'md5' :  u
'a6df607b11fb07d0e9f2ad94613375cb' ,   16              u
"title" :  u
"Cserkészek népszerűsítették a környezettudatos életmódot a Savaria téren" ,   17              u
"description" :  u
'A zöld nap játékos ismeretterjesztő programjait a Magyar Cserkész Szövetség szervezte, akik az ország nyolc városában adják át tudásukat az érdeklődőknek. A PET...' ,   19          u
'skip' :  u
'Service temporarily disabled as of 2013-11-20'   22      def  _real_extract ( self
,  url
):   23          mobj 
=  re
. match ( self
._ VALID
_U RL
,  url
)   24          video_id 
=  mobj
. group ( 'id' )   25          webpage 
=  self
._ download
_ webpage
( url
,  video_id
)   26          video_file 
=  self
._ search
_ regex
(   27              r
'file: "...:(.*?)",' ,  webpage
,  'video file' )   28          title 
=  self
._ html
_ search
_ regex
(   29              r
'<meta name="title" content="([^"]*?) - [^-]*? - [^-]*?"' ,   30              webpage
,  'video title' )   31          description 
=  self
._ html
_ search
_ regex
(   32              r
'<meta name="description" content="([^"]*)"/>' ,   33              webpage
,  'video description' ,  fatal
= False )   34          thumbnail 
=  self
._ og
_ search
_ thumbnail
( webpage
)   36          video_url 
=  'http://media.sztv.hu/vod/'  +  video_file
  42              'ext' :  determine_ext ( video_url
),   43              'description' :  description
,   44              'thumbnail' :  thumbnail
,