mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-09-26 08:40:12 +00:00
[compat, networking] Deprecate old functions (#2861)
Authored by: coletdjnz, pukkandan
This commit is contained in:
@@ -2,11 +2,8 @@ import json
|
||||
import random
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..compat import (
|
||||
compat_b64decode,
|
||||
compat_HTTPError,
|
||||
compat_str,
|
||||
)
|
||||
from ..compat import compat_b64decode, compat_str
|
||||
from ..networking.exceptions import HTTPError
|
||||
from ..utils import (
|
||||
clean_html,
|
||||
ExtractorError,
|
||||
@@ -107,7 +104,7 @@ class LinuxAcademyIE(InfoExtractor):
|
||||
'sso': 'true',
|
||||
})
|
||||
|
||||
login_state_url = urlh.geturl()
|
||||
login_state_url = urlh.url
|
||||
|
||||
try:
|
||||
login_page = self._download_webpage(
|
||||
@@ -119,8 +116,8 @@ class LinuxAcademyIE(InfoExtractor):
|
||||
'Referer': login_state_url,
|
||||
})
|
||||
except ExtractorError as e:
|
||||
if isinstance(e.cause, compat_HTTPError) and e.cause.code == 401:
|
||||
error = self._parse_json(e.cause.read(), None)
|
||||
if isinstance(e.cause, HTTPError) and e.cause.status == 401:
|
||||
error = self._parse_json(e.cause.response.read(), None)
|
||||
message = error.get('description') or error['code']
|
||||
raise ExtractorError(
|
||||
'%s said: %s' % (self.IE_NAME, message), expected=True)
|
||||
@@ -137,7 +134,7 @@ class LinuxAcademyIE(InfoExtractor):
|
||||
})
|
||||
|
||||
access_token = self._search_regex(
|
||||
r'access_token=([^=&]+)', urlh.geturl(),
|
||||
r'access_token=([^=&]+)', urlh.url,
|
||||
'access token', default=None)
|
||||
if not access_token:
|
||||
access_token = self._parse_json(
|
||||
|
Reference in New Issue
Block a user