浏览代码

[laola1tv] Improve error detection and skip an invalid test

Yen Chi Hsuan 9 年之前
父节点
当前提交
d1c4e4ba15
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      youtube_dl/extractor/laola1tv.py

+ 4 - 0
youtube_dl/extractor/laola1tv.py

@@ -63,6 +63,7 @@ class Laola1TvIE(InfoExtractor):
         'params': {
             'skip_download': True,
         },
+        'skip': 'This live stream has already finished.',
     }]
 
     def _real_extract(self, url):
@@ -74,6 +75,9 @@ class Laola1TvIE(InfoExtractor):
 
         webpage = self._download_webpage(url, display_id)
 
+        if 'Dieser Livestream ist bereits beendet.' in webpage:
+            raise ExtractorError('This live stream has already finished.', expected=True)
+
         iframe_url = self._search_regex(
             r'<iframe[^>]*?id="videoplayer"[^>]*?src="([^"]+)"',
             webpage, 'iframe url')