warp-beacon 2.6.16__py3-none-any.whl → 2.6.17__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.16"
1
+ __version__ = "2.6.17"
2
2
 
@@ -397,6 +397,7 @@ class AsyncDownloader(object):
397
397
 
398
398
  def stop_all(self) -> None:
399
399
  self.allow_loop.value = 0
400
+ self.acc_selector.save_ig_request_count()
400
401
  for proc in self.workers:
401
402
  if proc.is_alive():
402
403
  logging.info("stopping process #%d", proc.pid)
@@ -40,9 +40,33 @@ class AccountSelector(object):
40
40
  if proxy_file_path:
41
41
  with open(proxy_file_path, 'r', encoding="utf-8") as f:
42
42
  self.proxies = json.loads(f.read())
43
+
44
+ self.load_ig_request_count()
43
45
  else:
44
46
  raise ValueError("Accounts file not found")
45
47
 
48
+ def save_ig_request_count(self) -> None:
49
+ try:
50
+ state = {"ig_count": self.ig_request_count.value}
51
+ with open(f"{self.session_dir}/ig_request_counter.json", "w+", encoding="utf-8") as f:
52
+ f.write(json.dumps(state))
53
+ except Exception as e:
54
+ logging.error("Failed to save accounts states!")
55
+ logging.exception(e)
56
+
57
+ def load_ig_request_count(self) -> None:
58
+ try:
59
+ state = {}
60
+ filepath = f"{self.session_dir}/ig_request_counter.json"
61
+ if os.path.exists(filepath):
62
+ with open(f"{self.session_dir}/ig_request_counter.json", "r", encoding="utf-8") as f:
63
+ state = json.loads(f.read())
64
+ if state:
65
+ self.ig_request_count.value = int(state.get("ig_count", 0))
66
+ except Exception as e:
67
+ logging.error("Failed to save accounts states!")
68
+ logging.exception(e)
69
+
46
70
  def get_current_proxy(self) -> Optional[dict]:
47
71
  return self.current_proxy
48
72
 
@@ -1,12 +1,10 @@
1
- import os
2
-
3
1
  import pickle
4
2
 
3
+ import logging
4
+
5
5
  from warp_beacon.storage.mongo import DBClient
6
6
  from warp_beacon.jobs.download_job import DownloadJob
7
7
 
8
- import logging
9
-
10
8
  class FailHandler(object):
11
9
  client = None
12
10
  db = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: warp_beacon
3
- Version: 2.6.16
3
+ Version: 2.6.17
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=_HAv3oyJbZUecRNkP_7IK0YRdwc_mi9wvBZjV2lASVc,24
7
+ warp_beacon/__version__.py,sha256=a1aXAI5iMpUmb-fkAT_xmK2FejqLr_zPFFJYf9nelUY,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,11 +22,11 @@ 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=buF6rJzp8gVZvHBAXEkAL-uJjm5iQkEWnfPgwM2oH8g,6276
24
24
  warp_beacon/scheduler/scheduler.py,sha256=9OCh7Ta4wY_aTHGAOOZmaKXg56Ftx1N_aV1g6E3ZLKA,4941
25
- warp_beacon/scraper/__init__.py,sha256=RCFLxirEd-4VYg16VWhqYU6QnkVa1bqIy9auJ5YcWFE,18522
25
+ warp_beacon/scraper/__init__.py,sha256=x5z9NrK_CPXITOR9Uus3U6DvytNThvGt2yDRGlyakJo,18566
26
26
  warp_beacon/scraper/abstract.py,sha256=CiOyKCxVYWhPnOUpLAVIRNuHBftN6gmxqATdhjzkaS4,2852
27
- warp_beacon/scraper/account_selector.py,sha256=mYNxAyAJj4ie9wMMkfb7ONjvAicS8xPEfE3iIe4gCog,6965
27
+ warp_beacon/scraper/account_selector.py,sha256=wm8XO020QSvJO43TG7G06a17G0lFtNdx17V8mC8vKbs,7783
28
28
  warp_beacon/scraper/exceptions.py,sha256=EKwoF0oH2xZWbNU-v8DOaWK5skKwa3s1yTIBdlcfMpc,1452
29
- warp_beacon/scraper/fail_handler.py,sha256=_blvckfTZ4xWVancQKVRXH5ClKGwfrBxMwvXIFZh1qA,975
29
+ warp_beacon/scraper/fail_handler.py,sha256=zcPK3ZVEsu6JmHYcWP7L3naTRK3gWFVRkpP84VBOtJs,964
30
30
  warp_beacon/scraper/link_resolver.py,sha256=Rc9ZuMyOo3iPywDHwjngy-WRQ2SXhJwxcg-5ripx7tM,2447
31
31
  warp_beacon/scraper/instagram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
32
  warp_beacon/scraper/instagram/captcha.py,sha256=9UYziuqB3Tsat_ET6ex-cnZDbi6yCnsXHSpmE8MuUHk,4651
@@ -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.16.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
49
- warp_beacon-2.6.16.dist-info/METADATA,sha256=jR0xqC3nW8Qmuaan-tFBX8K1j3Toao2PyYZ6yCSkaqo,22706
50
- warp_beacon-2.6.16.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
51
- warp_beacon-2.6.16.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
52
- warp_beacon-2.6.16.dist-info/top_level.txt,sha256=4ML0-mXsezLtRXyxQUntL_ktc5HX9npTeQWzvV8kFvA,1161
53
- warp_beacon-2.6.16.dist-info/RECORD,,
48
+ warp_beacon-2.6.17.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
49
+ warp_beacon-2.6.17.dist-info/METADATA,sha256=oWESJ8WFz9XTMXake_tV2ezRui08bIGVwi9b7m3491c,22706
50
+ warp_beacon-2.6.17.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
51
+ warp_beacon-2.6.17.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
52
+ warp_beacon-2.6.17.dist-info/top_level.txt,sha256=4ML0-mXsezLtRXyxQUntL_ktc5HX9npTeQWzvV8kFvA,1161
53
+ warp_beacon-2.6.17.dist-info/RECORD,,