warp-beacon 2.5.6__tar.gz → 2.5.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.5.6/warp_beacon.egg-info → warp_beacon-2.5.8}/PKG-INFO +1 -1
- warp_beacon-2.5.8/warp_beacon/__version__.py +2 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/scheduler/scheduler.py +7 -6
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/scraper/__init__.py +4 -4
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/scraper/account_selector.py +2 -2
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/scraper/instagram/instagram.py +1 -1
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/scraper/youtube/abstract.py +3 -2
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/telegram/bot.py +4 -4
- {warp_beacon-2.5.6 → warp_beacon-2.5.8/warp_beacon.egg-info}/PKG-INFO +1 -1
- warp_beacon-2.5.6/warp_beacon/__version__.py +0 -2
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/LICENSE +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/MANIFEST.in +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/README.md +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/assets/placeholder.gif +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/etc/.gitignore +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/etc/accounts.json +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/etc/proxies.json +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/etc/warp_beacon.conf +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/etc/warp_beacon.service +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/pyproject.toml +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/setup.cfg +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/setup.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/__init__.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/compress/__init__.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/compress/video.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/jobs/__init__.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/jobs/abstract.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/jobs/download_job.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/jobs/types.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/jobs/upload_job.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/mediainfo/__init__.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/mediainfo/abstract.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/mediainfo/audio.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/mediainfo/silencer.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/mediainfo/video.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/scheduler/__init__.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/scheduler/instagram_human.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/scraper/abstract.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/scraper/exceptions.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/scraper/fail_handler.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/scraper/instagram/__init__.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/scraper/link_resolver.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/scraper/youtube/__init__.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/scraper/youtube/music.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/scraper/youtube/shorts.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/scraper/youtube/youtube.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/storage/__init__.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/storage/mongo.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/telegram/__init__.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/telegram/caption_shortener.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/telegram/handlers.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/telegram/placeholder_message.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/telegram/utils.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/uploader/__init__.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/warp_beacon.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon/yt_auth.py +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon.egg-info/SOURCES.txt +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon.egg-info/dependency_links.txt +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon.egg-info/entry_points.txt +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon.egg-info/requires.txt +0 -0
- {warp_beacon-2.5.6 → warp_beacon-2.5.8}/warp_beacon.egg-info/top_level.txt +0 -0
@@ -95,6 +95,7 @@ class IGScheduler(object):
|
|
95
95
|
|
96
96
|
def validate_ig_session(self) -> bool:
|
97
97
|
try:
|
98
|
+
logging.info("Setting IG validate task ...")
|
98
99
|
self.downloader.queue_task(warp_beacon.jobs.download_job.DownloadJob.build(
|
99
100
|
session_validation=True,
|
100
101
|
job_origin=Origin.INSTAGRAM
|
@@ -108,6 +109,7 @@ class IGScheduler(object):
|
|
108
109
|
|
109
110
|
def validate_yt_session(self) -> bool:
|
110
111
|
try:
|
112
|
+
logging.info("Setting YT validate task ...")
|
111
113
|
self.downloader.queue_task(warp_beacon.jobs.download_job.DownloadJob.build(
|
112
114
|
session_validation=True,
|
113
115
|
job_origin=Origin.YOUTUBE
|
@@ -132,26 +134,25 @@ class IGScheduler(object):
|
|
132
134
|
min_val = min(yt_expires, ig_sched)
|
133
135
|
#max_val = max(yt_expires, ig_sched)
|
134
136
|
now = datetime.datetime.now()
|
135
|
-
if
|
137
|
+
if 3 <= now.hour < 7 and min_val != yt_expires:
|
136
138
|
logging.info("Scheduler is paused due to night hours (4:00 - 7:00)")
|
137
139
|
self.state["remaining"] = 10800
|
138
140
|
self.save_state()
|
139
141
|
|
140
142
|
if ig_sched <= 0:
|
141
143
|
self.state["remaining"] = randrange(9292, 26200)
|
142
|
-
logging.info("Next scheduler activity in '%s' seconds", ig_sched)
|
143
|
-
|
144
|
-
if yt_expires <= time.time() + 60:
|
145
|
-
self.validate_yt_session()
|
146
144
|
|
147
145
|
start_time = time.time()
|
146
|
+
logging.info("Next scheduler activity in '%s' seconds", min_val)
|
147
|
+
logging.info("IG timeout '%d' secs", int(self.state["remaining"]))
|
148
148
|
self.event.wait(timeout=min_val)
|
149
149
|
elapsed = time.time() - start_time
|
150
150
|
self.state["remaining"] -= elapsed
|
151
151
|
|
152
152
|
if self.running:
|
153
|
-
logging.info("Scheduler waking up")
|
154
153
|
self.validate_ig_session()
|
154
|
+
if yt_expires <= time.time() + 60:
|
155
|
+
self.validate_yt_session()
|
155
156
|
self.save_state()
|
156
157
|
except Exception as e:
|
157
158
|
logging.error("An error occurred in scheduler thread!")
|
@@ -93,7 +93,7 @@ class AsyncDownloader(object):
|
|
93
93
|
fail_handler = FailHandler(DBClient())
|
94
94
|
while self.allow_loop.value == 1:
|
95
95
|
try:
|
96
|
-
job = None
|
96
|
+
job: DownloadJob = None
|
97
97
|
try:
|
98
98
|
job = self.job_queue.get()
|
99
99
|
if job is self.__JOE_BIDEN_WAKEUP:
|
@@ -141,15 +141,15 @@ class AsyncDownloader(object):
|
|
141
141
|
# job retry loop
|
142
142
|
while self.allow_loop.value == 1:
|
143
143
|
try:
|
144
|
-
if job.session_validation:
|
144
|
+
if job.session_validation and job.job_origin in (Origin.INSTAGRAM, Origin.YOUTUBE):
|
145
145
|
if job.job_origin is Origin.INSTAGRAM:
|
146
|
-
if selector.get_ig_request_count() >= int(os.environ.get("IG_REQUESTS_PER_ACCOUNT", default="
|
146
|
+
if selector.get_ig_request_count() >= int(os.environ.get("IG_REQUESTS_PER_ACCOUNT", default="10")):
|
147
147
|
logging.info("The account request limit has been reached. Selecting the next account.")
|
148
148
|
selector.reset_ig_request_count()
|
149
149
|
selector.next()
|
150
150
|
logging.info("Validating '%s' session ...", job.job_origin.value)
|
151
151
|
actor.validate_session()
|
152
|
-
logging.info("done")
|
152
|
+
logging.info("Validation done")
|
153
153
|
else:
|
154
154
|
logging.info("Downloading URL '%s'", job.url)
|
155
155
|
items = actor.download(job)
|
@@ -183,8 +183,8 @@ class AccountSelector(object):
|
|
183
183
|
return 0
|
184
184
|
return len(self.accounts[module_name])
|
185
185
|
|
186
|
-
def inc_ig_request_count(self) -> None:
|
187
|
-
self.ig_request_count.value +=
|
186
|
+
def inc_ig_request_count(self, amount: int = 1) -> None:
|
187
|
+
self.ig_request_count.value += amount
|
188
188
|
|
189
189
|
def reset_ig_request_count(self) -> None:
|
190
190
|
self.ig_request_count.value = 0
|
@@ -125,7 +125,7 @@ class InstagramScraper(ScraperAbstract):
|
|
125
125
|
return "media", self.scrap_media(url)
|
126
126
|
try:
|
127
127
|
return _scrap()
|
128
|
-
except LoginRequired as e:
|
128
|
+
except exceptions.LoginRequired as e:
|
129
129
|
logging.warning("Session error. Trying to relogin...")
|
130
130
|
logging.exception(e)
|
131
131
|
self.login()
|
@@ -195,7 +195,7 @@ class YoutubeAbstract(ScraperAbstract):
|
|
195
195
|
if hasattr(e, "code") and (int(e.code) == 403 or int(e.code) == 400):
|
196
196
|
raise Unavailable(extract_exception_message(e))
|
197
197
|
if hasattr(e, "reason") and "Remote end closed connection without response" in str(e.reason):
|
198
|
-
raise
|
198
|
+
raise Unavailable(extract_exception_message(e))
|
199
199
|
logging.warning("Youtube read timeout! Retrying in '%d' seconds ...", pause_secs)
|
200
200
|
logging.info("Your `YT_MAX_RETRIES` values is '%d'", max_retries)
|
201
201
|
logging.exception(extract_exception_message(e))
|
@@ -294,8 +294,9 @@ class YoutubeAbstract(ScraperAbstract):
|
|
294
294
|
try:
|
295
295
|
ret = self.download_hndlr(self._download, job.url, session=True)
|
296
296
|
return ret
|
297
|
-
except (Unavailable, TimeOut, KeyError):
|
297
|
+
except (Unavailable, TimeOut, KeyError) as e:
|
298
298
|
logging.warning("Download failed, trying to download with yt_dlp")
|
299
|
+
logging.exception(e)
|
299
300
|
|
300
301
|
try:
|
301
302
|
ret = self.download_hndlr(self._download_yt_dlp, job.url)
|
@@ -248,7 +248,7 @@ class Bot(object):
|
|
248
248
|
args["thumb"] = job.media_info["thumb"]
|
249
249
|
args["caption"] = self.build_signature_caption(job)
|
250
250
|
|
251
|
-
args["file_name"] = job.local_media_path
|
251
|
+
args["file_name"] = os.path.basename(job.local_media_path)
|
252
252
|
elif job.media_type == JobType.IMAGE:
|
253
253
|
if job.tg_file_id:
|
254
254
|
if job.placeholder_message_id:
|
@@ -269,7 +269,7 @@ class Bot(object):
|
|
269
269
|
args["photo"] = job.local_media_path
|
270
270
|
args["caption"] = self.build_signature_caption(job)
|
271
271
|
|
272
|
-
args["file_name"] = job.local_media_path
|
272
|
+
args["file_name"] = os.path.basename(job.local_media_path)
|
273
273
|
elif job.media_type == JobType.AUDIO:
|
274
274
|
if job.tg_file_id:
|
275
275
|
if job.placeholder_message_id:
|
@@ -297,7 +297,7 @@ class Bot(object):
|
|
297
297
|
args["title"] = job.canonical_name
|
298
298
|
args["caption"] = self.build_signature_caption(job)
|
299
299
|
|
300
|
-
args["file_name"] = job.local_media_path
|
300
|
+
args["file_name"] = os.path.basename(job.local_media_path)
|
301
301
|
elif job.media_type == JobType.ANIMATION:
|
302
302
|
if job.tg_file_id:
|
303
303
|
if job.placeholder_message_id:
|
@@ -326,7 +326,7 @@ class Bot(object):
|
|
326
326
|
args["thumb"] = job.media_info["thumb"]
|
327
327
|
args["caption"] = self.build_signature_caption(job)
|
328
328
|
|
329
|
-
args["file_name"] = job.local_media_path
|
329
|
+
args["file_name"] = os.path.basename(job.local_media_path)
|
330
330
|
elif job.media_type == JobType.COLLECTION:
|
331
331
|
if job.tg_file_id:
|
332
332
|
args["media"] = []
|
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
|