[canalplus] fix play and download
This commit is contained in:
parent
99be5d9e13
commit
e0753f9a23
2 changed files with 18 additions and 12 deletions
|
|
@ -58,7 +58,7 @@ class ChannelsPage(BasePage):
|
|||
|
||||
|
||||
class VideoPage(BasePage):
|
||||
def parse_video(self, el, video=None, quality=None):
|
||||
def parse_video(self, el, video=None):
|
||||
_id = el.find('ID').text
|
||||
if _id == '-1':
|
||||
# means the video is not found
|
||||
|
|
@ -84,16 +84,14 @@ class VideoPage(BasePage):
|
|||
video.thumbnail.url = video.thumbnail.id
|
||||
else:
|
||||
video.thumbnail = NotAvailable
|
||||
lastest_format = None
|
||||
for format in media.find('VIDEOS'):
|
||||
if format.text is None:
|
||||
continue
|
||||
if format.tag == quality:
|
||||
|
||||
if format.tag == 'HLS':
|
||||
video.ext = u'm3u8'
|
||||
video.url = unicode(format.text)
|
||||
break
|
||||
lastest_format = format
|
||||
if not video.url and lastest_format is not None:
|
||||
video.url = unicode(lastest_format.text)
|
||||
|
||||
day, month, year = map(int, infos.find('PUBLICATION').find('DATE').text.split('/'))
|
||||
hour, minute, second = map(int, infos.find('PUBLICATION').find('HEURE').text.split(':'))
|
||||
|
|
@ -116,9 +114,9 @@ class VideoPage(BasePage):
|
|||
video.date = datetime.now()
|
||||
return video
|
||||
|
||||
def get_video(self, video, quality):
|
||||
def get_video(self, video):
|
||||
_id = self.group_dict['id']
|
||||
for vid in self.document.getchildren():
|
||||
if not _id in vid.find('ID').text:
|
||||
continue
|
||||
return self.parse_video(vid, video, quality)
|
||||
return self.parse_video(vid, video)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue