warp-beacon 2.2.42__py3-none-any.whl → 2.2.44__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.2.42"
1
+ __version__ = "2.2.44"
2
2
 
@@ -74,11 +74,17 @@ class AccountSelector(object):
74
74
  return self.current
75
75
 
76
76
  def bump_acc_fail(self, key: str, amount: int = 1) -> int:
77
- self.accounts_meta_data[self.account_index[self.current_module_name].value][key] += amount
78
- return self.accounts_meta_data[self.account_index[self.current_module_name].value][key]
77
+ try:
78
+ idx = self.account_index[self.current_module_name].value
79
+ self.accounts_meta_data[idx][key] += amount
80
+ return self.accounts_meta_data[idx][key]
81
+ except Exception as e:
82
+ logging.warning("Failed to record fail stats")
83
+ logging.exception(e)
79
84
 
80
85
  def how_much(self, key: str) -> int:
81
- return self.accounts_meta_data[self.current_module_name][self.account_index[self.current_module_name].value][key]
86
+ idx = self.account_index[self.current_module_name].value
87
+ return self.accounts_meta_data[self.current_module_name][idx][key]
82
88
 
83
89
  def get_current(self) -> tuple:
84
90
  idx = self.account_index[self.current_module_name].value
@@ -237,9 +237,6 @@ class InstagramScraper(ScraperAbstract):
237
237
 
238
238
  def download(self, url: str) -> Optional[list[dict]]:
239
239
  res = []
240
- wait_timeout = int(os.environ.get("IG_WAIT_TIMEOUT", default=60))
241
- timeout_increment = int(os.environ.get("IG_TIMEOUT_INCREMENT", default=30))
242
- ratelimit_threshold = int(os.environ.get("IG_RATELIMIT_TRESHOLD", default=3))
243
240
  while True:
244
241
  try:
245
242
  scrap_type, media_id = self.scrap(url)
@@ -263,6 +260,8 @@ class InstagramScraper(ScraperAbstract):
263
260
  except PleaseWaitFewMinutes as e:
264
261
  logging.warning("Please wait a few minutes error.")
265
262
  logging.exception(e)
263
+ if os.path.exists(self.inst_session_file):
264
+ os.unlink(self.inst_session_file)
266
265
  raise IGRateLimitOccurred("Instagram ratelimit")
267
266
  except (MediaNotFound, ClientNotFoundError, UserNotFound) as e:
268
267
  raise NotFound(extract_exception_message(e))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: warp_beacon
3
- Version: 2.2.42
3
+ Version: 2.2.44
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
@@ -3,7 +3,7 @@ lib/systemd/system/warp_beacon.service,sha256=lPmHqLqcI2eIV7nwHS0qcALQrznixqJuww
3
3
  var/warp_beacon/accounts.json,sha256=2QQMS9N_Z-TnfZq4U1vSUe4IKyZGmTFdgo8BoF4hQ7E,1710
4
4
  var/warp_beacon/placeholder.gif,sha256=cE5CGJVaop4Sx21zx6j4AyoHU0ncmvQuS2o6hJfEH88,6064
5
5
  warp_beacon/__init__.py,sha256=_rThNODmz0nDp_n4mWo_HKaNFE5jk1_7cRhHyYaencI,163
6
- warp_beacon/__version__.py,sha256=GjwTJOUfaTTwWSrJrrNTFpTM9rXHUkuTkNUOo7vj1HA,24
6
+ warp_beacon/__version__.py,sha256=8F8N50a98w_9GYt1c0CpfwFidClOnaC0ZH1MB3_q-IM,24
7
7
  warp_beacon/warp_beacon.py,sha256=7KEtZDj-pdhtl6m-zFLsSojs1ZR4o7L0xbqtdmYPvfE,342
8
8
  warp_beacon/compress/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  warp_beacon/compress/video.py,sha256=_PDMVYCyzLYxHv1uZmmzGcG_8rjaZr7BTXsXTTy_oS4,2846
@@ -21,10 +21,10 @@ warp_beacon/scheduler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
21
21
  warp_beacon/scheduler/scheduler.py,sha256=F9jF6myIHOI0TmC0-rBt2Un8gVvuhBW9zL-nEAEj0Bc,2585
22
22
  warp_beacon/scraper/__init__.py,sha256=58zSy74g1LY02HLEwP497a3ABg7f_LGxR6peKSt8dpI,15808
23
23
  warp_beacon/scraper/abstract.py,sha256=aNZ9ypF9B8BjflcIwi-7wEzIqF-XPeF0xvfX9CP_iIw,2708
24
- warp_beacon/scraper/account_selector.py,sha256=MbDJRuHr-1ebWwzEg4tTXuEZWAuwpJsgo0lI-LXEzVM,3552
24
+ warp_beacon/scraper/account_selector.py,sha256=QizM7naUEZGqm5PN9UEe-ygchS0RbTydC79VnWMokJg,3638
25
25
  warp_beacon/scraper/exceptions.py,sha256=fHywTm2-y2RkgM6hVz12CkDMBgHcEoN2a1TBLaVM2t4,1300
26
26
  warp_beacon/scraper/instagram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
- warp_beacon/scraper/instagram/instagram.py,sha256=ePAlN4SdpFJ-7eUkDL3TIgPQ8NP6yntzgy4p4xK1k4I,12997
27
+ warp_beacon/scraper/instagram/instagram.py,sha256=m2bAqLu-_HchlF5CVZDlytB9cFGxrN7EEbQW-G1f5u4,12857
28
28
  warp_beacon/scraper/youtube/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
29
  warp_beacon/scraper/youtube/abstract.py,sha256=4Le9xA0OF7yidpGXnhwT4bVdW04zlNUIDFPOgEgFjbo,7858
30
30
  warp_beacon/scraper/youtube/music.py,sha256=nbTDFdgXGbTNqttE828DEgvSc8-SuAsQAHeqUwU6yFM,1484
@@ -37,9 +37,9 @@ warp_beacon/telegram/handlers.py,sha256=xSNG_v4D4FaA5q1_5wXvJkjcDUhy5GaQnfpijJZp
37
37
  warp_beacon/telegram/placeholder_message.py,sha256=32U-R_IMPRJd-S5UwlpemLkArJOxCmO7whcynduSbMA,6418
38
38
  warp_beacon/telegram/utils.py,sha256=CeWXMwyzv2l4Af6I-wW2ySU490c-5k82sBhkjabv0n4,2452
39
39
  warp_beacon/uploader/__init__.py,sha256=rbfsm_eYcfsBRkiaG0glVgBNtQCEe7cVQTWEIAHz5aw,4763
40
- warp_beacon-2.2.42.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
41
- warp_beacon-2.2.42.dist-info/METADATA,sha256=lBWZXL1R2HL4aIFw6HgaAXidMaz3CCF24pPoE3dXrkM,21251
42
- warp_beacon-2.2.42.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
43
- warp_beacon-2.2.42.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
44
- warp_beacon-2.2.42.dist-info/top_level.txt,sha256=ALb_Ft_eG-OY4_m0TWUifNUOZsrx483L-zw7G7vqXoc,971
45
- warp_beacon-2.2.42.dist-info/RECORD,,
40
+ warp_beacon-2.2.44.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
41
+ warp_beacon-2.2.44.dist-info/METADATA,sha256=TYDRA9WWISNd3_GW_FibB_90udOPX464FPpo5zPtPXw,21251
42
+ warp_beacon-2.2.44.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
43
+ warp_beacon-2.2.44.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
44
+ warp_beacon-2.2.44.dist-info/top_level.txt,sha256=ALb_Ft_eG-OY4_m0TWUifNUOZsrx483L-zw7G7vqXoc,971
45
+ warp_beacon-2.2.44.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.2.0)
2
+ Generator: setuptools (75.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5