warp-beacon 2.2.58__py3-none-any.whl → 2.2.60__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.
@@ -1,2 +1,2 @@
1
- __version__ = "2.2.58"
1
+ __version__ = "2.2.60"
2
2
 
@@ -74,6 +74,8 @@ class Handlers(object):
74
74
  else:
75
75
  for url in urls:
76
76
  origin = Utils.extract_origin(url)
77
+ if origin is Origin.INSTAGRAM:
78
+ url = Utils.convert_ig_share_link(url)
77
79
  if origin is Origin.YOUTU_BE:
78
80
  url = Utils.extract_youtu_be_link(url)
79
81
  if not url:
@@ -2,6 +2,7 @@ from typing import Union
2
2
 
3
3
  import re
4
4
  import requests
5
+ from urllib.parse import urlparse
5
6
 
6
7
  from pyrogram.types import Message
7
8
 
@@ -57,6 +58,22 @@ class Utils(object):
57
58
  logging.exception(e)
58
59
 
59
60
  return ''
61
+
62
+ @staticmethod
63
+ def convert_ig_share_link(url: str) -> str:
64
+ # expected url: https://www.instagram.com/share/reel/BAHtk2AamB
65
+ # result url: https://www.instagram.com/reel/DAKjQgUNzuH/
66
+ try:
67
+ if "instagram.com/" in url and "share" in url and "reel" in url:
68
+ reel_id = urlparse(url).path.split('/')[-1]
69
+ new_url = f'https://www.instagram.com/reel/{reel_id}/'
70
+ logging.info("Converted IG share link to '%s'", new_url)
71
+ return new_url
72
+ except Exception as e:
73
+ logging.error("Failed to convert IG share link!")
74
+ logging.exception(e)
75
+
76
+ return url
60
77
 
61
78
  @staticmethod
62
79
  def parse_expected_patronum_error(err_text: str) -> tuple:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: warp_beacon
3
- Version: 2.2.58
3
+ Version: 2.2.60
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
@@ -3,7 +3,7 @@ lib/systemd/system/warp_beacon.service,sha256=lPmHqLqcI2eIV7nwHS0qcALQrznixqJuww
3
3
  var/warp_beacon/accounts.json,sha256=2QQMS9N_Z-TnfZq4U1vSUe4IKyZGmTFdgo8BoF4hQ7E,1710
4
4
  var/warp_beacon/placeholder.gif,sha256=cE5CGJVaop4Sx21zx6j4AyoHU0ncmvQuS2o6hJfEH88,6064
5
5
  warp_beacon/__init__.py,sha256=_rThNODmz0nDp_n4mWo_HKaNFE5jk1_7cRhHyYaencI,163
6
- warp_beacon/__version__.py,sha256=hxL9rMkttRVPijKhql_eU_9VotYbWKOmKPnyazxPH-A,24
6
+ warp_beacon/__version__.py,sha256=f-9mgvLj5rWJHBJa_O-3wPxGqTJAU80W2Ab99owqOY0,24
7
7
  warp_beacon/warp_beacon.py,sha256=7KEtZDj-pdhtl6m-zFLsSojs1ZR4o7L0xbqtdmYPvfE,342
8
8
  warp_beacon/compress/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  warp_beacon/compress/video.py,sha256=_PDMVYCyzLYxHv1uZmmzGcG_8rjaZr7BTXsXTTy_oS4,2846
@@ -33,13 +33,13 @@ warp_beacon/scraper/youtube/youtube.py,sha256=JvN5pVz0jtxCY9FGMl1dIg5Ccr2Kulaoxt
33
33
  warp_beacon/storage/__init__.py,sha256=m86MDXBMtZZsTPLI2cD-pM5Xkh2g2NYVvp_dtW8eH0Q,3548
34
34
  warp_beacon/telegram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
35
  warp_beacon/telegram/bot.py,sha256=MONqsxLMJk3jnLFpn1Nfj5w-FSxPNS2Fx9QfaK2S5lw,15446
36
- warp_beacon/telegram/handlers.py,sha256=SyYSDYbHnMpXDqockHTN-8Rg_YimLDfJAOhuubQfyUo,7183
36
+ warp_beacon/telegram/handlers.py,sha256=3VgD719pgJqu46zatL_0M_KzuoIUkW7FYMyLjb0YzaM,7262
37
37
  warp_beacon/telegram/placeholder_message.py,sha256=N1fSL1xbFLF5alhnEvk-xbf3v2A_nLWg6xHtVZTaoiA,6396
38
- warp_beacon/telegram/utils.py,sha256=wSyJJsv1chaK4hqnBP-dDiY1hYD7wFhzBzw5H_AwE88,2450
38
+ warp_beacon/telegram/utils.py,sha256=sg2_BnE7KK9_nn2q1gpiHiW3ATp-bIcDEAn882t3vYc,3050
39
39
  warp_beacon/uploader/__init__.py,sha256=rbfsm_eYcfsBRkiaG0glVgBNtQCEe7cVQTWEIAHz5aw,4763
40
- warp_beacon-2.2.58.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
41
- warp_beacon-2.2.58.dist-info/METADATA,sha256=GlN70xD6DDeOw1TYC5QOt-micJGkg1sCE4qdGGI11M8,21303
42
- warp_beacon-2.2.58.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
43
- warp_beacon-2.2.58.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
44
- warp_beacon-2.2.58.dist-info/top_level.txt,sha256=ALb_Ft_eG-OY4_m0TWUifNUOZsrx483L-zw7G7vqXoc,971
45
- warp_beacon-2.2.58.dist-info/RECORD,,
40
+ warp_beacon-2.2.60.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
41
+ warp_beacon-2.2.60.dist-info/METADATA,sha256=y5WnySOt07ZnqRzFwhuMDKRp55JkxETbqSbiKDCWmvE,21303
42
+ warp_beacon-2.2.60.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
43
+ warp_beacon-2.2.60.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
44
+ warp_beacon-2.2.60.dist-info/top_level.txt,sha256=ALb_Ft_eG-OY4_m0TWUifNUOZsrx483L-zw7G7vqXoc,971
45
+ warp_beacon-2.2.60.dist-info/RECORD,,