warp-beacon 2.2.24__py3-none-any.whl → 2.2.26__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.24"
1
+ __version__ = "2.2.26"
2
2
 
@@ -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)
@@ -370,8 +370,6 @@ class Bot(object):
370
370
  col_job_args = self.build_tg_args(job)
371
371
  sent_messages = []
372
372
  snd_grp_options = {"chat_id": job.chat_id, "reply_to_message_id": job.message_id}
373
- if job.chat_type in (ChatType.GROUP, ChatType.SUPERGROUP):
374
- snd_grp_options["reply_to_message_id"] = None
375
373
  for i, media_chunk in enumerate(col_job_args["media"]):
376
374
  snd_grp_options["media"] = media_chunk
377
375
  messages = await self.client.send_media_group(**snd_grp_options)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: warp_beacon
3
- Version: 2.2.24
3
+ Version: 2.2.26
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=5j3uHwSbszh78x6-PpDSiisJ6tRYR9nAOlv4L1PqQis,24
6
+ warp_beacon/__version__.py,sha256=WVyEDCsJ0YQSOXacx6zGDeIFqu_3O78GTa_VrOBAx_I,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,25 +21,25 @@ warp_beacon/scheduler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
21
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
33
33
  warp_beacon/storage/__init__.py,sha256=m86MDXBMtZZsTPLI2cD-pM5Xkh2g2NYVvp_dtW8eH0Q,3548
34
34
  warp_beacon/telegram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
- warp_beacon/telegram/bot.py,sha256=KAdtL-Fc0Jw0aztk8FtefCLPao7UP0gJkHMC5_mHJvs,15387
35
+ warp_beacon/telegram/bot.py,sha256=aU1rhqXAAvEvNmzQZL9ziMXjod_Q3oDzeh6RBofZf50,15269
36
36
  warp_beacon/telegram/handlers.py,sha256=xSNG_v4D4FaA5q1_5wXvJkjcDUhy5GaQnfpijJZpnPk,7039
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.24.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
41
- warp_beacon-2.2.24.dist-info/METADATA,sha256=w7KmHqfjMGQ79SSE5KICEn-plclCtsqrG5JIJ-9AUCg,21251
42
- warp_beacon-2.2.24.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
43
- warp_beacon-2.2.24.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
44
- warp_beacon-2.2.24.dist-info/top_level.txt,sha256=ALb_Ft_eG-OY4_m0TWUifNUOZsrx483L-zw7G7vqXoc,971
45
- warp_beacon-2.2.24.dist-info/RECORD,,
40
+ warp_beacon-2.2.26.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
41
+ warp_beacon-2.2.26.dist-info/METADATA,sha256=tAT4lzTuj5t1p1N9Sp6Nhodqo3edb1W_1YTO282fcsY,21251
42
+ warp_beacon-2.2.26.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
43
+ warp_beacon-2.2.26.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
44
+ warp_beacon-2.2.26.dist-info/top_level.txt,sha256=ALb_Ft_eG-OY4_m0TWUifNUOZsrx483L-zw7G7vqXoc,971
45
+ warp_beacon-2.2.26.dist-info/RECORD,,