From 0fabdefb7eb966c1f342b95c2b09f48bdad52f9f Mon Sep 17 00:00:00 2001 From: DongXishan <100206449+xishandong@users.noreply.github.com> Date: Mon, 23 Sep 2024 20:27:25 +0900 Subject: [PATCH] =?UTF-8?q?Update=20downloader.py=EF=BC=8Cchange=20to=20tl?= =?UTF-8?q?s-client?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 进阶篇/基础综合/Instagram/downloader.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/进阶篇/基础综合/Instagram/downloader.py b/进阶篇/基础综合/Instagram/downloader.py index 7d993d0..c02b6b1 100644 --- a/进阶篇/基础综合/Instagram/downloader.py +++ b/进阶篇/基础综合/Instagram/downloader.py @@ -1,6 +1,6 @@ import time -from requests import Session +from tls_client import Session # which need login cookie # user info, not necessarily @@ -25,7 +25,7 @@ from requests import Session # "rur": "" # } cookie = { - # your login cookie + # your cookie } PARAMS = r'("app_id":\s*"[^"]+")|("claim":\s*"[^"]+")|("csrf_token":\s*"[^"]+")|(["LSD",[],{"token":\s*"[^"]+")' @@ -46,7 +46,7 @@ proxy = { class Ins: def __init__(self, cookies: dict): self.cookies = cookies - self.session = Session() + self.session = Session(client_identifier="chrome_104", random_tls_extension_order=True) self.session.proxies.update(proxy) self.headers = { 'sec-fetch-mode': 'cors',