warp-beacon 2.6.74__py3-none-any.whl → 2.6.76__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.74"
1
+ __version__ = "2.6.76"
2
2
 
@@ -326,8 +326,8 @@ class YoutubeAbstract(ScraperAbstract):
326
326
  logging.exception(e)
327
327
 
328
328
  try:
329
- self.status_pipe.send({"action": "report_download_status", "current": 0, "total": 0,
330
- "message_id": self.job.placeholder_message_id, "chat_id": self.job.chat_id})
329
+ #self.status_pipe.send({"action": "report_download_status", "current": 0, "total": 0,
330
+ # "message_id": self.job.placeholder_message_id, "chat_id": self.job.chat_id})
331
331
  ret = self.download_hndlr(self._download, job.url, session=True, thumbnail=thumbnail)
332
332
  return ret
333
333
  except (Unavailable, TimeOut, KeyError) as e:
@@ -93,7 +93,7 @@ class EditMessage(object):
93
93
  file_name: str = None
94
94
  ) -> None:
95
95
  progress_bar = ProgressBar(self.client)
96
- await progress_bar.progress_callback(current=0, total=0, chat_id=chat_id, message_id=message_id, operation="Uploading", label=file_name, report_type=ReportType.PROGRESS)
96
+ #await progress_bar.progress_callback(current=0, total=0, chat_id=chat_id, message_id=message_id, operation="Uploading", label=file_name, report_type=ReportType.PROGRESS)
97
97
  raw_file = await self.client.save_file(path=media.media, progress=progress_bar.progress_callback, progress_args=(chat_id, message_id, "Uploading", ReportType.PROGRESS, file_name))
98
98
 
99
99
  caption = media.caption
@@ -9,7 +9,7 @@ from pyrogram import Client
9
9
  from warp_beacon.telegram.types import ReportType
10
10
 
11
11
  class ProgressBar(object):
12
- MAX_PROGRESS_RENDER_SIZE = 30_000_000
12
+ MAX_PROGRESS_RENDER_SIZE = 1_500_000 # 1 MB
13
13
 
14
14
  def __init__(self, client: Client) -> None:
15
15
  self._next_threshold = 20
@@ -59,8 +59,8 @@ class ProgressBar(object):
59
59
  """
60
60
  filled = int(percent * length / 100 + 0.5)
61
61
  empty = length - filled
62
- bar = "🟩" * filled + "⬜️" * empty
63
- return f"[{bar}] {percent}%"
62
+ pbar = "🟩" * filled + "⬜️" * empty
63
+ return f"[{pbar}] {percent}%"
64
64
 
65
65
  def _on_edit_done(self, task: asyncio.Task) -> None:
66
66
  exc = task.exception()
@@ -73,7 +73,7 @@ class ProgressBar(object):
73
73
 
74
74
  async def progress_callback(self, current: int, total: int, chat_id: int | str, message_id: int, operation: str, report_type: ReportType, label: str = "") -> None:
75
75
  if report_type == ReportType.PROGRESS:
76
- return self.render_progress_bar(current=current, total=total, chat_id=chat_id, message_id=message_id, operation=operation, label=label)
76
+ return await self.render_progress_bar(current=current, total=total, chat_id=chat_id, message_id=message_id, operation=operation, label=label)
77
77
  elif report_type == ReportType.ANNOUNCE:
78
78
  return self.render_progress_announce(chat_id=chat_id, message_id=message_id, label=label)
79
79
 
@@ -91,7 +91,7 @@ class ProgressBar(object):
91
91
  logging.warning("An error occurred while setup task to update progress bar")
92
92
  logging.exception(e)
93
93
 
94
- def render_progress_bar(self, current: int, total: int, chat_id: int | str, message_id: int, operation: str, label: str = "") -> None:
94
+ async def render_progress_bar(self, current: int, total: int, chat_id: int | str, message_id: int, operation: str, label: str = "") -> None:
95
95
  if total <= self.MAX_PROGRESS_RENDER_SIZE:
96
96
  return
97
97
  percent = 0
@@ -104,19 +104,19 @@ class ProgressBar(object):
104
104
  pbar = self.make_emoji_progress_bar(percent, 10)
105
105
  logging.info("[Progress bar]: Operation: %s %d%%", operation, percent)
106
106
  try:
107
- #await self.client.edit_message_caption(chat_id, message_id, f"{pbar} <b>{operation}</b> {label}", ParseMode.HTML)
108
107
  # we don't need to wait completion, waste of time and resources
109
108
  text = f"{pbar}\n{operation}"
110
109
  if label:
111
110
  text += f"\n<code>{label}</code>"
112
111
  if total:
113
112
  text += f" <b>{self.format_size_si(total)}</b>"
114
- task = self.client.loop.create_task(
115
- self.client.edit_message_caption(chat_id, message_id, text, ParseMode.HTML)
116
- )
117
- task.add_done_callback(self._on_edit_done)
118
- #except MessageNotModified:
119
- # logging.warning("bad_request_400.MessageNotModified")
113
+ await self.client.edit_message_caption(chat_id, message_id, text, ParseMode.HTML)
114
+ #task = self.client.loop.create_task(
115
+ # self.client.edit_message_caption(chat_id, message_id, text, ParseMode.HTML)
116
+ #)
117
+ #task.add_done_callback(self._on_edit_done)
118
+ except MessageNotModified:
119
+ logging.warning("bad_request_400.MessageNotModified")
120
120
  except Exception as e:
121
121
  logging.warning("An error occurred while setup task to update progress bar")
122
122
  logging.exception(e)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: warp_beacon
3
- Version: 2.6.74
3
+ Version: 2.6.76
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=_zBdzgEWRCJjgVMp5eZN-lBaVJM3Na6LgycjEI1UwQo,24
7
+ warp_beacon/__version__.py,sha256=ulPCTRFQAVW-xTIbqxMznCM-z79Clye5C0eKaytTh9o,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
@@ -34,7 +34,7 @@ warp_beacon/scraper/instagram/captcha.py,sha256=9UYziuqB3Tsat_ET6ex-cnZDbi6yCnsX
34
34
  warp_beacon/scraper/instagram/instagram.py,sha256=c_7E0z1m728n9hOqWR3SXbGLW61a_wxG-GZsoue64tM,17153
35
35
  warp_beacon/scraper/instagram/wb_instagrapi.py,sha256=1YMU6_PUa4g6usKU1EQPaWVw3c3ljxgoSh8BuhI8bsg,2911
36
36
  warp_beacon/scraper/youtube/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
- warp_beacon/scraper/youtube/abstract.py,sha256=sU1inNjg0dv96ae8pZennYfczE4u227RcpgulOtTNLw,13132
37
+ warp_beacon/scraper/youtube/abstract.py,sha256=K2ovycq1lkx0a2R1FddO3B0IcaVsVzni_fdXzajGdwg,13134
38
38
  warp_beacon/scraper/youtube/music.py,sha256=5AeSBQyUgVCJT2hoBCV2WvlyuV9US09SYJhmBG_P9F8,2755
39
39
  warp_beacon/scraper/youtube/shorts.py,sha256=1GtoYUlxAwcgSQcn80u5ehNJytH5AN5dPOicmX-XD8E,1705
40
40
  warp_beacon/scraper/youtube/youtube.py,sha256=x9v9p1coA9TvBhxjNAofGu4UBkAEdYPE2ePRnU-5tK0,7233
@@ -44,17 +44,17 @@ warp_beacon/telegram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
44
44
  warp_beacon/telegram/bot.py,sha256=W13hyJD89ozZallLq0NIb9c3uh1Hov8Axi7ab7LkE3A,19128
45
45
  warp_beacon/telegram/caption_shortener.py,sha256=EnguNCF52ne7y4P-iJAbI6K3sqoJqJbND_dX5Fhwkv0,1549
46
46
  warp_beacon/telegram/download_status.py,sha256=JNevX0VQh39fX98fjM9j_nm0Ribj8f3tfa6kxpeNapQ,1484
47
- warp_beacon/telegram/edit_message.py,sha256=jQjXhtumM2r7sVn3VtUnlwLj-H9ZP24r4SM6QaxE8nE,5478
47
+ warp_beacon/telegram/edit_message.py,sha256=y96-fkj5jKtEu68Bj5sGj7A06sFlXXfhfiyNdpPgqAU,5479
48
48
  warp_beacon/telegram/handlers.py,sha256=uvR6TPHSqdSxigp3wR-ewiE6t3TvVcbVLVcYGwkgD2s,9559
49
49
  warp_beacon/telegram/placeholder_message.py,sha256=wN9-BRiyrtHG-EvXtZkGJHt2CX71munQ57ITttjt0mw,6400
50
- warp_beacon/telegram/progress_bar.py,sha256=_UT_NLhKVmzKxid4KbypqXWugOkVzchNd4R99FQuXYc,4869
50
+ warp_beacon/telegram/progress_bar.py,sha256=VBF_qwjOCu0mXN-r_Us4M7qoDWoyvjrw2R2TLgFvTKM,4858
51
51
  warp_beacon/telegram/progress_file_reader.py,sha256=e3equyNKlKs764AD-iE9QRsh3YDHTzP78Mx5tdvPPWs,969
52
52
  warp_beacon/telegram/types.py,sha256=Kvdng6uCF1HRoqQgGW1ZYYPJoVuYkFb-LDvMBbW5Hjk,89
53
53
  warp_beacon/telegram/utils.py,sha256=1Lq67aRylVJzbwSyvAgjPAGjJZFATkICvAj3TJGuJiM,4635
54
54
  warp_beacon/uploader/__init__.py,sha256=j3qcuKhpchseZLGzSsSiogqe6WdMbkK8d3I-ConhNRs,5687
55
- warp_beacon-2.6.74.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
56
- warp_beacon-2.6.74.dist-info/METADATA,sha256=YQso6-F9oUkrKamh9GXz_63xbd4R6ZV1lUqKkd8XduU,22706
57
- warp_beacon-2.6.74.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
58
- warp_beacon-2.6.74.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
59
- warp_beacon-2.6.74.dist-info/top_level.txt,sha256=5YQRN46STNg81V_3jdzZ6bftkMxhe1hTPSFvJugDu84,1405
60
- warp_beacon-2.6.74.dist-info/RECORD,,
55
+ warp_beacon-2.6.76.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
56
+ warp_beacon-2.6.76.dist-info/METADATA,sha256=qFs730Y_7H_4iIcLVP4Mn64R1X-OGF4F8huvWeURSIc,22706
57
+ warp_beacon-2.6.76.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
58
+ warp_beacon-2.6.76.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
59
+ warp_beacon-2.6.76.dist-info/top_level.txt,sha256=5YQRN46STNg81V_3jdzZ6bftkMxhe1hTPSFvJugDu84,1405
60
+ warp_beacon-2.6.76.dist-info/RECORD,,