aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/downloader/youtube_live_chat.py
diff options
context:
space:
mode:
authorJesus <heckyel@riseup.net>2023-09-04 01:37:13 +0800
committerJesus <heckyel@riseup.net>2023-09-04 01:37:13 +0800
commit52d97967fb3b196759c19ae40a4c63dbb2557a19 (patch)
treec49e561914d2d01f2ef022443d304728a08dac25 /yt_dlp/downloader/youtube_live_chat.py
parenta9d0affcff8d499212852d9c711112b29defe612 (diff)
parent2301b5c1b77a65abbb46b72f91e1e4666fd5d985 (diff)
downloadhypervideo-pre-52d97967fb3b196759c19ae40a4c63dbb2557a19.tar.lz
hypervideo-pre-52d97967fb3b196759c19ae40a4c63dbb2557a19.tar.xz
hypervideo-pre-52d97967fb3b196759c19ae40a4c63dbb2557a19.zip
update from upstream
Diffstat (limited to 'yt_dlp/downloader/youtube_live_chat.py')
-rw-r--r--yt_dlp/downloader/youtube_live_chat.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/yt_dlp/downloader/youtube_live_chat.py b/yt_dlp/downloader/youtube_live_chat.py
index 5928fecf0..c7a86374a 100644
--- a/yt_dlp/downloader/youtube_live_chat.py
+++ b/yt_dlp/downloader/youtube_live_chat.py
@@ -1,8 +1,8 @@
import json
import time
-import urllib.error
from .fragment import FragmentFD
+from ..networking.exceptions import HTTPError
from ..utils import (
RegexNotFoundError,
RetryManager,
@@ -10,6 +10,7 @@ from ..utils import (
int_or_none,
try_get,
)
+from ..utils.networking import HTTPHeaderDict
class YoutubeLiveChatFD(FragmentFD):
@@ -37,10 +38,7 @@ class YoutubeLiveChatFD(FragmentFD):
start_time = int(time.time() * 1000)
def dl_fragment(url, data=None, headers=None):
- http_headers = info_dict.get('http_headers', {})
- if headers:
- http_headers = http_headers.copy()
- http_headers.update(headers)
+ http_headers = HTTPHeaderDict(info_dict.get('http_headers'), headers)
return self._download_fragment(ctx, url, info_dict, http_headers, data)
def parse_actions_replay(live_chat_continuation):
@@ -129,7 +127,7 @@ class YoutubeLiveChatFD(FragmentFD):
or frag_index == 1 and try_refresh_replay_beginning
or parse_actions_replay)
return (True, *func(live_chat_continuation))
- except urllib.error.HTTPError as err:
+ except HTTPError as err:
retry.error = err
continue
return False, None, None, None