warp-beacon 2.2.18__py3-none-any.whl → 2.2.20__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.
- warp_beacon/__version__.py +1 -1
- warp_beacon/scraper/instagram/instagram.py +4 -0
- warp_beacon/scraper/youtube/abstract.py +13 -14
- warp_beacon/telegram/bot.py +2 -2
- {warp_beacon-2.2.18.dist-info → warp_beacon-2.2.20.dist-info}/METADATA +1 -1
- {warp_beacon-2.2.18.dist-info → warp_beacon-2.2.20.dist-info}/RECORD +10 -10
- {warp_beacon-2.2.18.dist-info → warp_beacon-2.2.20.dist-info}/LICENSE +0 -0
- {warp_beacon-2.2.18.dist-info → warp_beacon-2.2.20.dist-info}/WHEEL +0 -0
- {warp_beacon-2.2.18.dist-info → warp_beacon-2.2.20.dist-info}/entry_points.txt +0 -0
- {warp_beacon-2.2.18.dist-info → warp_beacon-2.2.20.dist-info}/top_level.txt +0 -0
warp_beacon/__version__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
__version__ = "2.2.
|
1
|
+
__version__ = "2.2.20"
|
2
2
|
|
@@ -89,6 +89,7 @@ class InstagramScraper(ScraperAbstract):
|
|
89
89
|
self.load_session()
|
90
90
|
self._download_hndlr(self.cl.get_timeline_feed)
|
91
91
|
self._download_hndlr(self.cl.get_reels_tray_feed)
|
92
|
+
self.safe_write_session()
|
92
93
|
|
93
94
|
def scrap(self, url: str) -> tuple[str]:
|
94
95
|
self.load_session()
|
@@ -283,6 +284,9 @@ class InstagramScraper(ScraperAbstract):
|
|
283
284
|
raise NotFound(extract_exception_message(e))
|
284
285
|
except IGUnknownError as e:
|
285
286
|
raise UnknownError(extract_exception_message(e))
|
287
|
+
|
288
|
+
self.safe_write_session()
|
289
|
+
|
286
290
|
return res
|
287
291
|
|
288
292
|
def email_challenge_resolver(self, username: str) -> Optional[str]:
|
@@ -104,30 +104,26 @@ class YoutubeAbstract(ScraperAbstract):
|
|
104
104
|
os.unlink("%s/%s" % (self.DOWNLOAD_DIR, i))
|
105
105
|
|
106
106
|
def calculate_size_with_padding(self, image: Image, aspect_ratio_width: int, aspect_ratio_height: int, target_size: tuple=(320, 320), background_color: tuple=(0, 0, 0)) -> Image:
|
107
|
-
# aspect ratio
|
108
107
|
aspect_ratio = aspect_ratio_width / aspect_ratio_height
|
109
|
-
|
110
|
-
# Target size
|
111
108
|
target_width, target_height = target_size
|
112
|
-
|
113
|
-
# Calculate start sizes bases on min height
|
109
|
+
|
114
110
|
height = target_height
|
115
111
|
width = int(height * aspect_ratio)
|
116
|
-
|
117
|
-
# reduce width if target width exceeds
|
112
|
+
|
118
113
|
if width > target_width:
|
119
114
|
width = target_width
|
120
115
|
height = int(width / aspect_ratio)
|
121
|
-
|
122
|
-
# create new image with color and size 320x320
|
116
|
+
|
123
117
|
new_image = Image.new("RGB", target_size, background_color)
|
124
|
-
|
125
|
-
|
118
|
+
image.thumbnail(target_size, Image.Resampling.LANCZOS)
|
119
|
+
|
120
|
+
if aspect_ratio_height > 4:
|
121
|
+
image = image.resize((image.size[0], image.size[1]+new_image.size[1]))
|
122
|
+
height += new_image.size[1] - 20
|
123
|
+
|
126
124
|
paste_position = ((target_width - width) // 2, (target_height - height) // 2)
|
127
|
-
|
128
|
-
# pasting image to center
|
129
125
|
new_image.paste(image, paste_position)
|
130
|
-
|
126
|
+
|
131
127
|
return new_image
|
132
128
|
|
133
129
|
def aspect_ratio(self, size: tuple) -> tuple:
|
@@ -145,9 +141,12 @@ class YoutubeAbstract(ScraperAbstract):
|
|
145
141
|
if response.status_code == 200:
|
146
142
|
image = Image.open(io.BytesIO(response.content))
|
147
143
|
ratio = self.aspect_ratio(image.size)
|
144
|
+
logging.info("thumb ratio: '%s'", ratio)
|
148
145
|
new_image = self.calculate_size_with_padding(image, ratio[0], ratio[1])
|
146
|
+
logging.info("thumb size: '%s'", new_image.size)
|
149
147
|
io_buf = io.BytesIO()
|
150
148
|
new_image.save(io_buf, format='JPEG', subsampling=0, quality=100, progressive=True, optimize=False)
|
149
|
+
logging.info("thumb size: %d kb", io_buf.getbuffer().nbytes / 1024)
|
151
150
|
io_buf.seek(0)
|
152
151
|
return io_buf
|
153
152
|
except Exception as e:
|
warp_beacon/telegram/bot.py
CHANGED
@@ -319,8 +319,8 @@ class Bot(object):
|
|
319
319
|
args["message_id"] = job.placeholder_message_id
|
320
320
|
else:
|
321
321
|
args["disable_notification"] = True
|
322
|
-
|
323
|
-
args["reply_to_message_id"] = None
|
322
|
+
args["reply_to_message_id"] = job.message_id
|
323
|
+
#args["reply_to_message_id"] = None
|
324
324
|
|
325
325
|
if os.environ.get("ENABLE_DONATES", None) == "true" and job.media_type is not JobType.COLLECTION:
|
326
326
|
args["reply_markup"] = InlineKeyboardMarkup([[InlineKeyboardButton("❤ Donate", url=os.environ.get("DONATE_LINK", "https://pay.cryptocloud.plus/pos/W5BMtNQt5bJFoW2E"))]])
|
@@ -3,7 +3,7 @@ lib/systemd/system/warp_beacon.service,sha256=lPmHqLqcI2eIV7nwHS0qcALQrznixqJuww
|
|
3
3
|
var/warp_beacon/accounts.json,sha256=rKFQM_b9eoDS4mJ1B_SZNolPLXx1SQdQMdY2F_ZcBt8,1523
|
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=
|
6
|
+
warp_beacon/__version__.py,sha256=38sfP7Lu9Of5HWXTQY6o7kDDCpFWGf6gtyZtFj6oxIw,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
|
@@ -24,22 +24,22 @@ warp_beacon/scraper/abstract.py,sha256=aNZ9ypF9B8BjflcIwi-7wEzIqF-XPeF0xvfX9CP_i
|
|
24
24
|
warp_beacon/scraper/account_selector.py,sha256=x1TAqHVWtxvhzKCTBERpHoUJ0fOcnswStQjEcDxkrFU,2960
|
25
25
|
warp_beacon/scraper/exceptions.py,sha256=lHsPrYy5iYnHsIdUHqRxZmzlqrkNj_TS4TkiTJfWhTs,1326
|
26
26
|
warp_beacon/scraper/instagram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
27
|
-
warp_beacon/scraper/instagram/instagram.py,sha256=
|
27
|
+
warp_beacon/scraper/instagram/instagram.py,sha256=PpEammUP_InX5xj-sFJY6DkAUfIut2rqQsXd0uCtKOo,13579
|
28
28
|
warp_beacon/scraper/youtube/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
29
|
-
warp_beacon/scraper/youtube/abstract.py,sha256
|
29
|
+
warp_beacon/scraper/youtube/abstract.py,sha256=_D6NecCWlIO-Lt-t495hvpAeJrrc6f2zctrUqSVH-JQ,7635
|
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
|
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
|
-
warp_beacon/telegram/bot.py,sha256=
|
35
|
+
warp_beacon/telegram/bot.py,sha256=KAdtL-Fc0Jw0aztk8FtefCLPao7UP0gJkHMC5_mHJvs,15387
|
36
36
|
warp_beacon/telegram/handlers.py,sha256=xSNG_v4D4FaA5q1_5wXvJkjcDUhy5GaQnfpijJZpnPk,7039
|
37
37
|
warp_beacon/telegram/placeholder_message.py,sha256=32U-R_IMPRJd-S5UwlpemLkArJOxCmO7whcynduSbMA,6418
|
38
38
|
warp_beacon/telegram/utils.py,sha256=CeWXMwyzv2l4Af6I-wW2ySU490c-5k82sBhkjabv0n4,2452
|
39
39
|
warp_beacon/uploader/__init__.py,sha256=rsUkzzmtaeQY-kNkcIiPsrayS9idFKY3hBC71mR19XE,4743
|
40
|
-
warp_beacon-2.2.
|
41
|
-
warp_beacon-2.2.
|
42
|
-
warp_beacon-2.2.
|
43
|
-
warp_beacon-2.2.
|
44
|
-
warp_beacon-2.2.
|
45
|
-
warp_beacon-2.2.
|
40
|
+
warp_beacon-2.2.20.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
41
|
+
warp_beacon-2.2.20.dist-info/METADATA,sha256=xGyRi5aCA8PEx-CXdhAAW-HP3jGlRtCVc8gljODofLU,21251
|
42
|
+
warp_beacon-2.2.20.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
43
|
+
warp_beacon-2.2.20.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
|
44
|
+
warp_beacon-2.2.20.dist-info/top_level.txt,sha256=ALb_Ft_eG-OY4_m0TWUifNUOZsrx483L-zw7G7vqXoc,971
|
45
|
+
warp_beacon-2.2.20.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|