warp-beacon 2.0.1__py3-none-any.whl → 2.0.3__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.
- warp_beacon/__version__.py +1 -1
- warp_beacon/scraper/__init__.py +1 -1
- warp_beacon/telegram/handlers.py +7 -2
- warp_beacon/telegram/placeholder_message.py +2 -1
- warp_beacon/telegram/utils.py +9 -0
- {warp_beacon-2.0.1.dist-info → warp_beacon-2.0.3.dist-info}/METADATA +1 -1
- {warp_beacon-2.0.1.dist-info → warp_beacon-2.0.3.dist-info}/RECORD +11 -11
- {warp_beacon-2.0.1.dist-info → warp_beacon-2.0.3.dist-info}/LICENSE +0 -0
- {warp_beacon-2.0.1.dist-info → warp_beacon-2.0.3.dist-info}/WHEEL +0 -0
- {warp_beacon-2.0.1.dist-info → warp_beacon-2.0.3.dist-info}/entry_points.txt +0 -0
- {warp_beacon-2.0.1.dist-info → warp_beacon-2.0.3.dist-info}/top_level.txt +0 -0
warp_beacon/__version__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
__version__ = "2.0.
|
1
|
+
__version__ = "2.0.3"
|
2
2
|
|
warp_beacon/scraper/__init__.py
CHANGED
@@ -146,7 +146,7 @@ class AsyncDownloader(object):
|
|
146
146
|
logging.info("Detected big file. Starting compressing with ffmpeg ...")
|
147
147
|
self.uploader.queue_task(job.to_upload_job(
|
148
148
|
job_warning=True,
|
149
|
-
job_warning_msg="Downloaded file size is bigger than Telegram limits
|
149
|
+
job_warning_msg="Downloaded file size is bigger than Telegram limits! Performing video compression. This may take a while.")
|
150
150
|
)
|
151
151
|
ffmpeg = VideoCompress(file_path=item["local_media_path"])
|
152
152
|
new_filepath = ffmpeg.generate_filepath(base_filepath=item["local_media_path"])
|
warp_beacon/telegram/handlers.py
CHANGED
@@ -17,6 +17,7 @@ import logging
|
|
17
17
|
class Handlers(object):
|
18
18
|
storage = None
|
19
19
|
bot = None
|
20
|
+
url_extractor = URLExtract()
|
20
21
|
|
21
22
|
def __init__(self, bot: "Bot") -> None:
|
22
23
|
self.bot = bot
|
@@ -55,10 +56,14 @@ class Handlers(object):
|
|
55
56
|
)
|
56
57
|
|
57
58
|
async def handler(self, client: Client, message: Message) -> None:
|
59
|
+
if message is None:
|
60
|
+
return
|
61
|
+
message_text = Utils.extract_message_text(message)
|
62
|
+
if not message_text:
|
63
|
+
return
|
58
64
|
chat = message.chat
|
59
65
|
effective_message_id = message.id
|
60
|
-
|
61
|
-
urls = extractor.find_urls(message.text)
|
66
|
+
urls = self.url_extractor.find_urls(message_text)
|
62
67
|
|
63
68
|
reply_text = "Wut?"
|
64
69
|
if not urls:
|
@@ -177,7 +177,8 @@ class PlaceholderMessage(object):
|
|
177
177
|
await self.bot.client.edit_message_caption(
|
178
178
|
chat_id=chat_id,
|
179
179
|
message_id=placeholder_message_id,
|
180
|
-
caption=" ⚠️
|
180
|
+
caption=" ⚠️ **%s**" % placeholder_text,
|
181
|
+
parse_mode=ParseMode.MARKDOWN
|
181
182
|
)
|
182
183
|
except Exception as e:
|
183
184
|
logging.error("Failed to update placeholder message!")
|
warp_beacon/telegram/utils.py
CHANGED
@@ -71,3 +71,12 @@ class Utils(object):
|
|
71
71
|
@staticmethod
|
72
72
|
def chunker(seq: list, size: int) -> list:
|
73
73
|
return (seq[pos:pos + size] for pos in range(0, len(seq), size))
|
74
|
+
|
75
|
+
@staticmethod
|
76
|
+
def extract_message_text(message: "Message") -> str:
|
77
|
+
if hasattr(message, "text") and message.text:
|
78
|
+
return message.text
|
79
|
+
if hasattr(message, "caption") and message.caption:
|
80
|
+
return message.caption
|
81
|
+
|
82
|
+
return ''
|
@@ -2,7 +2,7 @@ etc/warp_beacon/warp_beacon.conf,sha256=xihOuNBqVXGNdmMO14wwYNrqSQ4Z1wlAjp-xJk5S
|
|
2
2
|
lib/systemd/system/warp_beacon.service,sha256=lPmHqLqcI2eIV7nwHS0qcALQrznixqJuwwPfa2mDLUA,372
|
3
3
|
var/warp_beacon/placeholder.gif,sha256=cE5CGJVaop4Sx21zx6j4AyoHU0ncmvQuS2o6hJfEH88,6064
|
4
4
|
warp_beacon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
warp_beacon/__version__.py,sha256=
|
5
|
+
warp_beacon/__version__.py,sha256=qBRR7wn-5SDmrhUzh3Qz4ld7OgH44rHgW2zY3-CWx_k,23
|
6
6
|
warp_beacon/warp_beacon.py,sha256=7KEtZDj-pdhtl6m-zFLsSojs1ZR4o7L0xbqtdmYPvfE,342
|
7
7
|
warp_beacon/compress/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
warp_beacon/compress/video.py,sha256=_PDMVYCyzLYxHv1uZmmzGcG_8rjaZr7BTXsXTTy_oS4,2846
|
@@ -16,7 +16,7 @@ warp_beacon/mediainfo/abstract.py,sha256=ZR2JMuRpoh7nDNov9a8YkAfr6BI2HXnXzQtVrLg
|
|
16
16
|
warp_beacon/mediainfo/audio.py,sha256=ous88kwQj4bDIChN5wnGil5LqTs0IQHH0d-nyrL0-ZM,651
|
17
17
|
warp_beacon/mediainfo/silencer.py,sha256=yn9w1LVHG8JQy_D45_RzrlEWID1zbj3ecx7nYGUP4ZE,1647
|
18
18
|
warp_beacon/mediainfo/video.py,sha256=AIRy_op_BvehsjarM1rvT5Qo0QWwf-Q6xVVd_aCnbJ4,2505
|
19
|
-
warp_beacon/scraper/__init__.py,sha256=
|
19
|
+
warp_beacon/scraper/__init__.py,sha256=Ef24SqcD-dV12coPcSJaQC-fN2oOjH47S1nwsKTrtI4,9860
|
20
20
|
warp_beacon/scraper/abstract.py,sha256=cxQxt5eQkieCZsgQwz425iF69pgCrWZ69ItlikPsWHc,1036
|
21
21
|
warp_beacon/scraper/exceptions.py,sha256=9VJBK5ufokyUpT_q7XVFBYC8lK_BSBfo-S1pd6re9VY,1094
|
22
22
|
warp_beacon/scraper/instagram.py,sha256=YDFdrSB1ghw9f43004lFyk2S5QTopFvpyoUYN-qOVdw,8335
|
@@ -28,13 +28,13 @@ warp_beacon/scraper/youtube/youtube.py,sha256=xIrGe2ElPo3889_w5128xCnkdgwG1u6lA-
|
|
28
28
|
warp_beacon/storage/__init__.py,sha256=8XsJXq9X7GDlTaWREF4W1PDX9PH5utwhjf5c5M8Bb7o,3378
|
29
29
|
warp_beacon/telegram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
30
30
|
warp_beacon/telegram/bot.py,sha256=PVTXud908Q0f8q33ter6l372Z2EKGeOvk8BbQ9WIcYY,12066
|
31
|
-
warp_beacon/telegram/handlers.py,sha256=
|
32
|
-
warp_beacon/telegram/placeholder_message.py,sha256=
|
33
|
-
warp_beacon/telegram/utils.py,sha256=
|
31
|
+
warp_beacon/telegram/handlers.py,sha256=7-uaRuUgOPAE0fX-fSbn0N02Pv5uELnEIBFxHPj3tTs,5908
|
32
|
+
warp_beacon/telegram/placeholder_message.py,sha256=u5kVfTjGmVYkwA5opniRltHXGpsdSxI41WEde8J5os0,6418
|
33
|
+
warp_beacon/telegram/utils.py,sha256=1tm_DH1F2snDxSqwZnKD4ijvTrobv_kscgt3w-bWa6g,2027
|
34
34
|
warp_beacon/uploader/__init__.py,sha256=chX9oOrwO05O7DFmUfskTAnoKse66r3sY2s4NFF7bmM,4442
|
35
|
-
warp_beacon-2.0.
|
36
|
-
warp_beacon-2.0.
|
37
|
-
warp_beacon-2.0.
|
38
|
-
warp_beacon-2.0.
|
39
|
-
warp_beacon-2.0.
|
40
|
-
warp_beacon-2.0.
|
35
|
+
warp_beacon-2.0.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
36
|
+
warp_beacon-2.0.3.dist-info/METADATA,sha256=5FY-ercbPWwpbChKYneSgr4t_Z0BT7nx-WKL2NdCj7Q,18279
|
37
|
+
warp_beacon-2.0.3.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
38
|
+
warp_beacon-2.0.3.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
|
39
|
+
warp_beacon-2.0.3.dist-info/top_level.txt,sha256=pu6xG8OO_nCGllnOfAZ6QpVfivtmHVxPlYK8SZzUDqA,840
|
40
|
+
warp_beacon-2.0.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|