warp-beacon 2.6.72__tar.gz → 2.6.74__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.
- {warp_beacon-2.6.72/warp_beacon.egg-info → warp_beacon-2.6.74}/PKG-INFO +1 -1
- warp_beacon-2.6.74/warp_beacon/__version__.py +2 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scraper/instagram/wb_instagrapi.py +33 -1
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/telegram/progress_bar.py +6 -2
- {warp_beacon-2.6.72 → warp_beacon-2.6.74/warp_beacon.egg-info}/PKG-INFO +1 -1
- warp_beacon-2.6.72/warp_beacon/__version__.py +0 -2
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/LICENSE +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/MANIFEST.in +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/README.md +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/assets/placeholder.gif +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/etc/.gitignore +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/etc/accounts.json +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/etc/proxies.json +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/etc/warp_beacon.conf +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/etc/warp_beacon.service +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/pyproject.toml +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/setup.cfg +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/setup.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/__init__.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/compress/__init__.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/compress/video.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/jobs/__init__.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/jobs/abstract.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/jobs/download_job.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/jobs/types.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/jobs/upload_job.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/mediainfo/__init__.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/mediainfo/abstract.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/mediainfo/audio.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/mediainfo/silencer.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/mediainfo/video.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scheduler/__init__.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scheduler/instagram_human.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scheduler/scheduler.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scraper/__init__.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scraper/abstract.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scraper/account_selector.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scraper/exceptions.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scraper/fail_handler.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scraper/instagram/__init__.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scraper/instagram/captcha.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scraper/instagram/instagram.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scraper/link_resolver.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scraper/utils.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scraper/youtube/__init__.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scraper/youtube/abstract.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scraper/youtube/music.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scraper/youtube/shorts.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/scraper/youtube/youtube.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/storage/__init__.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/storage/mongo.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/telegram/__init__.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/telegram/bot.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/telegram/caption_shortener.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/telegram/download_status.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/telegram/edit_message.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/telegram/handlers.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/telegram/placeholder_message.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/telegram/progress_file_reader.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/telegram/types.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/telegram/utils.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/uploader/__init__.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/warp_beacon.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon/yt_auth.py +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon.egg-info/SOURCES.txt +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon.egg-info/dependency_links.txt +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon.egg-info/entry_points.txt +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon.egg-info/requires.txt +0 -0
- {warp_beacon-2.6.72 → warp_beacon-2.6.74}/warp_beacon.egg-info/top_level.txt +0 -0
@@ -35,7 +35,6 @@ class WBClient(Client):
|
|
35
35
|
content_length = int(response.headers.get("Content-Length", 0))
|
36
36
|
except (TypeError, ValueError):
|
37
37
|
logging.warning("Content-Length header is missing or invalid.")
|
38
|
-
content_length = 0
|
39
38
|
|
40
39
|
downloaded = 0
|
41
40
|
with open(path, "wb") as f:
|
@@ -59,4 +58,37 @@ class WBClient(Client):
|
|
59
58
|
f'Broken file "{path}" (expected {content_length}, got {downloaded})'
|
60
59
|
)
|
61
60
|
|
61
|
+
return path.resolve()
|
62
|
+
|
63
|
+
def photo_download_by_url(
|
64
|
+
self, url: str, filename: str = "", folder: Path = ""
|
65
|
+
) -> Path:
|
66
|
+
fname = urlparse(url).path.rsplit("/", 1)[1]
|
67
|
+
filename = f"{filename}.{(filename, fname.rsplit('.', 1)[1]) if filename else fname}"
|
68
|
+
path = Path(folder) / filename
|
69
|
+
response = requests.get(url, stream=True, timeout=self.request_timeout)
|
70
|
+
response.raise_for_status()
|
71
|
+
|
72
|
+
content_length = 0
|
73
|
+
try:
|
74
|
+
content_length = int(response.headers.get("Content-Length", 0))
|
75
|
+
except (TypeError, ValueError):
|
76
|
+
logging.warning("Content-Length header is missing or invalid.")
|
77
|
+
|
78
|
+
downloaded = 0
|
79
|
+
with open(path, "wb") as f:
|
80
|
+
response.raw.decode_content = True
|
81
|
+
for chunk in response.iter_content(chunk_size=4096):
|
82
|
+
if chunk:
|
83
|
+
f.write(chunk)
|
84
|
+
downloaded += len(chunk)
|
85
|
+
if self.progress_callback:
|
86
|
+
try:
|
87
|
+
self.progress_callback(
|
88
|
+
total=content_length or None,
|
89
|
+
bytes_transferred=downloaded,
|
90
|
+
path=path
|
91
|
+
)
|
92
|
+
except Exception as e:
|
93
|
+
logging.warning("Progress callback raised an exception!", exc_info=e)
|
62
94
|
return path.resolve()
|
@@ -9,6 +9,8 @@ from pyrogram import Client
|
|
9
9
|
from warp_beacon.telegram.types import ReportType
|
10
10
|
|
11
11
|
class ProgressBar(object):
|
12
|
+
MAX_PROGRESS_RENDER_SIZE = 30_000_000
|
13
|
+
|
12
14
|
def __init__(self, client: Client) -> None:
|
13
15
|
self._next_threshold = 20
|
14
16
|
self.client = client
|
@@ -90,6 +92,8 @@ class ProgressBar(object):
|
|
90
92
|
logging.exception(e)
|
91
93
|
|
92
94
|
def render_progress_bar(self, current: int, total: int, chat_id: int | str, message_id: int, operation: str, label: str = "") -> None:
|
95
|
+
if total <= self.MAX_PROGRESS_RENDER_SIZE:
|
96
|
+
return
|
93
97
|
percent = 0
|
94
98
|
if total:
|
95
99
|
percent = round(current * 100 / (total or 1))
|
@@ -111,8 +115,8 @@ class ProgressBar(object):
|
|
111
115
|
self.client.edit_message_caption(chat_id, message_id, text, ParseMode.HTML)
|
112
116
|
)
|
113
117
|
task.add_done_callback(self._on_edit_done)
|
114
|
-
except MessageNotModified:
|
115
|
-
|
118
|
+
#except MessageNotModified:
|
119
|
+
# logging.warning("bad_request_400.MessageNotModified")
|
116
120
|
except Exception as e:
|
117
121
|
logging.warning("An error occurred while setup task to update progress bar")
|
118
122
|
logging.exception(e)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|