4 from .common
import InfoExtractor
5 from ..utils
import float_or_none
8 class CamtasiaEmbedIE(InfoExtractor
):
12 'url': 'http://www.ll.mit.edu/workshops/education/videocourses/antennas/lecture1/video/',
14 'md5': '0c5e352edabf715d762b0ad4e6d9ee67',
16 'id': 'Fenn-AA_PA_Radar_Course_Lecture_1c_Final',
17 'title': 'Fenn-AA_PA_Radar_Course_Lecture_1c_Final - video1',
22 'md5': '10e4bb3aaca9fd630e273ff92d9f3c63',
24 'id': 'Fenn-AA_PA_Radar_Course_Lecture_1c_Final_PIP',
25 'title': 'Fenn-AA_PA_Radar_Course_Lecture_1c_Final - pip',
31 'title': 'Fenn-AA_PA_Radar_Course_Lecture_1c_Final',
33 'skip': 'webpage dead',
38 def _extract_from_webpage(self
, url
, webpage
):
39 camtasia_cfg
= self
._search
_regex
(
40 r
'fo\.addVariable\(\s*"csConfigFile",\s*"([^"]+)"\s*\);',
41 webpage
, 'camtasia configuration file', default
=None)
42 if camtasia_cfg
is None:
45 title
= self
._html
_search
_meta
('DC.title', webpage
, fatal
=True)
47 camtasia_url
= urllib
.parse
.urljoin(url
, camtasia_cfg
)
48 camtasia_cfg
= self
._download
_xml
(
49 camtasia_url
, self
._generic
_id
(url
),
50 note
='Downloading camtasia configuration',
51 errnote
='Failed to download camtasia configuration')
52 fileset_node
= camtasia_cfg
.find('./playlist/array/fileset')
55 for n
in fileset_node
.getchildren():
56 url_n
= n
.find('./uri')
61 'id': os
.path
.splitext(url_n
.text
.rpartition('/')[2])[0],
62 'title': f
'{title} - {n.tag}',
63 'url': urllib
.parse
.urljoin(url
, url_n
.text
),
64 'duration': float_or_none(n
.find('./duration').text
),