Compare commits

...

6 Commits

Author SHA1 Message Date
Jia Rong
ba5329111e
Merge c950d57de684b3ab6613960565ccf4189221b9f1 into da7223d4aa42ff9fc680b0951d043dd03cec2d30 2025-03-22 07:00:56 +08:00
fourjr
c950d57de6 [channelnewsasia] follow conventions 2020-11-22 18:04:45 +08:00
fourjr
59e9536b98 [channelnewsasia] fix tests, more relaxed regex 2020-11-22 18:03:12 +08:00
fourjr
357a506c20 [ChannelNewsAsia] follow conventions 2020-11-22 00:03:40 +08:00
fourjr
6ee229b4f1 [ChannelNewsAsia] add fallback 2020-11-22 00:02:27 +08:00
fourjr
9aeb231113 [ChannelNewsAsia] Add new extractor 2020-11-21 23:01:32 +08:00
2 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,43 @@
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class ChannelNewsAsiaIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?channelnewsasia\.com/(?:(?:-|\w|\d)+)/(?:(?:-|\w|\d)+)/(?P<id>(?:-|\w|\d)+)'
_TESTS = [{
'url': 'https://www.channelnewsasia.com/news/video-on-demand/wizards-of-tech/wizards-of-tech-body-13515106',
'md5': 'ed9ed143052f0da3ee8a8fa59ba16870',
'info_dict': {
'id': 'w0ZWRzajE6qDPXDb7DSeaOCJ3bJ3GDqC',
'ext': 'mp4',
'title': 'Wizards Of Tech_2020_0_1_Body',
'description': 'md5:b3882dd00e329e623a179465de9f5478',
},
}, {
'url': 'https://www.channelnewsasia.com/news/asia/removing-the-negative-influences-of-religion-in-tibet-video-13604084',
'md5': 'ed846cfca037823fa6d3d0d7af8a4e8f',
'info_dict': {
'id': 'ljZjd0ajE6NNMhVJ3Gb-QfL1l0p-qW6-',
'ext': 'mp4',
'title': "Removing the 'negative influences of religion' in Tibet | Video",
'description': 'md5:777989926133319de6f6501372175fbf',
},
}]
def _real_extract(self, url):
display_id = self._match_id(url)
webpage = self._download_webpage(url, display_id)
ooyala_id = (
self._search_regex(
r'id="ooyala-\d+-((?:\d|\w|-)+)--\d+', webpage, 'ooyala id',
default=None, fatal=False)
or self._search_regex(
r'video-asset-id="((?:\d|\w|-)+)', webpage, 'ooyala id',
default=None, fatal=False))
return self.url_result(
'ooyala:' + ooyala_id, 'Ooyala', ooyala_id)

View File

@ -213,6 +213,7 @@ from .cctv import CCTVIE
from .cda import CDAIE
from .ceskatelevize import CeskaTelevizeIE
from .channel9 import Channel9IE
from .channelnewsasia import ChannelNewsAsiaIE
from .charlierose import CharlieRoseIE
from .chaturbate import ChaturbateIE
from .chilloutzone import ChilloutzoneIE