warp-beacon 2.0.1__tar.gz → 2.0.3__tar.gz

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.
Files changed (49) hide show
  1. {warp_beacon-2.0.1/warp_beacon.egg-info → warp_beacon-2.0.3}/PKG-INFO +1 -1
  2. warp_beacon-2.0.3/warp_beacon/__version__.py +2 -0
  3. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/scraper/__init__.py +1 -1
  4. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/telegram/handlers.py +7 -2
  5. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/telegram/placeholder_message.py +2 -1
  6. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/telegram/utils.py +9 -0
  7. {warp_beacon-2.0.1 → warp_beacon-2.0.3/warp_beacon.egg-info}/PKG-INFO +1 -1
  8. warp_beacon-2.0.1/warp_beacon/__version__.py +0 -2
  9. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/LICENSE +0 -0
  10. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/MANIFEST.in +0 -0
  11. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/README.md +0 -0
  12. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/assets/placeholder.gif +0 -0
  13. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/etc/.gitignore +0 -0
  14. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/etc/warp_beacon.conf +0 -0
  15. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/etc/warp_beacon.service +0 -0
  16. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/pyproject.toml +0 -0
  17. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/setup.cfg +0 -0
  18. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/setup.py +0 -0
  19. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/__init__.py +0 -0
  20. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/compress/__init__.py +0 -0
  21. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/compress/video.py +0 -0
  22. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/jobs/__init__.py +0 -0
  23. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/jobs/abstract.py +0 -0
  24. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/jobs/download_job.py +0 -0
  25. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/jobs/types.py +0 -0
  26. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/jobs/upload_job.py +0 -0
  27. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/mediainfo/__init__.py +0 -0
  28. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/mediainfo/abstract.py +0 -0
  29. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/mediainfo/audio.py +0 -0
  30. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/mediainfo/silencer.py +0 -0
  31. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/mediainfo/video.py +0 -0
  32. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/scraper/abstract.py +0 -0
  33. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/scraper/exceptions.py +0 -0
  34. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/scraper/instagram.py +0 -0
  35. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/scraper/youtube/__init__.py +0 -0
  36. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/scraper/youtube/abstract.py +0 -0
  37. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/scraper/youtube/music.py +0 -0
  38. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/scraper/youtube/shorts.py +0 -0
  39. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/scraper/youtube/youtube.py +0 -0
  40. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/storage/__init__.py +0 -0
  41. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/telegram/__init__.py +0 -0
  42. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/telegram/bot.py +0 -0
  43. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/uploader/__init__.py +0 -0
  44. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon/warp_beacon.py +0 -0
  45. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon.egg-info/SOURCES.txt +0 -0
  46. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon.egg-info/dependency_links.txt +0 -0
  47. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon.egg-info/entry_points.txt +0 -0
  48. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon.egg-info/requires.txt +0 -0
  49. {warp_beacon-2.0.1 → warp_beacon-2.0.3}/warp_beacon.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: warp_beacon
3
- Version: 2.0.1
3
+ Version: 2.0.3
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
@@ -0,0 +1,2 @@
1
+ __version__ = "2.0.3"
2
+
@@ -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\! Performing video compression\. This may take a while\.")
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"])
@@ -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
- extractor = URLExtract()
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=" ⚠️ *%s*" % placeholder_text
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!")
@@ -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 ''
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: warp_beacon
3
- Version: 2.0.1
3
+ Version: 2.0.3
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
@@ -1,2 +0,0 @@
1
- __version__ = "2.0.1"
2
-
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes