warp-beacon 2.6.52__py3-none-any.whl → 2.6.54__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.52"
1
+ __version__ = "2.6.54"
2
2
 
@@ -243,8 +243,15 @@ class YoutubeAbstract(ScraperAbstract):
243
243
  bytes_downloaded = total_size - bytes_remaining
244
244
  percentage_of_completion = bytes_downloaded / (total_size or 1) * 100
245
245
  if total_size == 0 or percentage_of_completion >= self._download_progress_threshold:
246
- self.status_pipe.send({"action": "report_download_status", "current": bytes_downloaded, "total": total_size,
247
- "message_id": self.job.placeholder_message_id, "chat_id": self.job.chat_id})
246
+ msg = {
247
+ "action": "report_download_status",
248
+ "current": bytes_downloaded,
249
+ "total": total_size,
250
+ "message_id": self.job.placeholder_message_id,
251
+ "chat_id": self.job.chat_id,
252
+ "completed": percentage_of_completion >= 100
253
+ }
254
+ self.status_pipe.send(msg)
248
255
  logging.debug("[Download worker] Downloaded %d%%", percentage_of_completion)
249
256
  if total_size > 0:
250
257
  self._download_progress_threshold += 20
@@ -39,4 +39,5 @@ class DownloadStatus(object):
39
39
  else:
40
40
  progress_bar = self.progress_bars[a_key]
41
41
  task = self.client.loop.create_task(self.handle_message(msg, progress_bar))
42
- task.add_done_callback(lambda _: progress_bar.is_complete() and self.progress_bars.pop(a_key, None))
42
+ if msg.get("completed", False):
43
+ task.add_done_callback(lambda _: self.progress_bars.pop(a_key, None))
@@ -52,13 +52,25 @@ class ProgressBar(object):
52
52
  if total == 0 or percent >= self._next_threshold:
53
53
  #pbar = self.make_progress_bar(percent, 100, 25)
54
54
  pbar = self.make_emoji_progress_bar(percent, 100, 14)
55
- logging.info("[%s] Uploaded to Telegram %d%%", label or operation, percent)
55
+ logging.info("[%s] Operation: %s %d%%", label or operation, operation, percent)
56
56
  try:
57
- await self.client.edit_message_caption(chat_id, message_id, f"{pbar} <b>{operation}</b> {label}", ParseMode.HTML)
58
- except MessageNotModified:
59
- logging.warning("bad_request_400.MessageNotModified")
57
+ #await self.client.edit_message_caption(chat_id, message_id, f"{pbar} <b>{operation}</b> {label}", ParseMode.HTML)
58
+ # we don't need to wait completion, waste of time and resources
59
+ task = self.client.loop.create_task(
60
+ self.client.edit_message_caption(chat_id, message_id, f"{pbar} <b>{operation}</b> {label}", ParseMode.HTML)
61
+ )
62
+ task.add_done_callback(
63
+ lambda t: (
64
+ (exc := t.exception()) and
65
+ (isinstance(exc, MessageNotModified)
66
+ and logging.warning("bad_request_400.MessageNotModified")
67
+ or logging.exception("Error in edit_message_caption", exc_info=exc))
68
+ )
69
+ )
70
+ #except MessageNotModified:
71
+ #logging.warning("bad_request_400.MessageNotModified")
60
72
  except Exception as e:
61
- logging.warning("An error occurred while updating progress bar")
73
+ logging.warning("An error occurred while setup task to update progress bar")
62
74
  logging.exception(e)
63
75
  if total > 0:
64
76
  self._next_threshold += 20
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: warp_beacon
3
- Version: 2.6.52
3
+ Version: 2.6.54
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=WYFTtZw5G5XNJ1RGBwp_lsa8Y-BLk4Hx71qE64GRmhE,24
7
+ warp_beacon/__version__.py,sha256=n77-uVboGYOpzowD-4XvQrBJEhAfKpJcTLztmdsI4qA,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
@@ -33,7 +33,7 @@ warp_beacon/scraper/instagram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
33
33
  warp_beacon/scraper/instagram/captcha.py,sha256=9UYziuqB3Tsat_ET6ex-cnZDbi6yCnsXHSpmE8MuUHk,4651
34
34
  warp_beacon/scraper/instagram/instagram.py,sha256=zbkF-1lU5lxJ_2m8i8mGRX0EQMLVSflsOafBM1FEC6s,15588
35
35
  warp_beacon/scraper/youtube/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
- warp_beacon/scraper/youtube/abstract.py,sha256=1B2GmxMu0mpRaUFHxHn-IUHYBrrukgvBA3YDKc6wz1w,13406
36
+ warp_beacon/scraper/youtube/abstract.py,sha256=KjtMb_5RJrAyLGz_BIBv-RdBRey6PnJX6jnOaJKsbTk,13485
37
37
  warp_beacon/scraper/youtube/music.py,sha256=5AeSBQyUgVCJT2hoBCV2WvlyuV9US09SYJhmBG_P9F8,2755
38
38
  warp_beacon/scraper/youtube/shorts.py,sha256=1GtoYUlxAwcgSQcn80u5ehNJytH5AN5dPOicmX-XD8E,1705
39
39
  warp_beacon/scraper/youtube/youtube.py,sha256=x9v9p1coA9TvBhxjNAofGu4UBkAEdYPE2ePRnU-5tK0,7233
@@ -42,17 +42,17 @@ warp_beacon/storage/mongo.py,sha256=qC4ZiO8XXvPnP0rJwz4CJx42pqFsyAjCiW10W5QdT6E,
42
42
  warp_beacon/telegram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
43
  warp_beacon/telegram/bot.py,sha256=W13hyJD89ozZallLq0NIb9c3uh1Hov8Axi7ab7LkE3A,19128
44
44
  warp_beacon/telegram/caption_shortener.py,sha256=EnguNCF52ne7y4P-iJAbI6K3sqoJqJbND_dX5Fhwkv0,1549
45
- warp_beacon/telegram/download_status.py,sha256=RZCqwFB3-qmA13cSxih0hNF_3AtsTaJ7G6BiC_6Bx2U,1338
45
+ warp_beacon/telegram/download_status.py,sha256=dV0mRIOkA8dU0ECsmC_rZ33XQhVnkW2nZBNTxQ0Y6x4,1342
46
46
  warp_beacon/telegram/edit_message.py,sha256=_452kXWn65qj9iPSvSmORbKXXTjJ0z6kBCxPcmKDrlM,5742
47
47
  warp_beacon/telegram/handlers.py,sha256=uvR6TPHSqdSxigp3wR-ewiE6t3TvVcbVLVcYGwkgD2s,9559
48
48
  warp_beacon/telegram/placeholder_message.py,sha256=wN9-BRiyrtHG-EvXtZkGJHt2CX71munQ57ITttjt0mw,6400
49
- warp_beacon/telegram/progress_bar.py,sha256=TYvoGTmr44aqAYbZ6byU5sekdVoz7x_0YMDkLO6plYo,2575
49
+ warp_beacon/telegram/progress_bar.py,sha256=KKY5Sb3Mc-pfFDEAfsk3No8cY5N5Bo8Ng6yrnjBoRtE,3097
50
50
  warp_beacon/telegram/progress_file_reader.py,sha256=e3equyNKlKs764AD-iE9QRsh3YDHTzP78Mx5tdvPPWs,969
51
51
  warp_beacon/telegram/utils.py,sha256=1Lq67aRylVJzbwSyvAgjPAGjJZFATkICvAj3TJGuJiM,4635
52
52
  warp_beacon/uploader/__init__.py,sha256=j3qcuKhpchseZLGzSsSiogqe6WdMbkK8d3I-ConhNRs,5687
53
- warp_beacon-2.6.52.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
54
- warp_beacon-2.6.52.dist-info/METADATA,sha256=hjx2NrTyrv0kc4GFH_GEP_3uFi2sxXv3SjoPXcOyvhk,22706
55
- warp_beacon-2.6.52.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
56
- warp_beacon-2.6.52.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
57
- warp_beacon-2.6.52.dist-info/top_level.txt,sha256=2x4wBJ_HeeBt6Bsdu9C4tItXWqH8spX8jGSHpoL0IMw,1334
58
- warp_beacon-2.6.52.dist-info/RECORD,,
53
+ warp_beacon-2.6.54.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
54
+ warp_beacon-2.6.54.dist-info/METADATA,sha256=5EesVY6qf_28_QAvLcWGXBznvUvigu7JDlLui-OuLpc,22706
55
+ warp_beacon-2.6.54.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
56
+ warp_beacon-2.6.54.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
57
+ warp_beacon-2.6.54.dist-info/top_level.txt,sha256=2x4wBJ_HeeBt6Bsdu9C4tItXWqH8spX8jGSHpoL0IMw,1334
58
+ warp_beacon-2.6.54.dist-info/RECORD,,