From e7d3de675e99b1dca268960c9d49e03f5e85f506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Helebrant?= Date: Fri, 15 Dec 2017 01:37:55 +0100 Subject: [PATCH 1/2] [npo] Fix _VALID_URLS pattern, some pages now have one extra segment before ID --- youtube_dl/extractor/npo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/npo.py b/youtube_dl/extractor/npo.py index b8fe24407..71a82848d 100644 --- a/youtube_dl/extractor/npo.py +++ b/youtube_dl/extractor/npo.py @@ -38,7 +38,7 @@ class NPOIE(NPOBaseIE): npo\.nl/(?!(?:live|radio)/)(?:[^/]+/){2}| ntr\.nl/(?:[^/]+/){2,}| omroepwnl\.nl/video/fragment/[^/]+__| - (?:zapp|npo3)\.nl/(?:[^/]+/){2} + (?:zapp|npo3)\.nl/(?:[^/]+/){2,3} ) ) (?P[^/?#]+) From 92200c1b79a655ab71332ecd9e7faea20e562182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Helebrant?= Date: Fri, 15 Dec 2017 01:39:03 +0100 Subject: [PATCH 2/2] [npo] Raise an ExtractorError if the metadata server tells us the video is gone --- youtube_dl/extractor/npo.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/youtube_dl/extractor/npo.py b/youtube_dl/extractor/npo.py index 71a82848d..8538d321e 100644 --- a/youtube_dl/extractor/npo.py +++ b/youtube_dl/extractor/npo.py @@ -170,6 +170,9 @@ class NPOIE(NPOBaseIE): transform_source=strip_jsonp, ) + if 'error' in metadata and metadata['code'] == 440: + raise ExtractorError('Video gone') + # For some videos actual video id (prid) is different (e.g. for # http://www.omroepwnl.nl/video/fragment/vandaag-de-dag-verkiezingen__POMS_WNL_853698 # video id is POMS_WNL_853698 but prid is POW_00996502)