warp-beacon 2.7.6__tar.gz → 2.7.8__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.7.6/warp_beacon.egg-info → warp_beacon-2.7.8}/PKG-INFO +1 -1
- warp_beacon-2.7.8/warp_beacon/__version__.py +2 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scraper/__init__.py +5 -5
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scraper/instagram/instagram.py +8 -7
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scraper/youtube/abstract.py +3 -3
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/telegram/handlers.py +3 -1
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/telegram/progress_bar.py +2 -2
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/telegram/utils.py +17 -2
- {warp_beacon-2.7.6 → warp_beacon-2.7.8/warp_beacon.egg-info}/PKG-INFO +1 -1
- warp_beacon-2.7.6/warp_beacon/__version__.py +0 -2
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/LICENSE +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/MANIFEST.in +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/README.md +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/assets/cc-group-black.png +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/assets/placeholder.gif +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/etc/.gitignore +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/etc/accounts.json +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/etc/proxies.json +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/etc/warp_beacon.conf +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/etc/warp_beacon.service +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/pyproject.toml +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/setup.cfg +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/setup.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/__init__.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/compress/__init__.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/compress/video.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/jobs/__init__.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/jobs/abstract.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/jobs/download_job.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/jobs/types.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/jobs/upload_job.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/mediainfo/__init__.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/mediainfo/abstract.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/mediainfo/audio.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/mediainfo/silencer.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/mediainfo/video.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scheduler/__init__.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scheduler/instagram_human.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scheduler/scheduler.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scraper/abstract.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scraper/account_selector.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scraper/exceptions.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scraper/fail_handler.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scraper/instagram/__init__.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scraper/instagram/captcha.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scraper/instagram/wb_instagrapi.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scraper/link_resolver.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scraper/utils.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scraper/youtube/__init__.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scraper/youtube/music.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scraper/youtube/shorts.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/scraper/youtube/youtube.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/storage/__init__.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/storage/mongo.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/telegram/__init__.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/telegram/bot.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/telegram/caption_shortener.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/telegram/download_status.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/telegram/edit_message.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/telegram/placeholder_message.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/telegram/progress_file_reader.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/telegram/types.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/uploader/__init__.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/warp_beacon.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon/yt_auth.py +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon.egg-info/SOURCES.txt +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon.egg-info/dependency_links.txt +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon.egg-info/entry_points.txt +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon.egg-info/requires.txt +0 -0
- {warp_beacon-2.7.6 → warp_beacon-2.7.8}/warp_beacon.egg-info/top_level.txt +0 -0
@@ -290,14 +290,14 @@ class AsyncDownloader(object):
|
|
290
290
|
break
|
291
291
|
self.send_message_to_admin(
|
292
292
|
f"Task <code>{job.job_id}</code> failed. URL: {job.url}. Reason: '<b>UnknownError</b>'."
|
293
|
-
f"Exception:\n<pre code=\"python\">{exception_msg}
|
293
|
+
f"Exception:\n<pre code=\"python\">{exception_msg}\n</pre>"
|
294
294
|
)
|
295
295
|
self.uploader.queue_task(job.to_upload_job(
|
296
296
|
job_failed=True,
|
297
|
-
job_failed_msg=f"Unknown error
|
298
|
-
f"Task <code>{job.job_id}</code> failed. URL: {job.url}
|
299
|
-
f"Reason: '<b>UnknownError</b>'
|
300
|
-
f"Exception
|
297
|
+
job_failed_msg=f"Unknown error occurred. Please <a href=\"https://github.com/sb0y/warp_beacon/issues\">create issue</a> with service logs.\n"
|
298
|
+
f"Task <code>{job.job_id}</code> failed. URL: {job.url}.\n"
|
299
|
+
f"Reason: '<b>UnknownError</b>'.\n"
|
300
|
+
f"Exception:\n<pre code=\"python\">{exception_msg}</pre>"
|
301
301
|
))
|
302
302
|
break
|
303
303
|
finally:
|
@@ -42,7 +42,7 @@ class InstagramScraper(ScraperAbstract):
|
|
42
42
|
client_session_id = ""
|
43
43
|
|
44
44
|
def __init__(self, client_session_id: str, account: tuple, proxy: dict=None) -> None:
|
45
|
-
self._download_progress_threshold =
|
45
|
+
self._download_progress_threshold = 0
|
46
46
|
self.client_session_id = client_session_id
|
47
47
|
super().__init__(account, proxy)
|
48
48
|
#
|
@@ -145,17 +145,18 @@ class InstagramScraper(ScraperAbstract):
|
|
145
145
|
def scrap(self, url: str) -> tuple[str]:
|
146
146
|
self.load_session()
|
147
147
|
def _scrap() -> tuple[str]:
|
148
|
-
|
148
|
+
path = urlparse(url).path
|
149
|
+
slash_count = path.count('/')
|
150
|
+
if "stories" in url or slash_count == 1:
|
149
151
|
# remove URL options
|
150
|
-
_url = urljoin(url,
|
152
|
+
_url = urljoin(url, path)
|
151
153
|
url_last_part = list(filter(None, _url.split('/')))[-1]
|
152
154
|
logging.debug("url last part: '%s'", url_last_part)
|
153
155
|
if url_last_part.isnumeric():
|
154
156
|
return "story", self.scrap_story(url)
|
155
|
-
|
157
|
+
elif slash_count in (1, 2):
|
156
158
|
return "stories", url_last_part
|
157
|
-
|
158
|
-
return "media", self.scrap_media(url)
|
159
|
+
return "media", self.scrap_media(url)
|
159
160
|
try:
|
160
161
|
return _scrap()
|
161
162
|
except exceptions.LoginRequired as e:
|
@@ -474,7 +475,7 @@ class InstagramScraper(ScraperAbstract):
|
|
474
475
|
"report_type": ReportType.PROGRESS
|
475
476
|
}
|
476
477
|
self.status_pipe.send(msg)
|
477
|
-
self._download_progress_threshold +=
|
478
|
+
self._download_progress_threshold += 10
|
478
479
|
|
479
480
|
def report_seen(self, items: dict) -> None:
|
480
481
|
try:
|
@@ -37,7 +37,7 @@ class YoutubeAbstract(ScraperAbstract):
|
|
37
37
|
|
38
38
|
def __init__(self, account: tuple, proxy: dict=None) -> None:
|
39
39
|
super().__init__(account, proxy)
|
40
|
-
self._download_progress_threshold =
|
40
|
+
self._download_progress_threshold = 0
|
41
41
|
|
42
42
|
def validate_session(self) -> int:
|
43
43
|
try:
|
@@ -245,7 +245,7 @@ class YoutubeAbstract(ScraperAbstract):
|
|
245
245
|
self.status_pipe.send(msg)
|
246
246
|
logging.debug("[Download worker] Downloaded %d%%", percentage_of_completion)
|
247
247
|
if total_size > 0:
|
248
|
-
self._download_progress_threshold +=
|
248
|
+
self._download_progress_threshold += 10
|
249
249
|
|
250
250
|
def build_proxies(self, proxy_dsn: str) -> dict:
|
251
251
|
if not proxy_dsn:
|
@@ -310,7 +310,7 @@ class YoutubeAbstract(ScraperAbstract):
|
|
310
310
|
self.status_pipe.send(msg)
|
311
311
|
logging.debug("[Download worker][yt_dlp] Downloaded %d%%", percentage_of_completion)
|
312
312
|
if total_size > 0:
|
313
|
-
self._download_progress_threshold +=
|
313
|
+
self._download_progress_threshold += 10
|
314
314
|
|
315
315
|
def build_yt_dlp(self, timeout: int = 60) -> yt_dlp.YoutubeDL:
|
316
316
|
auth_data = {}
|
@@ -148,10 +148,12 @@ class Handlers(object):
|
|
148
148
|
msg_leftover = await Utils.handle_mentions(chat.id, client, msg_leftover)
|
149
149
|
# remove duplicates
|
150
150
|
urls = list(set(urls_raw))
|
151
|
+
# remove links without paths
|
152
|
+
urls = Utils.remove_links_wo_paths(urls)
|
151
153
|
|
152
154
|
reply_text = "Wut?"
|
153
155
|
if not urls:
|
154
|
-
reply_text = "Your message should
|
156
|
+
reply_text = "Your message should contain URLs"
|
155
157
|
else:
|
156
158
|
for url in urls:
|
157
159
|
origin = Utils.extract_origin(url)
|
@@ -12,7 +12,7 @@ class ProgressBar(object):
|
|
12
12
|
MAX_PROGRESS_RENDER_SIZE = 1_500_000 # 1 MB
|
13
13
|
|
14
14
|
def __init__(self, client: Client) -> None:
|
15
|
-
self._next_threshold =
|
15
|
+
self._next_threshold = 0
|
16
16
|
self.client = client
|
17
17
|
self.complete = False
|
18
18
|
self.rendered_text = ""
|
@@ -127,7 +127,7 @@ class ProgressBar(object):
|
|
127
127
|
logging.warning("An error occurred while setup task to update progress bar")
|
128
128
|
logging.exception(e)
|
129
129
|
if total > 0 and percent != 0:
|
130
|
-
self._next_threshold +=
|
130
|
+
self._next_threshold += 10
|
131
131
|
|
132
132
|
@staticmethod
|
133
133
|
def make_hash(chat_id: str | int, message_id: int, algorithm: str = 'sha256') -> str:
|
@@ -1,6 +1,6 @@
|
|
1
|
-
from typing import
|
2
|
-
|
1
|
+
from typing import Optional
|
3
2
|
import re
|
3
|
+
from urllib.parse import urlparse
|
4
4
|
|
5
5
|
from pyrogram import Client
|
6
6
|
from pyrogram.types import Message, ChatMember
|
@@ -154,3 +154,18 @@ class Utils(object):
|
|
154
154
|
return
|
155
155
|
if not client.me or not client.me.is_premium:
|
156
156
|
client.me = await client.get_me()
|
157
|
+
|
158
|
+
@staticmethod
|
159
|
+
def remove_links_wo_paths(urls: list[str]) -> list[str]:
|
160
|
+
try:
|
161
|
+
new_urls = []
|
162
|
+
for url in urls:
|
163
|
+
url = url.rstrip('/')
|
164
|
+
path = urlparse(url).path
|
165
|
+
sc = path.count('/')
|
166
|
+
if sc > 0:
|
167
|
+
new_urls.append(url)
|
168
|
+
return new_urls
|
169
|
+
except Exception as e:
|
170
|
+
logging.warning("Failed to remove links without path!", exc_info=e)
|
171
|
+
return urls
|
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
|