warp-beacon 2.2.49__py3-none-any.whl → 2.2.50__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.49"
1
+ __version__ = "2.2.50"
2
2
 
@@ -127,6 +127,13 @@ class YoutubeAbstract(ScraperAbstract):
127
127
 
128
128
  return new_image
129
129
 
130
+ def resize_aspect_ratio(self, image: Image, base_width: int = 320) -> Image:
131
+ wpercent = (base_width / float(image.size[0]))
132
+ hsize = int((float(image.size[1]) * float(wpercent)))
133
+ img = image.resize((base_width, hsize), Image.Resampling.LANCZOS)
134
+
135
+ return img
136
+
130
137
  def aspect_ratio(self, size: tuple) -> tuple:
131
138
  gcd = math.gcd(size[0], size[1])
132
139
  return size[0] // gcd, size[1] // gcd
@@ -145,7 +152,7 @@ class YoutubeAbstract(ScraperAbstract):
145
152
  logging.info("thumb ratio: '%s'", ratio)
146
153
  new_image = None
147
154
  if ratio[1] > 4:
148
- new_image = MediaInfoAbstract.shrink_image_to_fit(image)
155
+ new_image = self.resize_aspect_ratio(image)
149
156
  else:
150
157
  new_image = self.calculate_size_with_padding(image, ratio[0], ratio[1])
151
158
  logging.info("thumb size: '%s'", new_image.size)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: warp_beacon
3
- Version: 2.2.49
3
+ Version: 2.2.50
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=qJga_oz2zss_u4zHzEm5ae7g03axf2jz-F3Jyc8sObU,24
6
+ warp_beacon/__version__.py,sha256=OODlAz5q5V981c-kp20PIW8Q7eYDlOulnrnjoy4V1gQ,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
@@ -26,7 +26,7 @@ warp_beacon/scraper/exceptions.py,sha256=fHywTm2-y2RkgM6hVz12CkDMBgHcEoN2a1TBLaV
26
26
  warp_beacon/scraper/instagram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  warp_beacon/scraper/instagram/instagram.py,sha256=m2bAqLu-_HchlF5CVZDlytB9cFGxrN7EEbQW-G1f5u4,12857
28
28
  warp_beacon/scraper/youtube/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
- warp_beacon/scraper/youtube/abstract.py,sha256=ZLLbxKuYq4nwvDP7yL3zVYqP0p70IiQbYGhvXHoCzwM,7872
29
+ warp_beacon/scraper/youtube/abstract.py,sha256=dMeSkiQYe0c-otglo1LP3CJr51VRgiGGMVYwGDhfxRY,8125
30
30
  warp_beacon/scraper/youtube/music.py,sha256=nbTDFdgXGbTNqttE828DEgvSc8-SuAsQAHeqUwU6yFM,1484
31
31
  warp_beacon/scraper/youtube/shorts.py,sha256=RqMYDq4XHChtp-LdlxXyHej4h3NI3Qi9T8USxwk-pIk,1177
32
32
  warp_beacon/scraper/youtube/youtube.py,sha256=JvN5pVz0jtxCY9FGMl1dIg5Ccr2Kulaoxtym0Vb1QwQ,2224
@@ -37,9 +37,9 @@ warp_beacon/telegram/handlers.py,sha256=SyYSDYbHnMpXDqockHTN-8Rg_YimLDfJAOhuubQf
37
37
  warp_beacon/telegram/placeholder_message.py,sha256=N1fSL1xbFLF5alhnEvk-xbf3v2A_nLWg6xHtVZTaoiA,6396
38
38
  warp_beacon/telegram/utils.py,sha256=wSyJJsv1chaK4hqnBP-dDiY1hYD7wFhzBzw5H_AwE88,2450
39
39
  warp_beacon/uploader/__init__.py,sha256=rbfsm_eYcfsBRkiaG0glVgBNtQCEe7cVQTWEIAHz5aw,4763
40
- warp_beacon-2.2.49.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
41
- warp_beacon-2.2.49.dist-info/METADATA,sha256=rii5P1SdDaOfPeL7yzAFnLJ9izWCharb9KUqNGBLuc0,21251
42
- warp_beacon-2.2.49.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
43
- warp_beacon-2.2.49.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
44
- warp_beacon-2.2.49.dist-info/top_level.txt,sha256=ALb_Ft_eG-OY4_m0TWUifNUOZsrx483L-zw7G7vqXoc,971
45
- warp_beacon-2.2.49.dist-info/RECORD,,
40
+ warp_beacon-2.2.50.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
41
+ warp_beacon-2.2.50.dist-info/METADATA,sha256=fxjq3T07r8LrBLb7u40Ce9fX7DCNAVUYaWRVBYx9ODY,21251
42
+ warp_beacon-2.2.50.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
43
+ warp_beacon-2.2.50.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
44
+ warp_beacon-2.2.50.dist-info/top_level.txt,sha256=ALb_Ft_eG-OY4_m0TWUifNUOZsrx483L-zw7G7vqXoc,971
45
+ warp_beacon-2.2.50.dist-info/RECORD,,