warp-beacon 2.6.23__py3-none-any.whl → 2.6.24__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.23"
1
+ __version__ = "2.6.24"
2
2
 
@@ -102,7 +102,6 @@ class AsyncDownloader(object):
102
102
  try:
103
103
  job: DownloadJob = None
104
104
  actor = None
105
- proxy = None
106
105
  try:
107
106
  job = self.job_queue.get()
108
107
  if job is self.__JOE_BIDEN_WAKEUP:
@@ -124,10 +123,13 @@ class AsyncDownloader(object):
124
123
  time.sleep(2)
125
124
  self.job_queue.put(job)
126
125
  continue
126
+ last_proxy = selector.get_last_proxy()
127
127
  selector.set_module(job.job_origin)
128
128
  # use same proxy as in content request before
129
+ proxy = None
129
130
  if job.scroll_content:
130
131
  proxy = last_proxy
132
+ logging.info("Chosen last proxy '%s'", proxy)
131
133
  else:
132
134
  proxy = selector.get_current_proxy()
133
135
  if job.job_origin is Origin.INSTAGRAM:
@@ -69,6 +69,9 @@ class AccountSelector(object):
69
69
 
70
70
  def get_current_proxy(self) -> Optional[dict]:
71
71
  return self.current_proxy
72
+
73
+ def get_last_proxy(self) -> Optional[dict]:
74
+ return self.accounts_meta_data.get("last_proxy", None)
72
75
 
73
76
  def get_proxy_list(self) -> List[dict]:
74
77
  matched_proxy = []
@@ -96,7 +99,7 @@ class AccountSelector(object):
96
99
  if len(matched_proxy) > 1:
97
100
  random.seed(random.seed(time.time_ns() ^ int.from_bytes(os.urandom(len(matched_proxy)), "big")))
98
101
  # ensure new proxy in case if previous account required captcha
99
- last_proxy = self.accounts_meta_data.get("last_proxy", None)
102
+ last_proxy = self.get_last_proxy()
100
103
  if last_proxy and last_proxy in matched_proxy:
101
104
  matched_proxy.remove(last_proxy)
102
105
  prox_choice = random.choice(matched_proxy)
@@ -119,7 +122,8 @@ class AccountSelector(object):
119
122
  if matched_proxies:
120
123
  lit = cycle(matched_proxies)
121
124
  proxy = next(lit)
122
- if proxy.get("dsn", {}) == self.accounts_meta_data["last_proxy"].get("dsn", {}):
125
+ last_proxy = self.get_last_proxy()
126
+ if last_proxy and proxy.get("dsn", "") == last_proxy.get("dsn", ""):
123
127
  proxy = next(lit)
124
128
  self.current_proxy = proxy
125
129
  self.accounts_meta_data["last_proxy"] = proxy
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: warp_beacon
3
- Version: 2.6.23
3
+ Version: 2.6.24
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=ny-9sEnmaYm9pWjoo1nCboT1QGUwfRNtaPGzXpayuRY,24
7
+ warp_beacon/__version__.py,sha256=v0gwqgQQ8MnnV1S1hH_jAgoX5Ibn3x8wiYEEwRqyMGI,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
@@ -22,9 +22,9 @@ warp_beacon/mediainfo/video.py,sha256=UBZrhTN5IDI-aYu6tsJEILo9nFkjHhkldGVFmvV7tE
22
22
  warp_beacon/scheduler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
23
  warp_beacon/scheduler/instagram_human.py,sha256=oVkOdRTgfD9SpUrXmOvdhwjb4hOyAOihKw4oS_GDFnU,7381
24
24
  warp_beacon/scheduler/scheduler.py,sha256=9OCh7Ta4wY_aTHGAOOZmaKXg56Ftx1N_aV1g6E3ZLKA,4941
25
- warp_beacon/scraper/__init__.py,sha256=se7-CKxzmMtJKqPhRVYly44X_E7tqfhFINkxtlS6FD4,19373
25
+ warp_beacon/scraper/__init__.py,sha256=tf_G1uaemInrQdVjgl8UN8wnoOuJR7O875VSAb9yEM0,19476
26
26
  warp_beacon/scraper/abstract.py,sha256=HZCglECO13XN3Yjvgt6n9JirxZ1A-8tsE8RudihC4HE,3004
27
- warp_beacon/scraper/account_selector.py,sha256=wm8XO020QSvJO43TG7G06a17G0lFtNdx17V8mC8vKbs,7783
27
+ warp_beacon/scraper/account_selector.py,sha256=nFqN-fPWxx7H7tOcdweZpGuv2TVN9isnziqb-HXsSmc,7888
28
28
  warp_beacon/scraper/exceptions.py,sha256=EKwoF0oH2xZWbNU-v8DOaWK5skKwa3s1yTIBdlcfMpc,1452
29
29
  warp_beacon/scraper/fail_handler.py,sha256=zcPK3ZVEsu6JmHYcWP7L3naTRK3gWFVRkpP84VBOtJs,964
30
30
  warp_beacon/scraper/link_resolver.py,sha256=Rc9ZuMyOo3iPywDHwjngy-WRQ2SXhJwxcg-5ripx7tM,2447
@@ -45,9 +45,9 @@ warp_beacon/telegram/handlers.py,sha256=uvR6TPHSqdSxigp3wR-ewiE6t3TvVcbVLVcYGwkg
45
45
  warp_beacon/telegram/placeholder_message.py,sha256=wN9-BRiyrtHG-EvXtZkGJHt2CX71munQ57ITttjt0mw,6400
46
46
  warp_beacon/telegram/utils.py,sha256=1Lq67aRylVJzbwSyvAgjPAGjJZFATkICvAj3TJGuJiM,4635
47
47
  warp_beacon/uploader/__init__.py,sha256=j3qcuKhpchseZLGzSsSiogqe6WdMbkK8d3I-ConhNRs,5687
48
- warp_beacon-2.6.23.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
49
- warp_beacon-2.6.23.dist-info/METADATA,sha256=IJTDQ2yCfuPCNjJxBVhOfT46Kv7XduVtVXle66N5Xd0,22706
50
- warp_beacon-2.6.23.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91
51
- warp_beacon-2.6.23.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
52
- warp_beacon-2.6.23.dist-info/top_level.txt,sha256=4ML0-mXsezLtRXyxQUntL_ktc5HX9npTeQWzvV8kFvA,1161
53
- warp_beacon-2.6.23.dist-info/RECORD,,
48
+ warp_beacon-2.6.24.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
49
+ warp_beacon-2.6.24.dist-info/METADATA,sha256=QW-fT-WBm_BMPzpyqTzkI2a_UlL1GH0Ba3L89s9G_9Y,22706
50
+ warp_beacon-2.6.24.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91
51
+ warp_beacon-2.6.24.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
52
+ warp_beacon-2.6.24.dist-info/top_level.txt,sha256=4ML0-mXsezLtRXyxQUntL_ktc5HX9npTeQWzvV8kFvA,1161
53
+ warp_beacon-2.6.24.dist-info/RECORD,,