aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom-Oliver Heidel <blackjack4494@web.de>2020-09-12 05:37:08 +0200
committerTom-Oliver Heidel <blackjack4494@web.de>2020-09-12 05:37:08 +0200
commit310f762636e192a065696232bb5a0f15938398b1 (patch)
treebc541cb7b14ae29cf8813a67b19407b88c4e3e3a
parent1f0a81ebb6d30f776efaf25347f86c6582d7e593 (diff)
parent37fb591c0b566d75fe49f8524944505f1c8667ec (diff)
downloadhypervideo-pre-310f762636e192a065696232bb5a0f15938398b1.tar.lz
hypervideo-pre-310f762636e192a065696232bb5a0f15938398b1.tar.xz
hypervideo-pre-310f762636e192a065696232bb5a0f15938398b1.zip
Merge branch '26564' of https://github.com/adrianheine/youtube-dl into adrianheine-26564
-rw-r--r--youtube_dlc/extractor/bitchute.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/youtube_dlc/extractor/bitchute.py b/youtube_dlc/extractor/bitchute.py
index 0c773e66e..92fc70b5a 100644
--- a/youtube_dlc/extractor/bitchute.py
+++ b/youtube_dlc/extractor/bitchute.py
@@ -6,6 +6,8 @@ import re
from .common import InfoExtractor
from ..utils import (
+ ExtractorError,
+ GeoRestrictedError,
orderedSet,
unified_strdate,
urlencode_postdata,
@@ -59,8 +61,14 @@ class BitChuteIE(InfoExtractor):
for format_url in orderedSet(format_urls)]
if not formats:
- formats = self._parse_html5_media_entries(
- url, webpage, video_id)[0]['formats']
+ entries = self._parse_html5_media_entries(
+ url, webpage, video_id)
+ if not entries:
+ error = self._html_search_regex(r'<h1 class="page-title">([^<]+)</h1>', webpage, 'error', default='Cannot find video')
+ if error == 'Video Unavailable':
+ raise GeoRestrictedError(error)
+ raise ExtractorError(error)
+ formats = entries[0]['formats']
self._check_formats(formats, video_id)
self._sort_formats(formats)