]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/wykop.py
[ie/crunchyroll] Fix stream extraction (#10005)
[yt-dlp.git] / yt_dlp / extractor / wykop.py
index 0fa6d524db3384dd7670985594e64a7c58157410..1d29cc89b4447c7c2a8ebfa4bf7bed1ada63aa1b 100644 (file)
@@ -1,7 +1,7 @@
 import json
-import urllib.error
 
 from .common import InfoExtractor
+from ..networking.exceptions import HTTPError
 from ..utils import (
     ExtractorError,
     format_field,
@@ -43,7 +43,7 @@ def _call_api(self, path, video_id, note='Downloading JSON metadata'):
             try:
                 return self._do_call_api(path, video_id, note, headers={'Authorization': f'Bearer {token}'})
             except ExtractorError as e:
-                if not retrying and isinstance(e.cause, urllib.error.HTTPError) and e.cause.code == 403:
+                if not retrying and isinstance(e.cause, HTTPError) and e.cause.status == 403:
                     token = self._get_token(True)
                     continue
                 raise