warp-beacon 2.2.23__py3-none-any.whl → 2.2.25__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.23"
1
+ __version__ = "2.2.25"
2
2
 
@@ -90,8 +90,9 @@ class IGScheduler(object):
90
90
  elapsed = time.time() - start_time
91
91
  self.state["remaining"] -= elapsed
92
92
 
93
- logging.info("Scheduler waking up")
94
- self.validate_ig_session()
93
+ if self.running:
94
+ logging.info("Scheduler waking up")
95
+ self.validate_ig_session()
95
96
  self.save_state()
96
97
  except Exception as e:
97
98
  logging.error("An error occurred in scheduler thread!")
@@ -12,7 +12,7 @@ import logging
12
12
 
13
13
  class AccountSelector(object):
14
14
  accounts = []
15
- acc_pool = None
15
+ acc_pools = {}
16
16
  current = None
17
17
  current_module_name = None
18
18
  index = None
@@ -30,6 +30,8 @@ class AccountSelector(object):
30
30
  if self.accounts:
31
31
  self.__init_meta_data()
32
32
  self.load_yt_sessions()
33
+ for acc_type, _ in self.accounts.items():
34
+ self.acc_pools[acc_type] = cycle(self.accounts[acc_type])
33
35
  else:
34
36
  raise ValueError("Accounts file not found")
35
37
 
@@ -61,14 +63,13 @@ class AccountSelector(object):
61
63
  def set_module(self, module_origin: Origin) -> None:
62
64
  module_name = 'youtube' if next((s for s in ("yt", "youtube", "youtu_be") if s in module_origin.value), None) else 'instagram'
63
65
  self.current_module_name = module_name
64
- self.acc_pool = cycle(self.accounts[module_name])
65
- self.current = next(self.acc_pool)
66
- self.index.value = self.accounts[module_name].index(self.current)
66
+ if self.current is None:
67
+ self.next()
67
68
 
68
69
  def next(self) -> dict:
69
- self.current = next(self.acc_pool)
70
+ self.current = next(self.acc_pools[self.current_module_name])
70
71
  self.index.value = self.accounts[self.current_module_name].index(self.current)
71
- logging.info("Next account index is '%d'", self.index.value)
72
+ logging.info("Selected account index is '%d'", self.index.value)
72
73
  return self.current
73
74
 
74
75
  def bump_acc_fail(self, key: str, amount: int = 1) -> int:
@@ -119,7 +119,7 @@ class YoutubeAbstract(ScraperAbstract):
119
119
 
120
120
  if aspect_ratio_height > 4:
121
121
  image = image.resize((image.size[0], image.size[1]+new_image.size[1]))
122
- height += new_image.size[1] - 10
122
+ height += new_image.size[1] - 5
123
123
 
124
124
  paste_position = ((target_width - width) // 2, (target_height - height) // 2)
125
125
  new_image.paste(image, paste_position)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: warp_beacon
3
- Version: 2.2.23
3
+ Version: 2.2.25
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=rKFQM_b9eoDS4mJ1B_SZNolPLXx1SQdQMdY2F_ZcBt8,1523
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=vCv8kRpv4QPHg9sn23QwD0o35BcsDQp4KEavKY-mve8,24
6
+ warp_beacon/__version__.py,sha256=3mBMIwezVS1xhawOklQVysRCiqVR5pkIBt9c99C394k,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
@@ -18,15 +18,15 @@ warp_beacon/mediainfo/audio.py,sha256=ous88kwQj4bDIChN5wnGil5LqTs0IQHH0d-nyrL0-Z
18
18
  warp_beacon/mediainfo/silencer.py,sha256=MgUc9Ibbhjhg9GbJMNfJqrdDkMsQShZkQ1sCwvW_-qI,1647
19
19
  warp_beacon/mediainfo/video.py,sha256=DXHiWAOyJPSVXQ0OP7uOBikUFT7noFmMaMSIx04Mhs4,2506
20
20
  warp_beacon/scheduler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
- warp_beacon/scheduler/scheduler.py,sha256=fetiuISHa-PqwZB0YHx56T9rmHHwKzYCMzd162iEIlQ,2562
21
+ warp_beacon/scheduler/scheduler.py,sha256=d_TxhIpL_4s0a8tgUO3xokkLYPx1CaHZdldbuIl90yI,2585
22
22
  warp_beacon/scraper/__init__.py,sha256=tkl7UyfqFcvPlxomVPB9GpWQvAoADaM6jGb_bmx1zRY,15229
23
23
  warp_beacon/scraper/abstract.py,sha256=aNZ9ypF9B8BjflcIwi-7wEzIqF-XPeF0xvfX9CP_iIw,2708
24
- warp_beacon/scraper/account_selector.py,sha256=CmHNNeh8NuYQsysDB8Hmo0dWMEqZnRfTc8HO3iEHtbU,3167
24
+ warp_beacon/scraper/account_selector.py,sha256=RKhNOMKEiUyx7ltg3uDxMtSyaRHTXieTYhkkDMgB80Q,3191
25
25
  warp_beacon/scraper/exceptions.py,sha256=lHsPrYy5iYnHsIdUHqRxZmzlqrkNj_TS4TkiTJfWhTs,1326
26
26
  warp_beacon/scraper/instagram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  warp_beacon/scraper/instagram/instagram.py,sha256=PpEammUP_InX5xj-sFJY6DkAUfIut2rqQsXd0uCtKOo,13579
28
28
  warp_beacon/scraper/youtube/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
- warp_beacon/scraper/youtube/abstract.py,sha256=_zqGs0vZ36LIN9DUSvOSml8_VSDMEEKo-Q38Dvau7_s,7635
29
+ warp_beacon/scraper/youtube/abstract.py,sha256=_FQBgARAk7I6VqodlUOh_znwhcpnpt0F_feNLJA4xVw,7634
30
30
  warp_beacon/scraper/youtube/music.py,sha256=nbTDFdgXGbTNqttE828DEgvSc8-SuAsQAHeqUwU6yFM,1484
31
31
  warp_beacon/scraper/youtube/shorts.py,sha256=RqMYDq4XHChtp-LdlxXyHej4h3NI3Qi9T8USxwk-pIk,1177
32
32
  warp_beacon/scraper/youtube/youtube.py,sha256=JvN5pVz0jtxCY9FGMl1dIg5Ccr2Kulaoxtym0Vb1QwQ,2224
@@ -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=rsUkzzmtaeQY-kNkcIiPsrayS9idFKY3hBC71mR19XE,4743
40
- warp_beacon-2.2.23.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
41
- warp_beacon-2.2.23.dist-info/METADATA,sha256=-YtvFcZO30rtSfFu_xPJZfNcurzCqJoRh1TsVTYLdF8,21251
42
- warp_beacon-2.2.23.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
43
- warp_beacon-2.2.23.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
44
- warp_beacon-2.2.23.dist-info/top_level.txt,sha256=ALb_Ft_eG-OY4_m0TWUifNUOZsrx483L-zw7G7vqXoc,971
45
- warp_beacon-2.2.23.dist-info/RECORD,,
40
+ warp_beacon-2.2.25.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
41
+ warp_beacon-2.2.25.dist-info/METADATA,sha256=DhoKFIE1DWRK1OzgOTBoqYG8T0X7xGYRHy4ATBQGnfc,21251
42
+ warp_beacon-2.2.25.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
43
+ warp_beacon-2.2.25.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
44
+ warp_beacon-2.2.25.dist-info/top_level.txt,sha256=ALb_Ft_eG-OY4_m0TWUifNUOZsrx483L-zw7G7vqXoc,971
45
+ warp_beacon-2.2.25.dist-info/RECORD,,