warp-beacon 2.3.25__tar.gz → 2.3.26__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 (59) hide show
  1. {warp_beacon-2.3.25/warp_beacon.egg-info → warp_beacon-2.3.26}/PKG-INFO +1 -1
  2. warp_beacon-2.3.26/warp_beacon/__version__.py +2 -0
  3. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/telegram/bot.py +7 -5
  4. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/telegram/handlers.py +4 -0
  5. {warp_beacon-2.3.25 → warp_beacon-2.3.26/warp_beacon.egg-info}/PKG-INFO +1 -1
  6. warp_beacon-2.3.25/warp_beacon/__version__.py +0 -2
  7. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/LICENSE +0 -0
  8. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/MANIFEST.in +0 -0
  9. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/README.md +0 -0
  10. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/assets/placeholder.gif +0 -0
  11. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/etc/.gitignore +0 -0
  12. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/etc/accounts.json +0 -0
  13. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/etc/proxies.json +0 -0
  14. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/etc/warp_beacon.conf +0 -0
  15. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/etc/warp_beacon.service +0 -0
  16. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/pyproject.toml +0 -0
  17. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/setup.cfg +0 -0
  18. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/setup.py +0 -0
  19. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/__init__.py +0 -0
  20. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/compress/__init__.py +0 -0
  21. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/compress/video.py +0 -0
  22. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/jobs/__init__.py +0 -0
  23. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/jobs/abstract.py +0 -0
  24. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/jobs/download_job.py +0 -0
  25. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/jobs/types.py +0 -0
  26. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/jobs/upload_job.py +0 -0
  27. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/mediainfo/__init__.py +0 -0
  28. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/mediainfo/abstract.py +0 -0
  29. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/mediainfo/audio.py +0 -0
  30. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/mediainfo/silencer.py +0 -0
  31. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/mediainfo/video.py +0 -0
  32. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/scheduler/__init__.py +0 -0
  33. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/scheduler/scheduler.py +0 -0
  34. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/scraper/__init__.py +0 -0
  35. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/scraper/abstract.py +0 -0
  36. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/scraper/account_selector.py +0 -0
  37. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/scraper/exceptions.py +0 -0
  38. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/scraper/fail_handler.py +0 -0
  39. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/scraper/instagram/__init__.py +0 -0
  40. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/scraper/instagram/instagram.py +0 -0
  41. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/scraper/link_resolver.py +0 -0
  42. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/scraper/youtube/__init__.py +0 -0
  43. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/scraper/youtube/abstract.py +0 -0
  44. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/scraper/youtube/music.py +0 -0
  45. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/scraper/youtube/shorts.py +0 -0
  46. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/scraper/youtube/youtube.py +0 -0
  47. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/storage/__init__.py +0 -0
  48. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/storage/mongo.py +0 -0
  49. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/telegram/__init__.py +0 -0
  50. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/telegram/caption_shortener.py +0 -0
  51. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/telegram/placeholder_message.py +0 -0
  52. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/telegram/utils.py +0 -0
  53. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/uploader/__init__.py +0 -0
  54. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon/warp_beacon.py +0 -0
  55. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon.egg-info/SOURCES.txt +0 -0
  56. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon.egg-info/dependency_links.txt +0 -0
  57. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon.egg-info/entry_points.txt +0 -0
  58. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon.egg-info/requires.txt +0 -0
  59. {warp_beacon-2.3.25 → warp_beacon-2.3.26}/warp_beacon.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: warp_beacon
3
- Version: 2.3.25
3
+ Version: 2.3.26
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.3.26"
2
+
@@ -1,5 +1,6 @@
1
1
  import os
2
2
  import signal
3
+ from typing import Optional
3
4
 
4
5
  import html
5
6
 
@@ -167,7 +168,8 @@ class Bot(object):
167
168
  caption = f"{html.escape(CaptionShortner.smart_truncate_html(job.canonical_name))} ..."
168
169
  job.short_text = True
169
170
  else:
170
- caption = f"<b>{html.escape(job.canonical_name)}</b>"
171
+ #caption = f"<b>{html.escape(job.canonical_name)}</b>"
172
+ return "" # may be too long so empty, no needed
171
173
  if is_group:
172
174
  if job.canonical_name:
173
175
  caption += "\n—\n"
@@ -347,6 +349,7 @@ class Bot(object):
347
349
  if job.media_type is not JobType.COLLECTION:
348
350
  render_donates = os.environ.get("ENABLE_DONATES", None) == "true"
349
351
  keyboard_buttons = [[]]
352
+ # short_text is True only for groups
350
353
  if job.short_text:
351
354
  keyboard_buttons[0].append(InlineKeyboardButton("📖 Read more", callback_data=f"read_more:{job.job_origin.value}:{job.uniq_id}"))
352
355
  if render_donates:
@@ -417,10 +420,9 @@ class Bot(object):
417
420
  elif msg.photo:
418
421
  tg_file_ids.append(msg.photo.file_id + ':image')
419
422
  logging.info("Uploaded to Telegram")
420
- #TODO send message with caption if request from private chat
421
- #if job.chat_type not in (ChatType.GROUP, ChatType.SUPERGROUP):
422
- # if job.canonical_name:
423
- # self.client.send_message()
423
+ if job.chat_type not in (ChatType.GROUP, ChatType.SUPERGROUP):
424
+ if job.canonical_name:
425
+ await self.send_text(chat_id=job.user_id, text=job.canonical_name)
424
426
  break
425
427
  except MultiMediaTooLong as e:
426
428
  logging.error("Failed to upload due telegram limitations :(")
@@ -38,6 +38,7 @@ class Handlers(object):
38
38
  UploadJob(
39
39
  tg_file_id=d["tg_file_id"],
40
40
  chat_id=message.chat.id,
41
+ user_id=message.from_user.id,
41
42
  media_type=JobType[d["media_type"].upper()],
42
43
  message_id=message.id,
43
44
  chat_type=message.chat.type,
@@ -179,6 +180,7 @@ class Handlers(object):
179
180
  message_id=effective_message_id,
180
181
  media_type=JobType.COLLECTION,
181
182
  chat_id=chat.id,
183
+ user_id=message.from_user.id,
182
184
  chat_type=message.chat.type,
183
185
  source_username=Utils.extract_message_author(message),
184
186
  message_leftover=msg_leftover
@@ -196,6 +198,7 @@ class Handlers(object):
196
198
  message_id=effective_message_id,
197
199
  media_type=media_type,
198
200
  chat_id=chat.id,
201
+ user_id=message.from_user.id,
199
202
  chat_type=message.chat.type,
200
203
  source_username=Utils.extract_message_author(message),
201
204
  canonical_name=canonical_name,
@@ -207,6 +210,7 @@ class Handlers(object):
207
210
  url=url,
208
211
  message_id=effective_message_id,
209
212
  chat_id=chat.id,
213
+ user_id=message.from_user.id,
210
214
  in_process=self.bot.uploader.is_inprocess(uniq_id),
211
215
  uniq_id=uniq_id,
212
216
  job_origin=origin,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: warp_beacon
3
- Version: 2.3.25
3
+ Version: 2.3.26
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.3.25"
2
-
File without changes
File without changes
File without changes
File without changes
File without changes