npo.py 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. import random
  2. import re
  3. import urllib.parse
  4. from .common import InfoExtractor
  5. from ..utils import (
  6. determine_ext,
  7. int_or_none,
  8. merge_dicts,
  9. orderedSet,
  10. str_or_none,
  11. try_call,
  12. unified_timestamp,
  13. url_or_none,
  14. urlencode_postdata,
  15. )
  16. class NPOIE(InfoExtractor):
  17. IE_NAME = 'npo'
  18. IE_DESC = 'npo.nl, ntr.nl, omroepwnl.nl, zapp.nl and npo3.nl'
  19. _VALID_URL = r'''(?x)
  20. (?:
  21. npo:|
  22. https?://
  23. (?:www\.)?
  24. (?:
  25. npo\.nl/(?:[^/]+/)*|
  26. (?:ntr|npostart)\.nl/(?:[^/]+/){2,}|
  27. omroepwnl\.nl/video/fragment/[^/]+__|
  28. (?:zapp|npo3)\.nl/(?:[^/]+/){2,}
  29. )
  30. )
  31. (?P<id>[^/?#]+)
  32. '''
  33. _TESTS = [{
  34. 'url': 'http://www.npo.nl/nieuwsuur/22-06-2014/VPWON_1220719',
  35. 'md5': '4b3f9c429157ec4775f2c9cb7b911016',
  36. 'info_dict': {
  37. 'id': 'VPWON_1220719',
  38. 'ext': 'm4v',
  39. 'title': 'Nieuwsuur',
  40. 'description': 'Dagelijks tussen tien en elf: nieuws, sport en achtergronden.',
  41. 'upload_date': '20140622',
  42. },
  43. 'skip': 'Video was removed',
  44. }, {
  45. 'url': 'http://www.npo.nl/de-mega-mike-mega-thomas-show/27-02-2009/VARA_101191800',
  46. 'md5': 'da50a5787dbfc1603c4ad80f31c5120b',
  47. 'info_dict': {
  48. 'id': 'VARA_101191800',
  49. 'ext': 'm4v',
  50. 'title': 'De Mega Mike & Mega Thomas show: The best of.',
  51. 'description': 'md5:3b74c97fc9d6901d5a665aac0e5400f4',
  52. 'upload_date': '20090227',
  53. 'duration': 2400,
  54. },
  55. 'skip': 'Video was removed',
  56. }, {
  57. 'url': 'http://www.npo.nl/tegenlicht/25-02-2013/VPWON_1169289',
  58. 'md5': '1b279c0547f6b270e014c576415268c5',
  59. 'info_dict': {
  60. 'id': 'VPWON_1169289',
  61. 'ext': 'mp4',
  62. 'title': 'Zwart geld: de toekomst komt uit Afrika',
  63. 'description': 'md5:dffaf3d628a9c36f78ca48d834246261',
  64. 'upload_date': '20130225',
  65. 'duration': 3000,
  66. 'creator': 'NED2',
  67. 'series': 'Tegenlicht',
  68. 'timestamp': 1361822340,
  69. 'thumbnail': 'https://images.npo.nl/tile/1280x720/142854.jpg',
  70. 'episode': 'Zwart geld: de toekomst komt uit Afrika',
  71. 'episode_number': 18,
  72. },
  73. }, {
  74. 'url': 'http://www.npo.nl/de-nieuwe-mens-deel-1/21-07-2010/WO_VPRO_043706',
  75. 'info_dict': {
  76. 'id': 'WO_VPRO_043706',
  77. 'ext': 'mp4',
  78. 'title': 'De nieuwe mens - Deel 1',
  79. 'description': 'md5:518ae51ba1293ffb80d8d8ce90b74e4b',
  80. 'duration': 4680,
  81. 'episode': 'De nieuwe mens - Deel 1',
  82. 'thumbnail': 'https://images.npo.nl/tile/1280x720/6289.jpg',
  83. 'timestamp': 1279716057,
  84. 'series': 'De nieuwe mens - Deel 1',
  85. 'upload_date': '20100721',
  86. },
  87. 'params': {
  88. 'skip_download': True,
  89. },
  90. }, {
  91. # non asf in streams
  92. 'url': 'http://www.npo.nl/hoe-gaat-europa-verder-na-parijs/10-01-2015/WO_NOS_762771',
  93. 'info_dict': {
  94. 'id': 'WO_NOS_762771',
  95. 'ext': 'mp4',
  96. 'title': 'Hoe gaat Europa verder na Parijs?',
  97. },
  98. 'params': {
  99. 'skip_download': True,
  100. },
  101. 'skip': 'Video was removed',
  102. }, {
  103. 'url': 'http://www.ntr.nl/Aap-Poot-Pies/27/detail/Aap-poot-pies/VPWON_1233944#content',
  104. 'info_dict': {
  105. 'id': 'VPWON_1233944',
  106. 'ext': 'mp4',
  107. 'title': 'Aap, poot, pies',
  108. 'description': 'md5:4b46b1b9553b4c036a04d2a532a137e6',
  109. 'upload_date': '20150508',
  110. 'duration': 599,
  111. 'episode': 'Aap, poot, pies',
  112. 'thumbnail': 'https://images.poms.omroep.nl/image/s1280/c1280x720/608118.jpg',
  113. 'timestamp': 1431064200,
  114. 'series': 'Aap, poot, pies',
  115. },
  116. 'params': {
  117. 'skip_download': True,
  118. },
  119. }, {
  120. 'url': 'http://www.omroepwnl.nl/video/fragment/vandaag-de-dag-verkiezingen__POMS_WNL_853698',
  121. 'info_dict': {
  122. 'id': 'POW_00996502',
  123. 'ext': 'm4v',
  124. 'title': '''"Dit is wel een 'landslide'..."''',
  125. 'description': 'md5:f8d66d537dfb641380226e31ca57b8e8',
  126. 'upload_date': '20150508',
  127. 'duration': 462,
  128. },
  129. 'params': {
  130. 'skip_download': True,
  131. },
  132. 'skip': 'Video was removed',
  133. }, {
  134. # audio
  135. 'url': 'http://www.npo.nl/jouw-stad-rotterdam/29-01-2017/RBX_FUNX_6683215/RBX_FUNX_7601437',
  136. 'info_dict': {
  137. 'id': 'RBX_FUNX_6683215',
  138. 'ext': 'mp3',
  139. 'title': 'Jouw Stad Rotterdam',
  140. 'description': 'md5:db251505244f097717ec59fabc372d9f',
  141. },
  142. 'params': {
  143. 'skip_download': True,
  144. },
  145. 'skip': 'Video was removed',
  146. }, {
  147. 'url': 'http://www.zapp.nl/de-bzt-show/gemist/KN_1687547',
  148. 'only_matching': True,
  149. }, {
  150. 'url': 'http://www.zapp.nl/de-bzt-show/filmpjes/POMS_KN_7315118',
  151. 'only_matching': True,
  152. }, {
  153. 'url': 'http://www.zapp.nl/beste-vrienden-quiz/extra-video-s/WO_NTR_1067990',
  154. 'only_matching': True,
  155. }, {
  156. 'url': 'https://www.npo3.nl/3onderzoekt/16-09-2015/VPWON_1239870',
  157. 'only_matching': True,
  158. }, {
  159. # live stream
  160. 'url': 'npo:LI_NL1_4188102',
  161. 'only_matching': True,
  162. }, {
  163. 'url': 'http://www.npo.nl/radio-gaga/13-06-2017/BNN_101383373',
  164. 'only_matching': True,
  165. }, {
  166. 'url': 'https://www.zapp.nl/1803-skelterlab/instructie-video-s/740-instructievideo-s/POMS_AT_11736927',
  167. 'only_matching': True,
  168. }, {
  169. 'url': 'https://www.npostart.nl/broodje-gezond-ei/28-05-2018/KN_1698996',
  170. 'only_matching': True,
  171. }, {
  172. 'url': 'https://npo.nl/KN_1698996',
  173. 'only_matching': True,
  174. }, {
  175. 'url': 'https://www.npo3.nl/the-genius/21-11-2022/VPWON_1341105',
  176. 'info_dict': {
  177. 'id': 'VPWON_1341105',
  178. 'ext': 'mp4',
  179. 'duration': 2658,
  180. 'series': 'The Genius',
  181. 'description': 'md5:db02f1456939ca63f7c408f858044e94',
  182. 'title': 'The Genius',
  183. 'timestamp': 1669062000,
  184. 'creator': 'NED3',
  185. 'episode': 'The Genius',
  186. 'thumbnail': 'https://images.npo.nl/tile/1280x720/1827650.jpg',
  187. 'episode_number': 8,
  188. 'upload_date': '20221121',
  189. },
  190. 'params': {
  191. 'skip_download': True,
  192. },
  193. }]
  194. @classmethod
  195. def suitable(cls, url):
  196. return (False if any(ie.suitable(url)
  197. for ie in (NPOLiveIE, NPORadioIE, NPORadioFragmentIE))
  198. else super().suitable(url))
  199. def _real_extract(self, url):
  200. video_id = self._match_id(url)
  201. if urllib.parse.urlparse(url).netloc in ['www.ntr.nl', 'ntr.nl']:
  202. player = self._download_json(
  203. f'https://www.ntr.nl/ajax/player/embed/{video_id}', video_id,
  204. 'Downloading player JSON', query={
  205. 'parameters[elementId]': f'npo{random.randint(0, 999)}',
  206. 'parameters[sterReferralUrl]': url,
  207. 'parameters[autoplay]': 0,
  208. })
  209. else:
  210. self._request_webpage(
  211. 'https://www.npostart.nl/api/token', video_id,
  212. 'Downloading token', headers={
  213. 'Referer': url,
  214. 'X-Requested-With': 'XMLHttpRequest',
  215. })
  216. player = self._download_json(
  217. f'https://www.npostart.nl/player/{video_id}', video_id,
  218. 'Downloading player JSON', data=urlencode_postdata({
  219. 'autoplay': 0,
  220. 'share': 1,
  221. 'pageUrl': url,
  222. 'hasAdConsent': 0,
  223. }), headers={
  224. 'x-xsrf-token': try_call(lambda: urllib.parse.unquote(
  225. self._get_cookies('https://www.npostart.nl')['XSRF-TOKEN'].value)),
  226. })
  227. player_token = player['token']
  228. drm = False
  229. format_urls = set()
  230. formats = []
  231. for profile in ('hls', 'dash-widevine', 'dash-playready', 'smooth'):
  232. streams = self._download_json(
  233. f'https://start-player.npo.nl/video/{video_id}/streams',
  234. video_id, f'Downloading {profile} profile JSON', fatal=False,
  235. query={
  236. 'profile': profile,
  237. 'quality': 'npoplus',
  238. 'tokenId': player_token,
  239. 'streamType': 'broadcast',
  240. }, data=b'') # endpoint requires POST
  241. if not streams:
  242. continue
  243. stream = streams.get('stream')
  244. if not isinstance(stream, dict):
  245. continue
  246. stream_url = url_or_none(stream.get('src'))
  247. if not stream_url or stream_url in format_urls:
  248. continue
  249. format_urls.add(stream_url)
  250. if stream.get('protection') is not None or stream.get('keySystemOptions') is not None:
  251. drm = True
  252. continue
  253. stream_type = stream.get('type')
  254. stream_ext = determine_ext(stream_url)
  255. if stream_type == 'application/dash+xml' or stream_ext == 'mpd':
  256. formats.extend(self._extract_mpd_formats(
  257. stream_url, video_id, mpd_id='dash', fatal=False))
  258. elif stream_type == 'application/vnd.apple.mpegurl' or stream_ext == 'm3u8':
  259. formats.extend(self._extract_m3u8_formats(
  260. stream_url, video_id, ext='mp4',
  261. entry_protocol='m3u8_native', m3u8_id='hls', fatal=False))
  262. elif re.search(r'\.isml?/Manifest', stream_url):
  263. formats.extend(self._extract_ism_formats(
  264. stream_url, video_id, ism_id='mss', fatal=False))
  265. else:
  266. formats.append({
  267. 'url': stream_url,
  268. })
  269. if not formats:
  270. if not self.get_param('allow_unplayable_formats') and drm:
  271. self.report_drm(video_id)
  272. info = {
  273. 'id': video_id,
  274. 'title': video_id,
  275. 'formats': formats,
  276. }
  277. embed_url = url_or_none(player.get('embedUrl'))
  278. if embed_url:
  279. webpage = self._download_webpage(
  280. embed_url, video_id, 'Downloading embed page', fatal=False)
  281. if webpage:
  282. video = self._parse_json(
  283. self._search_regex(
  284. r'\bvideo\s*=\s*({.+?})\s*;', webpage, 'video',
  285. default='{}'), video_id)
  286. if video:
  287. title = video.get('episodeTitle')
  288. subtitles = {}
  289. subtitles_list = video.get('subtitles')
  290. if isinstance(subtitles_list, list):
  291. for cc in subtitles_list:
  292. cc_url = url_or_none(cc.get('src'))
  293. if not cc_url:
  294. continue
  295. lang = str_or_none(cc.get('language')) or 'nl'
  296. subtitles.setdefault(lang, []).append({
  297. 'url': cc_url,
  298. })
  299. return merge_dicts({
  300. 'title': title,
  301. 'description': video.get('description'),
  302. 'thumbnail': url_or_none(
  303. video.get('still_image_url') or video.get('orig_image_url')),
  304. 'duration': int_or_none(video.get('duration')),
  305. 'timestamp': unified_timestamp(video.get('broadcastDate')),
  306. 'creator': video.get('channel'),
  307. 'series': video.get('title'),
  308. 'episode': title,
  309. 'episode_number': int_or_none(video.get('episodeNumber')),
  310. 'subtitles': subtitles,
  311. }, info)
  312. return info
  313. class NPOLiveIE(InfoExtractor):
  314. IE_NAME = 'npo.nl:live'
  315. _VALID_URL = r'https?://(?:www\.)?npo(?:start)?\.nl/live(?:/(?P<id>[^/?#&]+))?'
  316. _TESTS = [{
  317. 'url': 'http://www.npo.nl/live/npo-1',
  318. 'info_dict': {
  319. 'id': 'LI_NL1_4188102',
  320. 'display_id': 'npo-1',
  321. 'ext': 'mp4',
  322. 'title': 're:^NPO 1 [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
  323. 'is_live': True,
  324. },
  325. 'params': {
  326. 'skip_download': True,
  327. },
  328. }, {
  329. 'url': 'http://www.npo.nl/live',
  330. 'only_matching': True,
  331. }, {
  332. 'url': 'https://www.npostart.nl/live/npo-1',
  333. 'only_matching': True,
  334. }]
  335. def _real_extract(self, url):
  336. display_id = self._match_id(url) or 'npo-1'
  337. webpage = self._download_webpage(url, display_id)
  338. live_id = self._search_regex(
  339. [r'media-id="([^"]+)"', r'data-prid="([^"]+)"'], webpage, 'live id')
  340. return {
  341. '_type': 'url_transparent',
  342. 'url': f'npo:{live_id}',
  343. 'ie_key': NPOIE.ie_key(),
  344. 'id': live_id,
  345. 'display_id': display_id,
  346. }
  347. class NPORadioIE(InfoExtractor):
  348. IE_NAME = 'npo.nl:radio'
  349. _VALID_URL = r'https?://(?:www\.)?npo\.nl/radio/(?P<id>[^/]+)'
  350. _TEST = {
  351. 'url': 'http://www.npo.nl/radio/radio-1',
  352. 'info_dict': {
  353. 'id': 'radio-1',
  354. 'ext': 'mp3',
  355. 'title': 're:^NPO Radio 1 [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
  356. 'is_live': True,
  357. },
  358. 'params': {
  359. 'skip_download': True,
  360. },
  361. }
  362. @classmethod
  363. def suitable(cls, url):
  364. return False if NPORadioFragmentIE.suitable(url) else super().suitable(url)
  365. @staticmethod
  366. def _html_get_attribute_regex(attribute):
  367. return rf'{attribute}\s*=\s*\'([^\']+)\''
  368. def _real_extract(self, url):
  369. video_id = self._match_id(url)
  370. webpage = self._download_webpage(url, video_id)
  371. title = self._html_search_regex(
  372. self._html_get_attribute_regex('data-channel'), webpage, 'title')
  373. stream = self._parse_json(
  374. self._html_search_regex(self._html_get_attribute_regex('data-streams'), webpage, 'data-streams'),
  375. video_id)
  376. codec = stream.get('codec')
  377. return {
  378. 'id': video_id,
  379. 'url': stream['url'],
  380. 'title': title,
  381. 'acodec': codec,
  382. 'ext': codec,
  383. 'is_live': True,
  384. }
  385. class NPORadioFragmentIE(InfoExtractor):
  386. IE_NAME = 'npo.nl:radio:fragment'
  387. _VALID_URL = r'https?://(?:www\.)?npo\.nl/radio/[^/]+/fragment/(?P<id>\d+)'
  388. _TEST = {
  389. 'url': 'http://www.npo.nl/radio/radio-5/fragment/174356',
  390. 'md5': 'dd8cc470dad764d0fdc70a9a1e2d18c2',
  391. 'info_dict': {
  392. 'id': '174356',
  393. 'ext': 'mp3',
  394. 'title': 'Jubileumconcert Willeke Alberti',
  395. },
  396. }
  397. def _real_extract(self, url):
  398. audio_id = self._match_id(url)
  399. webpage = self._download_webpage(url, audio_id)
  400. title = self._html_search_regex(
  401. rf'href="/radio/[^/]+/fragment/{audio_id}" title="([^"]+)"',
  402. webpage, 'title')
  403. audio_url = self._search_regex(
  404. r"data-streams='([^']+)'", webpage, 'audio url')
  405. return {
  406. 'id': audio_id,
  407. 'url': audio_url,
  408. 'title': title,
  409. }
  410. class NPODataMidEmbedIE(InfoExtractor): # XXX: Conventionally, base classes should end with BaseIE/InfoExtractor
  411. def _real_extract(self, url):
  412. display_id = self._match_id(url)
  413. webpage = self._download_webpage(url, display_id)
  414. video_id = self._search_regex(
  415. r'data-mid=(["\'])(?P<id>(?:(?!\1).)+)\1', webpage, 'video_id', group='id')
  416. return {
  417. '_type': 'url_transparent',
  418. 'ie_key': 'NPO',
  419. 'url': f'npo:{video_id}',
  420. 'display_id': display_id,
  421. }
  422. class SchoolTVIE(NPODataMidEmbedIE):
  423. IE_NAME = 'schooltv'
  424. _VALID_URL = r'https?://(?:www\.)?schooltv\.nl/video/(?P<id>[^/?#&]+)'
  425. _TEST = {
  426. 'url': 'http://www.schooltv.nl/video/ademhaling-de-hele-dag-haal-je-adem-maar-wat-gebeurt-er-dan-eigenlijk-in-je-lichaam/',
  427. 'info_dict': {
  428. 'id': 'WO_NTR_429477',
  429. 'display_id': 'ademhaling-de-hele-dag-haal-je-adem-maar-wat-gebeurt-er-dan-eigenlijk-in-je-lichaam',
  430. 'title': 'Ademhaling: De hele dag haal je adem. Maar wat gebeurt er dan eigenlijk in je lichaam?',
  431. 'ext': 'mp4',
  432. 'description': 'md5:abfa0ff690adb73fd0297fd033aaa631',
  433. },
  434. 'params': {
  435. # Skip because of m3u8 download
  436. 'skip_download': True,
  437. },
  438. }
  439. class HetKlokhuisIE(NPODataMidEmbedIE):
  440. IE_NAME = 'hetklokhuis'
  441. _VALID_URL = r'https?://(?:www\.)?hetklokhuis\.nl/[^/]+/\d+/(?P<id>[^/?#&]+)'
  442. _TEST = {
  443. 'url': 'http://hetklokhuis.nl/tv-uitzending/3471/Zwaartekrachtsgolven',
  444. 'info_dict': {
  445. 'id': 'VPWON_1260528',
  446. 'display_id': 'Zwaartekrachtsgolven',
  447. 'ext': 'm4v',
  448. 'title': 'Het Klokhuis: Zwaartekrachtsgolven',
  449. 'description': 'md5:c94f31fb930d76c2efa4a4a71651dd48',
  450. 'upload_date': '20170223',
  451. },
  452. 'params': {
  453. 'skip_download': True,
  454. },
  455. }
  456. class NPOPlaylistBaseIE(NPOIE): # XXX: Do not subclass from concrete IE
  457. def _real_extract(self, url):
  458. playlist_id = self._match_id(url)
  459. webpage = self._download_webpage(url, playlist_id)
  460. entries = [
  461. self.url_result(f'npo:{video_id}' if not video_id.startswith('http') else video_id)
  462. for video_id in orderedSet(re.findall(self._PLAYLIST_ENTRY_RE, webpage))
  463. ]
  464. playlist_title = self._html_search_regex(
  465. self._PLAYLIST_TITLE_RE, webpage, 'playlist title',
  466. default=None) or self._og_search_title(webpage)
  467. return self.playlist_result(entries, playlist_id, playlist_title)
  468. class VPROIE(NPOPlaylistBaseIE):
  469. IE_NAME = 'vpro'
  470. _VALID_URL = r'https?://(?:www\.)?(?:(?:tegenlicht\.)?vpro|2doc)\.nl/(?:[^/]+/)*(?P<id>[^/]+)\.html'
  471. _PLAYLIST_TITLE_RE = (r'<h1[^>]+class=["\'].*?\bmedia-platform-title\b.*?["\'][^>]*>([^<]+)',
  472. r'<h5[^>]+class=["\'].*?\bmedia-platform-subtitle\b.*?["\'][^>]*>([^<]+)')
  473. _PLAYLIST_ENTRY_RE = r'data-media-id="([^"]+)"'
  474. _TESTS = [
  475. {
  476. 'url': 'http://tegenlicht.vpro.nl/afleveringen/2012-2013/de-toekomst-komt-uit-afrika.html',
  477. 'md5': 'f8065e4e5a7824068ed3c7e783178f2c',
  478. 'info_dict': {
  479. 'id': 'VPWON_1169289',
  480. 'ext': 'm4v',
  481. 'title': 'De toekomst komt uit Afrika',
  482. 'description': 'md5:52cf4eefbc96fffcbdc06d024147abea',
  483. 'upload_date': '20130225',
  484. },
  485. 'skip': 'Video gone',
  486. },
  487. {
  488. 'url': 'http://www.vpro.nl/programmas/2doc/2015/sergio-herman.html',
  489. 'info_dict': {
  490. 'id': 'sergio-herman',
  491. 'title': 'sergio herman: fucking perfect',
  492. },
  493. 'playlist_count': 2,
  494. },
  495. {
  496. # playlist with youtube embed
  497. 'url': 'http://www.vpro.nl/programmas/2doc/2015/education-education.html',
  498. 'info_dict': {
  499. 'id': 'education-education',
  500. 'title': 'education education',
  501. },
  502. 'playlist_count': 2,
  503. },
  504. {
  505. 'url': 'http://www.2doc.nl/documentaires/series/2doc/2015/oktober/de-tegenprestatie.html',
  506. 'info_dict': {
  507. 'id': 'de-tegenprestatie',
  508. 'title': 'De Tegenprestatie',
  509. },
  510. 'playlist_count': 2,
  511. }, {
  512. 'url': 'http://www.2doc.nl/speel~VARA_101375237~mh17-het-verdriet-van-nederland~.html',
  513. 'info_dict': {
  514. 'id': 'VARA_101375237',
  515. 'ext': 'm4v',
  516. 'title': 'MH17: Het verdriet van Nederland',
  517. 'description': 'md5:09e1a37c1fdb144621e22479691a9f18',
  518. 'upload_date': '20150716',
  519. },
  520. 'params': {
  521. # Skip because of m3u8 download
  522. 'skip_download': True,
  523. },
  524. },
  525. ]
  526. class WNLIE(NPOPlaylistBaseIE):
  527. IE_NAME = 'wnl'
  528. _VALID_URL = r'https?://(?:www\.)?omroepwnl\.nl/video/detail/(?P<id>[^/]+)__\d+'
  529. _PLAYLIST_TITLE_RE = r'(?s)<h1[^>]+class="subject"[^>]*>(.+?)</h1>'
  530. _PLAYLIST_ENTRY_RE = r'<a[^>]+href="([^"]+)"[^>]+class="js-mid"[^>]*>Deel \d+'
  531. _TESTS = [{
  532. 'url': 'http://www.omroepwnl.nl/video/detail/vandaag-de-dag-6-mei__060515',
  533. 'info_dict': {
  534. 'id': 'vandaag-de-dag-6-mei',
  535. 'title': 'Vandaag de Dag 6 mei',
  536. },
  537. 'playlist_count': 4,
  538. }]
  539. class AndereTijdenIE(NPOPlaylistBaseIE):
  540. IE_NAME = 'anderetijden'
  541. _VALID_URL = r'https?://(?:www\.)?anderetijden\.nl/programma/(?:[^/]+/)+(?P<id>[^/?#&]+)'
  542. _PLAYLIST_TITLE_RE = r'(?s)<h1[^>]+class=["\'].*?\bpage-title\b.*?["\'][^>]*>(.+?)</h1>'
  543. _PLAYLIST_ENTRY_RE = r'<figure[^>]+class=["\']episode-container episode-page["\'][^>]+data-prid=["\'](.+?)["\']'
  544. _TESTS = [{
  545. 'url': 'http://anderetijden.nl/programma/1/Andere-Tijden/aflevering/676/Duitse-soldaten-over-de-Slag-bij-Arnhem',
  546. 'info_dict': {
  547. 'id': 'Duitse-soldaten-over-de-Slag-bij-Arnhem',
  548. 'title': 'Duitse soldaten over de Slag bij Arnhem',
  549. },
  550. 'playlist_count': 3,
  551. }]