]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/infoq.py
1 from __future__
import unicode_literals
5 from . common
import InfoExtractor
11 class InfoQIE ( InfoExtractor
):
12 _VALID_URL
= r
'https?://(?:www\.)?infoq\.com/[^/]+/(?P<id>[^/]+)$'
15 'url' : 'http://www.infoq.com/presentations/A-Few-of-My-Favorite-Python-Things' ,
16 'md5' : 'b5ca0e0a8c1fed93b0e65e48e462f9a2' ,
18 'id' : '12-jan-pythonthings' ,
20 'description' : 'Mike Pirnat presents some tips and tricks, standard libraries and third party packages that make programming in Python a richer experience.' ,
21 'title' : 'A Few of My Favorite [Python] Things' ,
25 def _real_extract ( self
, url
):
26 video_id
= self
._ match
_ id
( url
)
27 webpage
= self
._ download
_ webpage
( url
, video_id
)
29 video_title
= self
._ html
_ search
_ regex
( r
'<title>(.*?)</title>' , webpage
, 'title' )
30 video_description
= self
._ html
_ search
_ meta
( 'description' , webpage
, 'description' )
32 # The server URL is hardcoded
33 video_url
= 'rtmpe://video.infoq.com/cfx/st/'
36 encoded_id
= self
._ search
_ regex
(
37 r
"jsclassref\s*=\s*'([^']*)'" , webpage
, 'encoded id' )
38 real_id
= compat_urllib_parse
. unquote ( base64
. b64decode ( encoded_id
. encode ( 'ascii' )). decode ( 'utf-8' ))
39 playpath
= 'mp4:' + real_id
41 video_filename
= playpath
. split ( '/' )[- 1 ]
42 video_id
, extension
= video_filename
. split ( '.' )
44 http_base
= self
._ search
_ regex
(
45 r
'EXPRESSINSTALL_SWF\s*=\s*"(https?://[^/"]+/)' , webpage
,
52 'play_path' : playpath
,
55 'url' : http_base
+ real_id
,
57 self
._ sort
_ formats
( formats
)
62 'description' : video_description
,