]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/pyvideo.py
33054591b755b383eb0d216623b99d308073c64d
4 from .common
import InfoExtractor
7 class PyvideoIE(InfoExtractor
):
8 _VALID_URL
= r
'(?:http://)?(?:www\.)?pyvideo\.org/video/(?P<id>\d+)/(.*)'
10 u
'url': u
'http://pyvideo.org/video/1737/become-a-logging-expert-in-30-minutes',
11 u
'file': u
'24_4WWkSmNo.mp4',
12 u
'md5': u
'de317418c8bc76b1fd8633e4f32acbc6',
14 u
"title": u
"Become a logging expert in 30 minutes",
15 u
"description": u
"md5:9665350d466c67fb5b1598de379021f7",
16 u
"upload_date": u
"20130320",
17 u
"uploader": u
"NextDayVideo",
18 u
"uploader_id": u
"NextDayVideo",
20 u
'add_ie': ['Youtube'],
23 u
'url': u
'http://pyvideo.org/video/2542/gloriajw-spotifywitherikbernhardsson182m4v',
24 u
'md5': u
'5fe1c7e0a8aa5570330784c847ff6d12',
28 u
'title': u
'Gloriajw-SpotifyWithErikBernhardsson182',
33 def _real_extract(self
, url
):
34 mobj
= re
.match(self
._VALID
_URL
, url
)
35 video_id
= mobj
.group('id')
36 webpage
= self
._download
_webpage
(url
, video_id
)
37 m_youtube
= re
.search(r
'(https?://www\.youtube\.com/watch\?v=.*)', webpage
)
39 if m_youtube
is not None:
40 return self
.url_result(m_youtube
.group(1), 'Youtube')
42 title
= self
._html
_search
_regex
(r
'<div class="section">.*?<h3>([^>]+?)</h3>',
43 webpage
, u
'title', flags
=re
.DOTALL
)
44 video_url
= self
._search
_regex
([r
'<source src="(.*?)"',
45 r
'<dt>Download</dt>.*?<a href="(.+?)"'],
46 webpage
, u
'video url', flags
=re
.DOTALL
)
49 'title': os
.path
.splitext(title
)[0],