warp-beacon 2.3.51__py3-none-any.whl → 2.3.52__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.3.51"
1
+ __version__ = "2.3.52"
2
2
 
@@ -121,6 +121,11 @@ class AsyncDownloader(object):
121
121
  if job.job_origin is Origin.INSTAGRAM:
122
122
  from warp_beacon.scraper.instagram.instagram import InstagramScraper
123
123
  actor = InstagramScraper(selector.get_current(), proxy)
124
+ selector.inc_ig_request_count()
125
+ if selector.get_ig_request_count() >= int(os.environ.get("IG_REQUESTS_PER_ACCOUNT", default="20")):
126
+ logging.info("The account request limit has been reached. Selecting the next account.")
127
+ selector.reset_ig_request_count()
128
+ selector.next()
124
129
  elif job.job_origin is Origin.YT_SHORTS:
125
130
  from warp_beacon.scraper.youtube.shorts import YoutubeShortsScraper
126
131
  actor = YoutubeShortsScraper(selector.get_current(), proxy)
@@ -23,6 +23,7 @@ class AccountSelector(object):
23
23
  manager = None
24
24
  account_index = {}
25
25
  current_proxy = None
26
+ ig_request_count = None
26
27
 
27
28
  def __init__(self, manager: multiprocessing.managers.SyncManager, acc_file_path: str, proxy_file_path: str=None) -> None:
28
29
  self.manager = manager
@@ -31,6 +32,7 @@ class AccountSelector(object):
31
32
  with open(acc_file_path, 'r', encoding="utf-8") as f:
32
33
  self.accounts = json.loads(f.read())
33
34
  if self.accounts:
35
+ self.ig_request_count = self.manager.Value('i', 0)
34
36
  self.__init_meta_data()
35
37
  #self.load_yt_sessions()
36
38
  for acc_type, _ in self.accounts.items():
@@ -170,4 +172,13 @@ class AccountSelector(object):
170
172
  module_name = 'youtube' if next((s for s in ("yt", "youtube", "youtu_be") if s in mod_name.value), None) else 'instagram'
171
173
  if module_name not in self.accounts:
172
174
  return 0
173
- return len(self.accounts[module_name])
175
+ return len(self.accounts[module_name])
176
+
177
+ def inc_ig_request_count(self) -> None:
178
+ self.ig_request_count.value += 1
179
+
180
+ def reset_ig_request_count(self) -> None:
181
+ self.ig_request_count.value = 0
182
+
183
+ def get_ig_request_count(self) -> int:
184
+ return self.ig_request_count.value
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: warp_beacon
3
- Version: 2.3.51
3
+ Version: 2.3.52
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=qoauBZVJH1GNZozTtQhg39aKWblw1Jo_CuPkyrihYSg,24
7
+ warp_beacon/__version__.py,sha256=N9lDdnosxoFEBTxW9ntgJbodH_TnSWwfzA2LqaATl-Y,24
8
8
  warp_beacon/warp_beacon.py,sha256=7KEtZDj-pdhtl6m-zFLsSojs1ZR4o7L0xbqtdmYPvfE,342
9
9
  warp_beacon/compress/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  warp_beacon/compress/video.py,sha256=_PDMVYCyzLYxHv1uZmmzGcG_8rjaZr7BTXsXTTy_oS4,2846
@@ -21,9 +21,9 @@ warp_beacon/mediainfo/video.py,sha256=UBZrhTN5IDI-aYu6tsJEILo9nFkjHhkldGVFmvV7tE
21
21
  warp_beacon/scheduler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  warp_beacon/scheduler/instagram_human.py,sha256=GRzryMWws4ibJZ_gPGn_Y2I2plcPIVgMWK3Yubqywa0,5020
23
23
  warp_beacon/scheduler/scheduler.py,sha256=FPSrR1Z6lWbF1aCAMU2rRYCy1w4zdZ8Q4e7YWQE-Ahk,4041
24
- warp_beacon/scraper/__init__.py,sha256=bNZI9YBKQB4UyxEjethenXjvp9g1RrWfYgOyepH4O_U,17356
24
+ warp_beacon/scraper/__init__.py,sha256=iqWDK2vzKXkd9RPGYXxQ4O-IrydOBBFR89aX50sP2Yg,17669
25
25
  warp_beacon/scraper/abstract.py,sha256=28a0aBKZpi8IKptLWdB6RuVbOkrUbrhT7LSZX7QRQtg,2725
26
- warp_beacon/scraper/account_selector.py,sha256=HSfmi5H73aWYTjDa8GErCCQpTwWtDLBw92Q-I8TZilg,6282
26
+ warp_beacon/scraper/account_selector.py,sha256=TzAh4fQigsRcS2AomAMvlms8sH5RKKbPT20LJemWGtU,6596
27
27
  warp_beacon/scraper/exceptions.py,sha256=L4UCZqDOLKu5-TPUcTErIbNDLrAQJghkMaPqzTfsm1g,1376
28
28
  warp_beacon/scraper/fail_handler.py,sha256=_blvckfTZ4xWVancQKVRXH5ClKGwfrBxMwvXIFZh1qA,975
29
29
  warp_beacon/scraper/link_resolver.py,sha256=Rc9ZuMyOo3iPywDHwjngy-WRQ2SXhJwxcg-5ripx7tM,2447
@@ -43,9 +43,9 @@ warp_beacon/telegram/handlers.py,sha256=XXIfdV_RCj7tyZMPXchuKmGoDdweOaR08ADDaBPW
43
43
  warp_beacon/telegram/placeholder_message.py,sha256=wN9-BRiyrtHG-EvXtZkGJHt2CX71munQ57ITttjt0mw,6400
44
44
  warp_beacon/telegram/utils.py,sha256=9uebX53G16mV7ER7WgfdWBLFHHw14S8HBt9URrIskg0,4440
45
45
  warp_beacon/uploader/__init__.py,sha256=E9rlZIf7xlQz6MutMOwJ8S5Vm2uheR5nv23Kv8duRQg,5427
46
- warp_beacon-2.3.51.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
47
- warp_beacon-2.3.51.dist-info/METADATA,sha256=CMn79Q5lJ-opcZwsBPfWIHf3-Zll4vWJAXERZq518t8,22626
48
- warp_beacon-2.3.51.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
49
- warp_beacon-2.3.51.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
50
- warp_beacon-2.3.51.dist-info/top_level.txt,sha256=qGjHVVfyf6lTmbdSA-fQq0rHS1YVS4HoJT3rag5xgPE,1141
51
- warp_beacon-2.3.51.dist-info/RECORD,,
46
+ warp_beacon-2.3.52.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
47
+ warp_beacon-2.3.52.dist-info/METADATA,sha256=l_5FB3tcZVHujkxeBY-ijGQ6S2vzJzqXmX78cXYcOH0,22626
48
+ warp_beacon-2.3.52.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
49
+ warp_beacon-2.3.52.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
50
+ warp_beacon-2.3.52.dist-info/top_level.txt,sha256=qGjHVVfyf6lTmbdSA-fQq0rHS1YVS4HoJT3rag5xgPE,1141
51
+ warp_beacon-2.3.52.dist-info/RECORD,,