aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/funimation.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/extractor/funimation.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/extractor/funimation.py')
-rw-r--r--yt_dlp/extractor/funimation.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/yt_dlp/extractor/funimation.py b/yt_dlp/extractor/funimation.py
index 18363c1b9..41de85cc6 100644
--- a/yt_dlp/extractor/funimation.py
+++ b/yt_dlp/extractor/funimation.py
@@ -3,7 +3,7 @@ import re
import string
from .common import InfoExtractor
-from ..compat import compat_HTTPError
+from ..networking.exceptions import HTTPError
from ..utils import (
ExtractorError,
determine_ext,
@@ -46,8 +46,8 @@ class FunimationBaseIE(InfoExtractor):
}))
FunimationBaseIE._TOKEN = data['token']
except ExtractorError as e:
- if isinstance(e.cause, compat_HTTPError) and e.cause.code == 401:
- error = self._parse_json(e.cause.read().decode(), None)['error']
+ if isinstance(e.cause, HTTPError) and e.cause.status == 401:
+ error = self._parse_json(e.cause.response.read().decode(), None)['error']
raise ExtractorError(error, expected=True)
raise
@@ -210,7 +210,7 @@ class FunimationIE(FunimationBaseIE):
page = self._download_json(
'https://www.funimation.com/api/showexperience/%s/' % experience_id,
display_id, headers=headers, expected_status=403, query={
- 'pinst_id': ''.join([random.choice(string.digits + string.ascii_letters) for _ in range(8)]),
+ 'pinst_id': ''.join(random.choices(string.digits + string.ascii_letters, k=8)),
}, note=f'Downloading {format_name} JSON')
sources = page.get('items') or []
if not sources: