warp-beacon 2.6.50__py3-none-any.whl → 2.6.51__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.6.50"
1
+ __version__ = "2.6.51"
2
2
 
@@ -1,18 +1,15 @@
1
1
  import os
2
2
  import pathlib
3
-
4
- import socket
5
- import requests.packages.urllib3.util.connection as urllib3_cn
6
- import multiprocessing
7
-
8
3
  from abc import ABC, abstractmethod
9
4
  from typing import Callable, Union
5
+ import logging
6
+ import multiprocessing
7
+ import socket
8
+ import requests.packages.urllib3.util.connection as urllib3_cn
10
9
 
11
10
  from PIL import Image
12
11
  from pillow_heif import register_heif_opener
13
12
 
14
- import logging
15
-
16
13
  class ScraperAbstract(ABC):
17
14
  original_gai_family = None
18
15
  send_message_to_admin_func: Callable = lambda: None
@@ -48,8 +45,8 @@ class ScraperAbstract(ABC):
48
45
  if os.path.exists(src_file):
49
46
  path_info = pathlib.Path(src_file)
50
47
  old_filename = path_info.stem
51
- new_filename = "%s_converted.%s" % (old_filename, "png")
52
- new_filepath = "%s/%s" % (os.path.dirname(src_file), new_filename)
48
+ new_filename = f"{old_filename}_converted.png"
49
+ new_filepath = f"{os.path.dirname(src_file)}/{new_filename}"
53
50
  with Image.open(src_file).convert('RGB') as img:
54
51
  img.save(new_filepath, 'png')
55
52
  os.unlink(src_file)
@@ -67,8 +64,8 @@ class ScraperAbstract(ABC):
67
64
  register_heif_opener()
68
65
  path_info = pathlib.Path(src_file)
69
66
  old_filename = path_info.stem
70
- new_filename = "%s_converted.%s" % (old_filename, "png")
71
- new_filepath = "%s/%s" % (os.path.dirname(src_file), new_filename)
67
+ new_filename = f"{old_filename}_converted.png"
68
+ new_filepath = f"{os.path.dirname(src_file)}/{new_filename}"
72
69
  with Image.open(src_file).convert('RGB') as img:
73
70
  img.save(new_filepath, 'png')
74
71
  os.unlink(src_file)
@@ -232,8 +232,10 @@ class YoutubeAbstract(ScraperAbstract):
232
232
  return ret_val
233
233
 
234
234
  def yt_on_progress(self, stream: Stream, chunk: bytes, bytes_remaining: int) -> None:
235
- pass
236
- #logging.info("bytes: %d, bytes remaining: %d", chunk, bytes_remaining)
235
+ total_size = stream.filesize or stream.filesize_approx
236
+ bytes_downloaded = total_size - bytes_remaining
237
+ percentage_of_completion = bytes_downloaded / total_size * 100
238
+ logging.info("Downloaded %d%%", percentage_of_completion)
237
239
 
238
240
  def build_proxies(self, proxy_dsn: str) -> dict:
239
241
  if not proxy_dsn:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: warp_beacon
3
- Version: 2.6.50
3
+ Version: 2.6.51
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
@@ -4,7 +4,7 @@ var/warp_beacon/accounts.json,sha256=OsXdncs6h88xrF_AP6_WDCK1waGBn9SR-uYdIeK37GM
4
4
  var/warp_beacon/placeholder.gif,sha256=cE5CGJVaop4Sx21zx6j4AyoHU0ncmvQuS2o6hJfEH88,6064
5
5
  var/warp_beacon/proxies.json,sha256=VnjlQDXumOEq72ZFjbh6IqHS1TEHqn8HPYAZqWCeSIA,95
6
6
  warp_beacon/__init__.py,sha256=_rThNODmz0nDp_n4mWo_HKaNFE5jk1_7cRhHyYaencI,163
7
- warp_beacon/__version__.py,sha256=10yJziM5HibsQDK7LaH5t5_wCFrNjAQKMngdwAzByz8,24
7
+ warp_beacon/__version__.py,sha256=97aVkVvphE-RNmc19iil89QyOmg2AptM2VnjP0DOdho,24
8
8
  warp_beacon/warp_beacon.py,sha256=ED43vNzdjDUJ_9qLCbri0bjWLWEJ69BENGj9i7G6AvM,342
9
9
  warp_beacon/yt_auth.py,sha256=GUTKqYr_tzDC-07Lx_ahWXSag8EyLxXBUnQbDBIkEmk,6022
10
10
  warp_beacon/compress/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -23,7 +23,7 @@ warp_beacon/scheduler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
23
23
  warp_beacon/scheduler/instagram_human.py,sha256=0LaRUu0MBBuEOQeFzuq22HIYfJL9pTK_7udsXfef0Fk,8204
24
24
  warp_beacon/scheduler/scheduler.py,sha256=9OCh7Ta4wY_aTHGAOOZmaKXg56Ftx1N_aV1g6E3ZLKA,4941
25
25
  warp_beacon/scraper/__init__.py,sha256=NAx81O85yP0vUP1uZ9VHZlXh-zZgN_LHm7gWcU5BV18,19982
26
- warp_beacon/scraper/abstract.py,sha256=yP76ae9U73LYW2lDN6XWkXDkWX1h2UVOrkqv0Sqpu2Y,2985
26
+ warp_beacon/scraper/abstract.py,sha256=lra97QidGcSvoXgQh2-aGAO-DAgQU_u-ORQJ3BY-un4,2950
27
27
  warp_beacon/scraper/account_selector.py,sha256=-tAbOIbM7sC9QafsgSe64RCWXewRO-RehEYsYSB3HGo,9727
28
28
  warp_beacon/scraper/exceptions.py,sha256=EKwoF0oH2xZWbNU-v8DOaWK5skKwa3s1yTIBdlcfMpc,1452
29
29
  warp_beacon/scraper/fail_handler.py,sha256=zcPK3ZVEsu6JmHYcWP7L3naTRK3gWFVRkpP84VBOtJs,964
@@ -33,7 +33,7 @@ warp_beacon/scraper/instagram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
33
33
  warp_beacon/scraper/instagram/captcha.py,sha256=9UYziuqB3Tsat_ET6ex-cnZDbi6yCnsXHSpmE8MuUHk,4651
34
34
  warp_beacon/scraper/instagram/instagram.py,sha256=zbkF-1lU5lxJ_2m8i8mGRX0EQMLVSflsOafBM1FEC6s,15588
35
35
  warp_beacon/scraper/youtube/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
- warp_beacon/scraper/youtube/abstract.py,sha256=QUSHR3aJjIykuRlBpGnmw3tq3m82AQeeZeWQUdJRvgQ,12538
36
+ warp_beacon/scraper/youtube/abstract.py,sha256=-7ha34z6bWc5rA7BZdA3x3Mw9ELghGYoHklDbZQYgTo,12689
37
37
  warp_beacon/scraper/youtube/music.py,sha256=5AeSBQyUgVCJT2hoBCV2WvlyuV9US09SYJhmBG_P9F8,2755
38
38
  warp_beacon/scraper/youtube/shorts.py,sha256=1GtoYUlxAwcgSQcn80u5ehNJytH5AN5dPOicmX-XD8E,1705
39
39
  warp_beacon/scraper/youtube/youtube.py,sha256=x9v9p1coA9TvBhxjNAofGu4UBkAEdYPE2ePRnU-5tK0,7233
@@ -49,9 +49,9 @@ warp_beacon/telegram/progress_bar.py,sha256=KcS-cswDo-sShgOKionqNEpexs-o9e4qqFAt
49
49
  warp_beacon/telegram/progress_file_reader.py,sha256=e3equyNKlKs764AD-iE9QRsh3YDHTzP78Mx5tdvPPWs,969
50
50
  warp_beacon/telegram/utils.py,sha256=1Lq67aRylVJzbwSyvAgjPAGjJZFATkICvAj3TJGuJiM,4635
51
51
  warp_beacon/uploader/__init__.py,sha256=j3qcuKhpchseZLGzSsSiogqe6WdMbkK8d3I-ConhNRs,5687
52
- warp_beacon-2.6.50.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
53
- warp_beacon-2.6.50.dist-info/METADATA,sha256=Wovu5bRAbMvMY4GZxnBrqI3o3HN8jCep3Rb3xM1m3-4,22706
54
- warp_beacon-2.6.50.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
55
- warp_beacon-2.6.50.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
56
- warp_beacon-2.6.50.dist-info/top_level.txt,sha256=pYstFq5qRCQuQc4fOAAc1ti5UwsYldTREx7h2dNplI4,1297
57
- warp_beacon-2.6.50.dist-info/RECORD,,
52
+ warp_beacon-2.6.51.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
53
+ warp_beacon-2.6.51.dist-info/METADATA,sha256=vVqQnB1spafaejdnk_OxfPCvZyB8vj4zHHXBt6qFzWQ,22706
54
+ warp_beacon-2.6.51.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
55
+ warp_beacon-2.6.51.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
56
+ warp_beacon-2.6.51.dist-info/top_level.txt,sha256=pYstFq5qRCQuQc4fOAAc1ti5UwsYldTREx7h2dNplI4,1297
57
+ warp_beacon-2.6.51.dist-info/RECORD,,