warp-beacon 2.0.4__tar.gz → 2.0.5__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.4/warp_beacon.egg-info → warp_beacon-2.0.5}/PKG-INFO +18 -2
  2. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/README.md +16 -1
  3. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/pyproject.toml +1 -0
  4. warp_beacon-2.0.5/warp_beacon/__version__.py +2 -0
  5. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/scraper/abstract.py +18 -0
  6. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/scraper/instagram.py +7 -2
  7. {warp_beacon-2.0.4 → warp_beacon-2.0.5/warp_beacon.egg-info}/PKG-INFO +18 -2
  8. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon.egg-info/requires.txt +1 -0
  9. warp_beacon-2.0.4/warp_beacon/__version__.py +0 -2
  10. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/LICENSE +0 -0
  11. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/MANIFEST.in +0 -0
  12. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/assets/placeholder.gif +0 -0
  13. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/etc/.gitignore +0 -0
  14. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/etc/warp_beacon.conf +0 -0
  15. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/etc/warp_beacon.service +0 -0
  16. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/setup.cfg +0 -0
  17. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/setup.py +0 -0
  18. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/__init__.py +0 -0
  19. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/compress/__init__.py +0 -0
  20. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/compress/video.py +0 -0
  21. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/jobs/__init__.py +0 -0
  22. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/jobs/abstract.py +0 -0
  23. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/jobs/download_job.py +0 -0
  24. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/jobs/types.py +0 -0
  25. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/jobs/upload_job.py +0 -0
  26. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/mediainfo/__init__.py +0 -0
  27. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/mediainfo/abstract.py +0 -0
  28. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/mediainfo/audio.py +0 -0
  29. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/mediainfo/silencer.py +0 -0
  30. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/mediainfo/video.py +0 -0
  31. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/scraper/__init__.py +0 -0
  32. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/scraper/exceptions.py +0 -0
  33. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/scraper/youtube/__init__.py +0 -0
  34. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/scraper/youtube/abstract.py +0 -0
  35. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/scraper/youtube/music.py +0 -0
  36. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/scraper/youtube/shorts.py +0 -0
  37. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/scraper/youtube/youtube.py +0 -0
  38. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/storage/__init__.py +0 -0
  39. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/telegram/__init__.py +0 -0
  40. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/telegram/bot.py +0 -0
  41. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/telegram/handlers.py +0 -0
  42. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/telegram/placeholder_message.py +0 -0
  43. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/telegram/utils.py +0 -0
  44. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/uploader/__init__.py +0 -0
  45. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon/warp_beacon.py +0 -0
  46. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon.egg-info/SOURCES.txt +0 -0
  47. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon.egg-info/dependency_links.txt +0 -0
  48. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/warp_beacon.egg-info/entry_points.txt +0 -0
  49. {warp_beacon-2.0.4 → warp_beacon-2.0.5}/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.4
3
+ Version: 2.0.5
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
@@ -228,6 +228,7 @@ Requires-Dist: ffmpeg-python
228
228
  Requires-Dist: uvloop
229
229
  Requires-Dist: tgcrypto
230
230
  Requires-Dist: pyrogram
231
+ Requires-Dist: pillow-heif
231
232
  Requires-Dist: pytubefix
232
233
  Requires-Dist: av
233
234
  Requires-Dist: urlextract
@@ -242,7 +243,12 @@ Works with a links in personal messages and also with group chats.
242
243
 
243
244
  Just send a media link to the chat with bot and get a video or audio reply.
244
245
 
245
- <img width="549" alt="image" src="https://github.com/user-attachments/assets/6d1cf0d8-4aa9-4852-90c9-6817974a7dd9">
246
+ | | | |
247
+ |:-------------------------:|:-------------------------:|:-------------------------:|
248
+ |<img width="700" alt="Yotube Video usage example" src="https://github.com/user-attachments/assets/280b058f-325b-4386-9556-f145f6db9cfa"> Yotube Video usage example |<img width="700" alt="Youtube Music usage example" src="https://github.com/user-attachments/assets/3a462a3b-8c80-460f-aa66-c39db24f7a24"> Youtube Music usage example|<img width="703" alt="image" src="https://github.com/user-attachments/assets/384206ea-1371-48d5-a717-92aff06fa339"> Instagram Reels usage example |
249
+ |<img width="700" alt="Instagram Photo post usage example" src="https://github.com/user-attachments/assets/29324b94-7314-4a38-8790-3483011d355d"> Instagram Photo post usage example|<img width="700" alt="Instagram Photo Carousel usage" src="https://github.com/user-attachments/assets/2598e329-e16e-455e-91e9-a027e8994283"> Instagram Photo Carousel usage example|<img width="757" alt="Instagram Photo bulk Strories download usage example" src="https://github.com/user-attachments/assets/2c8c91ac-6ade-4d1d-a677-2b36bb40ff39"> Instagram Photo bulk Strories download usage example|
250
+ |<img width="700" alt="Instagram specific Story download usage example" src="https://github.com/user-attachments/assets/03dc70c5-6933-4122-9c7c-5f7d734d117b"> Instagram specific Story download usage example|<img width="700" alt="Group chat usage example" src="https://github.com/user-attachments/assets/649fcb1e-785b-4efd-9153-69644c6d898b"> Group chat usage example|
251
+
246
252
 
247
253
  In order to setup your own instance, you will need:
248
254
 
@@ -320,6 +326,16 @@ Check logs
320
326
  ```bash
321
327
  sudo docker compose logs warp_beacon -f
322
328
  ```
329
+ ## Upgrading ##
330
+ If you are using `image-prod` (set in `docker-compose.yml` by default), just rebuild your image:
331
+ ```bash
332
+ cd your_warp_beacon_sources_directory/
333
+ sudo docker compose build --no-cache
334
+ ```
335
+ Recreate existing container:
336
+ ```bash
337
+ sudo docker compose up -d
338
+ ```
323
339
 
324
340
  ## How to install from PIP ##
325
341
 
@@ -5,7 +5,12 @@ Works with a links in personal messages and also with group chats.
5
5
 
6
6
  Just send a media link to the chat with bot and get a video or audio reply.
7
7
 
8
- <img width="549" alt="image" src="https://github.com/user-attachments/assets/6d1cf0d8-4aa9-4852-90c9-6817974a7dd9">
8
+ | | | |
9
+ |:-------------------------:|:-------------------------:|:-------------------------:|
10
+ |<img width="700" alt="Yotube Video usage example" src="https://github.com/user-attachments/assets/280b058f-325b-4386-9556-f145f6db9cfa"> Yotube Video usage example |<img width="700" alt="Youtube Music usage example" src="https://github.com/user-attachments/assets/3a462a3b-8c80-460f-aa66-c39db24f7a24"> Youtube Music usage example|<img width="703" alt="image" src="https://github.com/user-attachments/assets/384206ea-1371-48d5-a717-92aff06fa339"> Instagram Reels usage example |
11
+ |<img width="700" alt="Instagram Photo post usage example" src="https://github.com/user-attachments/assets/29324b94-7314-4a38-8790-3483011d355d"> Instagram Photo post usage example|<img width="700" alt="Instagram Photo Carousel usage" src="https://github.com/user-attachments/assets/2598e329-e16e-455e-91e9-a027e8994283"> Instagram Photo Carousel usage example|<img width="757" alt="Instagram Photo bulk Strories download usage example" src="https://github.com/user-attachments/assets/2c8c91ac-6ade-4d1d-a677-2b36bb40ff39"> Instagram Photo bulk Strories download usage example|
12
+ |<img width="700" alt="Instagram specific Story download usage example" src="https://github.com/user-attachments/assets/03dc70c5-6933-4122-9c7c-5f7d734d117b"> Instagram specific Story download usage example|<img width="700" alt="Group chat usage example" src="https://github.com/user-attachments/assets/649fcb1e-785b-4efd-9153-69644c6d898b"> Group chat usage example|
13
+
9
14
 
10
15
  In order to setup your own instance, you will need:
11
16
 
@@ -83,6 +88,16 @@ Check logs
83
88
  ```bash
84
89
  sudo docker compose logs warp_beacon -f
85
90
  ```
91
+ ## Upgrading ##
92
+ If you are using `image-prod` (set in `docker-compose.yml` by default), just rebuild your image:
93
+ ```bash
94
+ cd your_warp_beacon_sources_directory/
95
+ sudo docker compose build --no-cache
96
+ ```
97
+ Recreate existing container:
98
+ ```bash
99
+ sudo docker compose up -d
100
+ ```
86
101
 
87
102
  ## How to install from PIP ##
88
103
 
@@ -17,6 +17,7 @@ dependencies = [
17
17
  "uvloop",
18
18
  "tgcrypto",
19
19
  "pyrogram",
20
+ "pillow-heif",
20
21
  "pytubefix",
21
22
  "av",
22
23
  "urlextract",
@@ -0,0 +1,2 @@
1
+ __version__ = "2.0.5"
2
+
@@ -5,6 +5,7 @@ from abc import ABC, abstractmethod
5
5
  from typing import Callable, Union
6
6
 
7
7
  from PIL import Image
8
+ from pillow_heif import register_heif_opener
8
9
 
9
10
  import logging
10
11
 
@@ -41,4 +42,21 @@ class ScraperAbstract(ABC):
41
42
 
42
43
  return ''
43
44
 
45
+ @staticmethod
46
+ def convert_heic_to_png(src_file: str) -> str:
47
+ try:
48
+ if os.path.exists(src_file):
49
+ register_heif_opener()
50
+ path_info = pathlib.Path(src_file)
51
+ old_filename = path_info.stem
52
+ new_filename = "%s_converted.%s" % (old_filename, "png")
53
+ new_filepath = "%s/%s" % (os.path.dirname(src_file), new_filename)
54
+ with Image.open(src_file).convert('RGB') as img:
55
+ img.save(new_filepath, 'png')
56
+ os.unlink(src_file)
57
+ return new_filepath
58
+ except Exception as e:
59
+ logging.error("Failed to convert webp file to png!")
60
+ logging.exception(e)
44
61
 
62
+ return ''
@@ -126,8 +126,11 @@ class InstagramScraper(ScraperAbstract):
126
126
 
127
127
  def download_photo(self, url: str) -> dict:
128
128
  path = str(self._download_hndlr(self.cl.photo_download_by_url, url, folder='/tmp'))
129
- if ".webp" in path:
129
+ path_lowered = path.lower()
130
+ if ".webp" in path_lowered:
130
131
  path = InstagramScraper.convert_webp_to_png(path)
132
+ if ".heic" in path_lowered:
133
+ path = InstagramScraper.convert_heic_to_png(path)
131
134
  return {"local_media_path": path, "media_type": JobType.IMAGE}
132
135
 
133
136
  def download_story(self, story_info: Story) -> dict:
@@ -142,8 +145,10 @@ class InstagramScraper(ScraperAbstract):
142
145
  effective_url = "https://www.instagram.com/stories/%s/%s/" % (story_info.user.username, effective_story_id)
143
146
  if story_info.media_type == 1: # photo
144
147
  path = str(self._download_hndlr(self.cl.story_download_by_url, url=story_info.thumbnail_url, folder='/tmp'))
145
- if ".webp" in path:
148
+ if ".webp" in path_lowered:
146
149
  path = InstagramScraper.convert_webp_to_png(path)
150
+ if ".heic" in path_lowered:
151
+ path = InstagramScraper.convert_heic_to_png(path)
147
152
  media_type = JobType.IMAGE
148
153
  elif story_info.media_type == 2: # video
149
154
  path = str(self._download_hndlr(self.cl.story_download_by_url, url=story_info.video_url, folder='/tmp'))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: warp_beacon
3
- Version: 2.0.4
3
+ Version: 2.0.5
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
@@ -228,6 +228,7 @@ Requires-Dist: ffmpeg-python
228
228
  Requires-Dist: uvloop
229
229
  Requires-Dist: tgcrypto
230
230
  Requires-Dist: pyrogram
231
+ Requires-Dist: pillow-heif
231
232
  Requires-Dist: pytubefix
232
233
  Requires-Dist: av
233
234
  Requires-Dist: urlextract
@@ -242,7 +243,12 @@ Works with a links in personal messages and also with group chats.
242
243
 
243
244
  Just send a media link to the chat with bot and get a video or audio reply.
244
245
 
245
- <img width="549" alt="image" src="https://github.com/user-attachments/assets/6d1cf0d8-4aa9-4852-90c9-6817974a7dd9">
246
+ | | | |
247
+ |:-------------------------:|:-------------------------:|:-------------------------:|
248
+ |<img width="700" alt="Yotube Video usage example" src="https://github.com/user-attachments/assets/280b058f-325b-4386-9556-f145f6db9cfa"> Yotube Video usage example |<img width="700" alt="Youtube Music usage example" src="https://github.com/user-attachments/assets/3a462a3b-8c80-460f-aa66-c39db24f7a24"> Youtube Music usage example|<img width="703" alt="image" src="https://github.com/user-attachments/assets/384206ea-1371-48d5-a717-92aff06fa339"> Instagram Reels usage example |
249
+ |<img width="700" alt="Instagram Photo post usage example" src="https://github.com/user-attachments/assets/29324b94-7314-4a38-8790-3483011d355d"> Instagram Photo post usage example|<img width="700" alt="Instagram Photo Carousel usage" src="https://github.com/user-attachments/assets/2598e329-e16e-455e-91e9-a027e8994283"> Instagram Photo Carousel usage example|<img width="757" alt="Instagram Photo bulk Strories download usage example" src="https://github.com/user-attachments/assets/2c8c91ac-6ade-4d1d-a677-2b36bb40ff39"> Instagram Photo bulk Strories download usage example|
250
+ |<img width="700" alt="Instagram specific Story download usage example" src="https://github.com/user-attachments/assets/03dc70c5-6933-4122-9c7c-5f7d734d117b"> Instagram specific Story download usage example|<img width="700" alt="Group chat usage example" src="https://github.com/user-attachments/assets/649fcb1e-785b-4efd-9153-69644c6d898b"> Group chat usage example|
251
+
246
252
 
247
253
  In order to setup your own instance, you will need:
248
254
 
@@ -320,6 +326,16 @@ Check logs
320
326
  ```bash
321
327
  sudo docker compose logs warp_beacon -f
322
328
  ```
329
+ ## Upgrading ##
330
+ If you are using `image-prod` (set in `docker-compose.yml` by default), just rebuild your image:
331
+ ```bash
332
+ cd your_warp_beacon_sources_directory/
333
+ sudo docker compose build --no-cache
334
+ ```
335
+ Recreate existing container:
336
+ ```bash
337
+ sudo docker compose up -d
338
+ ```
323
339
 
324
340
  ## How to install from PIP ##
325
341
 
@@ -2,6 +2,7 @@ ffmpeg-python
2
2
  uvloop
3
3
  tgcrypto
4
4
  pyrogram
5
+ pillow-heif
5
6
  pytubefix
6
7
  av
7
8
  urlextract
@@ -1,2 +0,0 @@
1
- __version__ = "2.0.4"
2
-
File without changes
File without changes
File without changes
File without changes
File without changes