aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/facebook.py
diff options
context:
space:
mode:
authorcoletdjnz <coletdjnz@protonmail.com>2023-07-09 13:23:02 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2023-07-15 16:18:35 +0530
commit3d2623a898196640f7cc0fc8b70118ff19e6925d (patch)
treea0dc9fe53959ca673294902f7a553f55706cc5f3 /yt_dlp/extractor/facebook.py
parent227bf1a33be7b89cd7d44ad046844c4ccba104f4 (diff)
downloadhypervideo-pre-3d2623a898196640f7cc0fc8b70118ff19e6925d.tar.lz
hypervideo-pre-3d2623a898196640f7cc0fc8b70118ff19e6925d.tar.xz
hypervideo-pre-3d2623a898196640f7cc0fc8b70118ff19e6925d.zip
[compat, networking] Deprecate old functions (#2861)
Authored by: coletdjnz, pukkandan
Diffstat (limited to 'yt_dlp/extractor/facebook.py')
-rw-r--r--yt_dlp/extractor/facebook.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/yt_dlp/extractor/facebook.py b/yt_dlp/extractor/facebook.py
index 9d871eb28..9f4d3fb78 100644
--- a/yt_dlp/extractor/facebook.py
+++ b/yt_dlp/extractor/facebook.py
@@ -8,6 +8,8 @@ from ..compat import (
compat_str,
compat_urllib_parse_unquote,
)
+from ..networking import Request
+from ..networking.exceptions import network_exceptions
from ..utils import (
ExtractorError,
clean_html,
@@ -19,11 +21,9 @@ from ..utils import (
int_or_none,
js_to_json,
merge_dicts,
- network_exceptions,
parse_count,
parse_qs,
qualities,
- sanitized_Request,
traverse_obj,
try_get,
url_or_none,
@@ -319,7 +319,7 @@ class FacebookIE(InfoExtractor):
}
def _perform_login(self, username, password):
- login_page_req = sanitized_Request(self._LOGIN_URL)
+ login_page_req = Request(self._LOGIN_URL)
self._set_cookie('facebook.com', 'locale', 'en_US')
login_page = self._download_webpage(login_page_req, None,
note='Downloading login page',
@@ -340,8 +340,8 @@ class FacebookIE(InfoExtractor):
'timezone': '-60',
'trynum': '1',
}
- request = sanitized_Request(self._LOGIN_URL, urlencode_postdata(login_form))
- request.add_header('Content-Type', 'application/x-www-form-urlencoded')
+ request = Request(self._LOGIN_URL, urlencode_postdata(login_form))
+ request.headers['Content-Type'] = 'application/x-www-form-urlencoded'
try:
login_results = self._download_webpage(request, None,
note='Logging in', errnote='unable to fetch login page')
@@ -367,8 +367,8 @@ class FacebookIE(InfoExtractor):
'h': h,
'name_action_selected': 'dont_save',
}
- check_req = sanitized_Request(self._CHECKPOINT_URL, urlencode_postdata(check_form))
- check_req.add_header('Content-Type', 'application/x-www-form-urlencoded')
+ check_req = Request(self._CHECKPOINT_URL, urlencode_postdata(check_form))
+ check_req.headers['Content-Type'] = 'application/x-www-form-urlencoded'
check_response = self._download_webpage(check_req, None,
note='Confirming login')
if re.search(r'id="checkpointSubmitButton"', check_response) is not None: