warp-beacon 2.0.2__tar.gz → 2.0.4__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.2/warp_beacon.egg-info → warp_beacon-2.0.4}/PKG-INFO +29 -5
  2. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/README.md +28 -4
  3. warp_beacon-2.0.4/warp_beacon/__version__.py +2 -0
  4. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/telegram/bot.py +1 -1
  5. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/telegram/handlers.py +7 -2
  6. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/telegram/utils.py +9 -0
  7. {warp_beacon-2.0.2 → warp_beacon-2.0.4/warp_beacon.egg-info}/PKG-INFO +29 -5
  8. warp_beacon-2.0.2/warp_beacon/__version__.py +0 -2
  9. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/LICENSE +0 -0
  10. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/MANIFEST.in +0 -0
  11. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/assets/placeholder.gif +0 -0
  12. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/etc/.gitignore +0 -0
  13. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/etc/warp_beacon.conf +0 -0
  14. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/etc/warp_beacon.service +0 -0
  15. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/pyproject.toml +0 -0
  16. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/setup.cfg +0 -0
  17. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/setup.py +0 -0
  18. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/__init__.py +0 -0
  19. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/compress/__init__.py +0 -0
  20. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/compress/video.py +0 -0
  21. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/jobs/__init__.py +0 -0
  22. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/jobs/abstract.py +0 -0
  23. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/jobs/download_job.py +0 -0
  24. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/jobs/types.py +0 -0
  25. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/jobs/upload_job.py +0 -0
  26. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/mediainfo/__init__.py +0 -0
  27. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/mediainfo/abstract.py +0 -0
  28. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/mediainfo/audio.py +0 -0
  29. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/mediainfo/silencer.py +0 -0
  30. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/mediainfo/video.py +0 -0
  31. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/scraper/__init__.py +0 -0
  32. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/scraper/abstract.py +0 -0
  33. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/scraper/exceptions.py +0 -0
  34. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/scraper/instagram.py +0 -0
  35. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/scraper/youtube/__init__.py +0 -0
  36. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/scraper/youtube/abstract.py +0 -0
  37. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/scraper/youtube/music.py +0 -0
  38. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/scraper/youtube/shorts.py +0 -0
  39. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/scraper/youtube/youtube.py +0 -0
  40. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/storage/__init__.py +0 -0
  41. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/telegram/__init__.py +0 -0
  42. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/telegram/placeholder_message.py +0 -0
  43. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/uploader/__init__.py +0 -0
  44. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon/warp_beacon.py +0 -0
  45. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon.egg-info/SOURCES.txt +0 -0
  46. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon.egg-info/dependency_links.txt +0 -0
  47. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon.egg-info/entry_points.txt +0 -0
  48. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/warp_beacon.egg-info/requires.txt +0 -0
  49. {warp_beacon-2.0.2 → warp_beacon-2.0.4}/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.2
3
+ Version: 2.0.4
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
@@ -237,10 +237,17 @@ Requires-Dist: instagrapi==2.0.0
237
237
 
238
238
  # warp_beacon [![Upload Python Package](https://github.com/sb0y/warp_beacon/actions/workflows/python-publish.yml/badge.svg)](https://github.com/sb0y/warp_beacon/actions/workflows/python-publish.yml) [![Docker Image CI](https://github.com/sb0y/warp_beacon/actions/workflows/docker-image.yml/badge.svg)](https://github.com/sb0y/warp_beacon/actions/workflows/docker-image.yml) [![Build DEB package](https://github.com/sb0y/warp_beacon/actions/workflows/build-deb.yml/badge.svg)](https://github.com/sb0y/warp_beacon/actions/workflows/build-deb.yml)
239
239
 
240
- Telegram bot for external social networks media scrapling.
241
- Works with links in personal messages and also with group chats.
240
+ Telegram bot for external social networks media links expanding.
241
+ Works with a links in personal messages and also with group chats.
242
242
 
243
- Just send to bot media link and get video.
243
+ Just send a media link to the chat with bot and get a video or audio reply.
244
+
245
+ <img width="549" alt="image" src="https://github.com/user-attachments/assets/6d1cf0d8-4aa9-4852-90c9-6817974a7dd9">
246
+
247
+ In order to setup your own instance, you will need:
248
+
249
+ 1. Obtain your own brand new `TG_TOKEN`. To do that, write to [@BotFather](https://t.me/BotFather).
250
+ 2. Obtain `TG_API_ID`, `TG_API_HASH`, `TG_BOT_NAME`. Learn more [here](https://core.telegram.org/api/obtaining_api_id).
244
251
 
245
252
  All bot configuration stored in [warp_beacon.conf](https://github.com/sb0y/warp_beacon/blob/main/etc/warp_beacon.conf) file.
246
253
 
@@ -248,6 +255,13 @@ All bot configuration stored in [warp_beacon.conf](https://github.com/sb0y/warp_
248
255
 
249
256
  ```env
250
257
  TG_TOKEN="you telegram token received from @BotFather"
258
+ # these 3 settings should be obtained at https://my.telegram.org/apps
259
+ # learn more: https://core.telegram.org/api/obtaining_api_id
260
+ ###
261
+ TG_API_ID=""
262
+ TG_API_HASH=""
263
+ TG_BOT_NAME=""
264
+ ###
251
265
  INSTAGRAM_LOGIN="instagram login (email or cell phone)"
252
266
  INSTAGRAM_PASSWORD="instgram password"
253
267
  INSTAGRAM_VERIFICATION_CODE="instagram 2FA if required, default empty"
@@ -256,7 +270,13 @@ MONGODB_PORT="27017"
256
270
  MONGODB_USER="root"
257
271
  MONGODB_PASSWORD="changeme"
258
272
  VIDEO_STORAGE_DIR="/var/warp_beacon/videos"
259
- WORKERS_POOL_SIZE=3
273
+ # workers settings
274
+ # default: min(32, os.cpu_count() + 4)
275
+ #TG_WORKERS_POOL_SIZE=3
276
+ #UPLOAD_POOL_SIZE=3
277
+ #WORKERS_POOL_SIZE=3
278
+ ENABLE_DONATES=true
279
+ DONATE_LINK="your donate link which will be shown if ENABLE_DONATES where set"
260
280
  ```
261
281
  ## Deployed example bot ##
262
282
  [Try it 🚀](https://t.me/anus_sebe_zablokiruy_bot)
@@ -355,3 +375,7 @@ build deb file
355
375
  ```bash
356
376
  dpkg-buildpackage -us -uc -b
357
377
  ```
378
+
379
+ # Support Warp Beacon project
380
+
381
+ [<img src="https://cdn.cryptocloud.plus/brand/cc-group-black.png" alt="CryptoCloud Accepted" width="250px">](https://pay.cryptocloud.plus/pos/W5BMtNQt5bJFoW2E)
@@ -1,9 +1,16 @@
1
1
  # warp_beacon [![Upload Python Package](https://github.com/sb0y/warp_beacon/actions/workflows/python-publish.yml/badge.svg)](https://github.com/sb0y/warp_beacon/actions/workflows/python-publish.yml) [![Docker Image CI](https://github.com/sb0y/warp_beacon/actions/workflows/docker-image.yml/badge.svg)](https://github.com/sb0y/warp_beacon/actions/workflows/docker-image.yml) [![Build DEB package](https://github.com/sb0y/warp_beacon/actions/workflows/build-deb.yml/badge.svg)](https://github.com/sb0y/warp_beacon/actions/workflows/build-deb.yml)
2
2
 
3
- Telegram bot for external social networks media scrapling.
4
- Works with links in personal messages and also with group chats.
3
+ Telegram bot for external social networks media links expanding.
4
+ Works with a links in personal messages and also with group chats.
5
5
 
6
- Just send to bot media link and get video.
6
+ Just send a media link to the chat with bot and get a video or audio reply.
7
+
8
+ <img width="549" alt="image" src="https://github.com/user-attachments/assets/6d1cf0d8-4aa9-4852-90c9-6817974a7dd9">
9
+
10
+ In order to setup your own instance, you will need:
11
+
12
+ 1. Obtain your own brand new `TG_TOKEN`. To do that, write to [@BotFather](https://t.me/BotFather).
13
+ 2. Obtain `TG_API_ID`, `TG_API_HASH`, `TG_BOT_NAME`. Learn more [here](https://core.telegram.org/api/obtaining_api_id).
7
14
 
8
15
  All bot configuration stored in [warp_beacon.conf](https://github.com/sb0y/warp_beacon/blob/main/etc/warp_beacon.conf) file.
9
16
 
@@ -11,6 +18,13 @@ All bot configuration stored in [warp_beacon.conf](https://github.com/sb0y/warp_
11
18
 
12
19
  ```env
13
20
  TG_TOKEN="you telegram token received from @BotFather"
21
+ # these 3 settings should be obtained at https://my.telegram.org/apps
22
+ # learn more: https://core.telegram.org/api/obtaining_api_id
23
+ ###
24
+ TG_API_ID=""
25
+ TG_API_HASH=""
26
+ TG_BOT_NAME=""
27
+ ###
14
28
  INSTAGRAM_LOGIN="instagram login (email or cell phone)"
15
29
  INSTAGRAM_PASSWORD="instgram password"
16
30
  INSTAGRAM_VERIFICATION_CODE="instagram 2FA if required, default empty"
@@ -19,7 +33,13 @@ MONGODB_PORT="27017"
19
33
  MONGODB_USER="root"
20
34
  MONGODB_PASSWORD="changeme"
21
35
  VIDEO_STORAGE_DIR="/var/warp_beacon/videos"
22
- WORKERS_POOL_SIZE=3
36
+ # workers settings
37
+ # default: min(32, os.cpu_count() + 4)
38
+ #TG_WORKERS_POOL_SIZE=3
39
+ #UPLOAD_POOL_SIZE=3
40
+ #WORKERS_POOL_SIZE=3
41
+ ENABLE_DONATES=true
42
+ DONATE_LINK="your donate link which will be shown if ENABLE_DONATES where set"
23
43
  ```
24
44
  ## Deployed example bot ##
25
45
  [Try it 🚀](https://t.me/anus_sebe_zablokiruy_bot)
@@ -118,3 +138,7 @@ build deb file
118
138
  ```bash
119
139
  dpkg-buildpackage -us -uc -b
120
140
  ```
141
+
142
+ # Support Warp Beacon project
143
+
144
+ [<img src="https://cdn.cryptocloud.plus/brand/cc-group-black.png" alt="CryptoCloud Accepted" width="250px">](https://pay.cryptocloud.plus/pos/W5BMtNQt5bJFoW2E)
@@ -0,0 +1,2 @@
1
+ __version__ = "2.0.4"
2
+
@@ -307,7 +307,7 @@ class Bot(object):
307
307
  sent_messages += messages
308
308
  if job.media_collection:
309
309
  for j, chunk in enumerate(media_chunk):
310
- tg_file_id = Utils.eƒƒxtract_file_id(messages[j])
310
+ tg_file_id = Utils.extract_file_id(messages[j])
311
311
  if tg_file_id:
312
312
  job.media_collection[i][j].tg_file_id = tg_file_id
313
313
  if i == 0 and job.placeholder_message_id:
@@ -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:
@@ -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.2
3
+ Version: 2.0.4
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
@@ -237,10 +237,17 @@ Requires-Dist: instagrapi==2.0.0
237
237
 
238
238
  # warp_beacon [![Upload Python Package](https://github.com/sb0y/warp_beacon/actions/workflows/python-publish.yml/badge.svg)](https://github.com/sb0y/warp_beacon/actions/workflows/python-publish.yml) [![Docker Image CI](https://github.com/sb0y/warp_beacon/actions/workflows/docker-image.yml/badge.svg)](https://github.com/sb0y/warp_beacon/actions/workflows/docker-image.yml) [![Build DEB package](https://github.com/sb0y/warp_beacon/actions/workflows/build-deb.yml/badge.svg)](https://github.com/sb0y/warp_beacon/actions/workflows/build-deb.yml)
239
239
 
240
- Telegram bot for external social networks media scrapling.
241
- Works with links in personal messages and also with group chats.
240
+ Telegram bot for external social networks media links expanding.
241
+ Works with a links in personal messages and also with group chats.
242
242
 
243
- Just send to bot media link and get video.
243
+ Just send a media link to the chat with bot and get a video or audio reply.
244
+
245
+ <img width="549" alt="image" src="https://github.com/user-attachments/assets/6d1cf0d8-4aa9-4852-90c9-6817974a7dd9">
246
+
247
+ In order to setup your own instance, you will need:
248
+
249
+ 1. Obtain your own brand new `TG_TOKEN`. To do that, write to [@BotFather](https://t.me/BotFather).
250
+ 2. Obtain `TG_API_ID`, `TG_API_HASH`, `TG_BOT_NAME`. Learn more [here](https://core.telegram.org/api/obtaining_api_id).
244
251
 
245
252
  All bot configuration stored in [warp_beacon.conf](https://github.com/sb0y/warp_beacon/blob/main/etc/warp_beacon.conf) file.
246
253
 
@@ -248,6 +255,13 @@ All bot configuration stored in [warp_beacon.conf](https://github.com/sb0y/warp_
248
255
 
249
256
  ```env
250
257
  TG_TOKEN="you telegram token received from @BotFather"
258
+ # these 3 settings should be obtained at https://my.telegram.org/apps
259
+ # learn more: https://core.telegram.org/api/obtaining_api_id
260
+ ###
261
+ TG_API_ID=""
262
+ TG_API_HASH=""
263
+ TG_BOT_NAME=""
264
+ ###
251
265
  INSTAGRAM_LOGIN="instagram login (email or cell phone)"
252
266
  INSTAGRAM_PASSWORD="instgram password"
253
267
  INSTAGRAM_VERIFICATION_CODE="instagram 2FA if required, default empty"
@@ -256,7 +270,13 @@ MONGODB_PORT="27017"
256
270
  MONGODB_USER="root"
257
271
  MONGODB_PASSWORD="changeme"
258
272
  VIDEO_STORAGE_DIR="/var/warp_beacon/videos"
259
- WORKERS_POOL_SIZE=3
273
+ # workers settings
274
+ # default: min(32, os.cpu_count() + 4)
275
+ #TG_WORKERS_POOL_SIZE=3
276
+ #UPLOAD_POOL_SIZE=3
277
+ #WORKERS_POOL_SIZE=3
278
+ ENABLE_DONATES=true
279
+ DONATE_LINK="your donate link which will be shown if ENABLE_DONATES where set"
260
280
  ```
261
281
  ## Deployed example bot ##
262
282
  [Try it 🚀](https://t.me/anus_sebe_zablokiruy_bot)
@@ -355,3 +375,7 @@ build deb file
355
375
  ```bash
356
376
  dpkg-buildpackage -us -uc -b
357
377
  ```
378
+
379
+ # Support Warp Beacon project
380
+
381
+ [<img src="https://cdn.cryptocloud.plus/brand/cc-group-black.png" alt="CryptoCloud Accepted" width="250px">](https://pay.cryptocloud.plus/pos/W5BMtNQt5bJFoW2E)
@@ -1,2 +0,0 @@
1
- __version__ = "2.0.2"
2
-
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes