warp-beacon 2.6.80__py3-none-any.whl → 2.6.81__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- __version__ = "2.6.80"
1
+ __version__ = "2.6.81"
2
2
 
@@ -14,6 +14,28 @@ class WBClient(Client):
14
14
  def __init__(self) -> None:
15
15
  super().__init__()
16
16
  self.progress_callback = None
17
+ self.session = requests.Session()
18
+ # may be I should remove '"Sec-Fetch-*", "Upgrade-Insecure-Requests", "DNT"' ?
19
+ self.session.headers.update({
20
+ "User-Agent": (
21
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
22
+ "(KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"
23
+ ),
24
+ "Accept": (
25
+ "text/html,application/xhtml+xml,application/xml;"
26
+ "q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8"
27
+ ),
28
+ "Accept-Language": "en-US,en;q=0.9",
29
+ "Accept-Encoding": "gzip, deflate, br",
30
+ "Referer": "https://www.instagram.com/",
31
+ "Connection": "keep-alive",
32
+ "Sec-Fetch-Site": "same-origin",
33
+ "Sec-Fetch-Mode": "navigate",
34
+ "Sec-Fetch-User": "?1",
35
+ "Sec-Fetch-Dest": "document",
36
+ "Upgrade-Insecure-Requests": "1",
37
+ "DNT": "1",
38
+ })
17
39
 
18
40
  def set_progress_callback(self, callback: Callable[[int | None, int, Path], None]) -> None:
19
41
  if not callback or not callable(callback):
@@ -27,7 +49,15 @@ class WBClient(Client):
27
49
 
28
50
  logging.info("Downloading video from '%s' to '%s'", url, path)
29
51
 
30
- response = requests.get(url, stream=True, timeout=self.request_timeout)
52
+ prepared = self.session.prepare_request(requests.Request("GET", url))
53
+ logging.info("Prepared headers: %s", prepared.headers)
54
+ response = self.session.send(
55
+ prepared,
56
+ stream=True,
57
+ verify=False,
58
+ proxies=self.public.proxies,
59
+ timeout=self.request_timeout
60
+ )
31
61
  response.raise_for_status()
32
62
  logging.info("Response headers: %s", response.headers)
33
63
 
@@ -69,8 +99,17 @@ class WBClient(Client):
69
99
  path = Path(folder) / filename
70
100
 
71
101
  logging.info("Downloading photo from '%s' to '%s'", url, path)
72
-
73
- response = requests.get(url, stream=True, timeout=self.request_timeout)
102
+ logging.info("[Downloader] Using proxies: %s", self.public.proxies)
103
+
104
+ prepared = self.session.prepare_request(requests.Request("GET", url))
105
+ logging.info("Prepared headers: %s", prepared.headers)
106
+ response = self.session.send(
107
+ prepared,
108
+ stream=True,
109
+ verify=False,
110
+ proxies=self.public.proxies,
111
+ timeout=self.request_timeout
112
+ )
74
113
  response.raise_for_status()
75
114
  logging.info("Response headers: %s", response.headers)
76
115
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: warp_beacon
3
- Version: 2.6.80
3
+ Version: 2.6.81
4
4
  Summary: Telegram bot for expanding external media links
5
5
  Home-page: https://github.com/sb0y/warp_beacon
6
6
  Author: Andrey Bagrintsev
@@ -4,7 +4,7 @@ var/warp_beacon/accounts.json,sha256=OsXdncs6h88xrF_AP6_WDCK1waGBn9SR-uYdIeK37GM
4
4
  var/warp_beacon/placeholder.gif,sha256=cE5CGJVaop4Sx21zx6j4AyoHU0ncmvQuS2o6hJfEH88,6064
5
5
  var/warp_beacon/proxies.json,sha256=VnjlQDXumOEq72ZFjbh6IqHS1TEHqn8HPYAZqWCeSIA,95
6
6
  warp_beacon/__init__.py,sha256=_rThNODmz0nDp_n4mWo_HKaNFE5jk1_7cRhHyYaencI,163
7
- warp_beacon/__version__.py,sha256=kvDm0WiNzfBEEx2MfO-Lv3MLK6uB47vcVOP4hBiaBig,24
7
+ warp_beacon/__version__.py,sha256=ZFc8LcoqLT957m_J02UFSecV7Rp6MYYc1odhA3gNNHo,24
8
8
  warp_beacon/warp_beacon.py,sha256=ED43vNzdjDUJ_9qLCbri0bjWLWEJ69BENGj9i7G6AvM,342
9
9
  warp_beacon/yt_auth.py,sha256=GUTKqYr_tzDC-07Lx_ahWXSag8EyLxXBUnQbDBIkEmk,6022
10
10
  warp_beacon/compress/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -32,7 +32,7 @@ warp_beacon/scraper/utils.py,sha256=xJfCVhiLjVPoFVupE10sTzX7UpgNWbx2EeYIsoYXGDk,
32
32
  warp_beacon/scraper/instagram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
33
  warp_beacon/scraper/instagram/captcha.py,sha256=9UYziuqB3Tsat_ET6ex-cnZDbi6yCnsXHSpmE8MuUHk,4651
34
34
  warp_beacon/scraper/instagram/instagram.py,sha256=3KhxVQSL3lzovu9hjMA83sCv87u4TTDMfDQrxogoWak,17179
35
- warp_beacon/scraper/instagram/wb_instagrapi.py,sha256=iRxF4Jacmw4WprpR1Y-XztyKLjuOV22KhpevR1lkdeU,3170
35
+ warp_beacon/scraper/instagram/wb_instagrapi.py,sha256=LCIHkLm8w6cc4_RNPcpGUooP4tJEbSffHic6kIehhy4,4416
36
36
  warp_beacon/scraper/youtube/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
37
  warp_beacon/scraper/youtube/abstract.py,sha256=K2ovycq1lkx0a2R1FddO3B0IcaVsVzni_fdXzajGdwg,13134
38
38
  warp_beacon/scraper/youtube/music.py,sha256=5AeSBQyUgVCJT2hoBCV2WvlyuV9US09SYJhmBG_P9F8,2755
@@ -52,9 +52,9 @@ warp_beacon/telegram/progress_file_reader.py,sha256=e3equyNKlKs764AD-iE9QRsh3YDH
52
52
  warp_beacon/telegram/types.py,sha256=Kvdng6uCF1HRoqQgGW1ZYYPJoVuYkFb-LDvMBbW5Hjk,89
53
53
  warp_beacon/telegram/utils.py,sha256=1Lq67aRylVJzbwSyvAgjPAGjJZFATkICvAj3TJGuJiM,4635
54
54
  warp_beacon/uploader/__init__.py,sha256=j3qcuKhpchseZLGzSsSiogqe6WdMbkK8d3I-ConhNRs,5687
55
- warp_beacon-2.6.80.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
56
- warp_beacon-2.6.80.dist-info/METADATA,sha256=luqdgCcB6ROKB67zALrZiyfCSXDJdqE5dvMcxZ38lxA,22706
57
- warp_beacon-2.6.80.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
58
- warp_beacon-2.6.80.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
59
- warp_beacon-2.6.80.dist-info/top_level.txt,sha256=5YQRN46STNg81V_3jdzZ6bftkMxhe1hTPSFvJugDu84,1405
60
- warp_beacon-2.6.80.dist-info/RECORD,,
55
+ warp_beacon-2.6.81.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
56
+ warp_beacon-2.6.81.dist-info/METADATA,sha256=2IjtZzvVVC1hSJKpE4nNeZxLzcHXIzVgvEctHklZJm8,22706
57
+ warp_beacon-2.6.81.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
58
+ warp_beacon-2.6.81.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
59
+ warp_beacon-2.6.81.dist-info/top_level.txt,sha256=5YQRN46STNg81V_3jdzZ6bftkMxhe1hTPSFvJugDu84,1405
60
+ warp_beacon-2.6.81.dist-info/RECORD,,