warp-beacon 2.6.15__py3-none-any.whl → 2.6.17__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/__init__.py +18 -18
- warp_beacon/scraper/account_selector.py +24 -0
- warp_beacon/scraper/fail_handler.py +2 -4
- {warp_beacon-2.6.15.dist-info → warp_beacon-2.6.17.dist-info}/METADATA +1 -1
- {warp_beacon-2.6.15.dist-info → warp_beacon-2.6.17.dist-info}/RECORD +10 -10
- {warp_beacon-2.6.15.dist-info → warp_beacon-2.6.17.dist-info}/WHEEL +0 -0
- {warp_beacon-2.6.15.dist-info → warp_beacon-2.6.17.dist-info}/entry_points.txt +0 -0
- {warp_beacon-2.6.15.dist-info → warp_beacon-2.6.17.dist-info}/licenses/LICENSE +0 -0
- {warp_beacon-2.6.15.dist-info → warp_beacon-2.6.17.dist-info}/top_level.txt +0 -0
warp_beacon/__version__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
__version__ = "2.6.
|
1
|
+
__version__ = "2.6.17"
|
2
2
|
|
warp_beacon/scraper/__init__.py
CHANGED
@@ -100,11 +100,11 @@ class AsyncDownloader(object):
|
|
100
100
|
while self.allow_loop.value == 1:
|
101
101
|
try:
|
102
102
|
job: DownloadJob = None
|
103
|
+
actor = None
|
103
104
|
try:
|
104
105
|
job = self.job_queue.get()
|
105
106
|
if job is self.__JOE_BIDEN_WAKEUP:
|
106
107
|
break
|
107
|
-
actor = None
|
108
108
|
try:
|
109
109
|
items = []
|
110
110
|
if job.job_origin is Origin.UNKNOWN:
|
@@ -249,23 +249,6 @@ class AsyncDownloader(object):
|
|
249
249
|
f"Task <code>{job.job_id}</code> failed. URL: '{job.url}'. Reason: '<b>YotubeAgeRestrictedError</b>'."
|
250
250
|
)
|
251
251
|
break
|
252
|
-
except AllAccountsFailed as e:
|
253
|
-
logging.error("All accounts failed!")
|
254
|
-
logging.exception(e)
|
255
|
-
self.send_message_to_admin(
|
256
|
-
f"Task <code>{job.job_id}</code> failed. URL: '{job.url}'. Reason: '<b>AllAccountsFailed</b>'."
|
257
|
-
)
|
258
|
-
if job.job_origin == Origin.INSTAGRAM:
|
259
|
-
logging.info("Handling captcha postpone")
|
260
|
-
self.uploader.queue_task(job.to_upload_job(
|
261
|
-
job_warning=True,
|
262
|
-
job_warning_msg="Bot is experiencing issues, video delivery may be delayed.")
|
263
|
-
)
|
264
|
-
#self.try_next_account(selector, job, report_error="captcha")
|
265
|
-
#e.job.job_postponed_until = time.time() + 300
|
266
|
-
#self.job_queue.put(e.job)
|
267
|
-
fail_handler.store_failed_job(job)
|
268
|
-
break
|
269
252
|
except (UnknownError, Exception) as e:
|
270
253
|
logging.warning("UnknownError occurred!")
|
271
254
|
logging.exception(e)
|
@@ -381,6 +364,22 @@ class AsyncDownloader(object):
|
|
381
364
|
else:
|
382
365
|
logging.info("Job already in work in parallel worker. Redirecting job to upload worker.")
|
383
366
|
self.uploader.queue_task(job.to_upload_job())
|
367
|
+
|
368
|
+
except AllAccountsFailed as e:
|
369
|
+
self.send_message_to_admin(
|
370
|
+
f"Task <code>{job.job_id}</code> failed. URL: '{job.url}'. Reason: '<b>AllAccountsFailed</b>'."
|
371
|
+
)
|
372
|
+
if job.job_origin == Origin.INSTAGRAM:
|
373
|
+
logging.info("Handling captcha postpone")
|
374
|
+
self.uploader.queue_task(job.to_upload_job(
|
375
|
+
job_warning=True,
|
376
|
+
job_warning_msg="The bot is currently experiencing technical issues. Message delivery may be delayed.")
|
377
|
+
)
|
378
|
+
#self.try_next_account(selector, job, report_error="captcha")
|
379
|
+
#e.job.job_postponed_until = time.time() + 300
|
380
|
+
#self.job_queue.put(e.job)
|
381
|
+
fail_handler.store_failed_job(job)
|
382
|
+
self.notify_task_failed(job)
|
384
383
|
except Exception as e:
|
385
384
|
logging.error("Error inside download worker!")
|
386
385
|
logging.exception(e)
|
@@ -398,6 +397,7 @@ class AsyncDownloader(object):
|
|
398
397
|
|
399
398
|
def stop_all(self) -> None:
|
400
399
|
self.allow_loop.value = 0
|
400
|
+
self.acc_selector.save_ig_request_count()
|
401
401
|
for proc in self.workers:
|
402
402
|
if proc.is_alive():
|
403
403
|
logging.info("stopping process #%d", proc.pid)
|
@@ -40,9 +40,33 @@ class AccountSelector(object):
|
|
40
40
|
if proxy_file_path:
|
41
41
|
with open(proxy_file_path, 'r', encoding="utf-8") as f:
|
42
42
|
self.proxies = json.loads(f.read())
|
43
|
+
|
44
|
+
self.load_ig_request_count()
|
43
45
|
else:
|
44
46
|
raise ValueError("Accounts file not found")
|
45
47
|
|
48
|
+
def save_ig_request_count(self) -> None:
|
49
|
+
try:
|
50
|
+
state = {"ig_count": self.ig_request_count.value}
|
51
|
+
with open(f"{self.session_dir}/ig_request_counter.json", "w+", encoding="utf-8") as f:
|
52
|
+
f.write(json.dumps(state))
|
53
|
+
except Exception as e:
|
54
|
+
logging.error("Failed to save accounts states!")
|
55
|
+
logging.exception(e)
|
56
|
+
|
57
|
+
def load_ig_request_count(self) -> None:
|
58
|
+
try:
|
59
|
+
state = {}
|
60
|
+
filepath = f"{self.session_dir}/ig_request_counter.json"
|
61
|
+
if os.path.exists(filepath):
|
62
|
+
with open(f"{self.session_dir}/ig_request_counter.json", "r", encoding="utf-8") as f:
|
63
|
+
state = json.loads(f.read())
|
64
|
+
if state:
|
65
|
+
self.ig_request_count.value = int(state.get("ig_count", 0))
|
66
|
+
except Exception as e:
|
67
|
+
logging.error("Failed to save accounts states!")
|
68
|
+
logging.exception(e)
|
69
|
+
|
46
70
|
def get_current_proxy(self) -> Optional[dict]:
|
47
71
|
return self.current_proxy
|
48
72
|
|
@@ -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=
|
7
|
+
warp_beacon/__version__.py,sha256=a1aXAI5iMpUmb-fkAT_xmK2FejqLr_zPFFJYf9nelUY,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
|
@@ -22,11 +22,11 @@ warp_beacon/mediainfo/video.py,sha256=UBZrhTN5IDI-aYu6tsJEILo9nFkjHhkldGVFmvV7tE
|
|
22
22
|
warp_beacon/scheduler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23
23
|
warp_beacon/scheduler/instagram_human.py,sha256=buF6rJzp8gVZvHBAXEkAL-uJjm5iQkEWnfPgwM2oH8g,6276
|
24
24
|
warp_beacon/scheduler/scheduler.py,sha256=9OCh7Ta4wY_aTHGAOOZmaKXg56Ftx1N_aV1g6E3ZLKA,4941
|
25
|
-
warp_beacon/scraper/__init__.py,sha256=
|
25
|
+
warp_beacon/scraper/__init__.py,sha256=x5z9NrK_CPXITOR9Uus3U6DvytNThvGt2yDRGlyakJo,18566
|
26
26
|
warp_beacon/scraper/abstract.py,sha256=CiOyKCxVYWhPnOUpLAVIRNuHBftN6gmxqATdhjzkaS4,2852
|
27
|
-
warp_beacon/scraper/account_selector.py,sha256=
|
27
|
+
warp_beacon/scraper/account_selector.py,sha256=wm8XO020QSvJO43TG7G06a17G0lFtNdx17V8mC8vKbs,7783
|
28
28
|
warp_beacon/scraper/exceptions.py,sha256=EKwoF0oH2xZWbNU-v8DOaWK5skKwa3s1yTIBdlcfMpc,1452
|
29
|
-
warp_beacon/scraper/fail_handler.py,sha256=
|
29
|
+
warp_beacon/scraper/fail_handler.py,sha256=zcPK3ZVEsu6JmHYcWP7L3naTRK3gWFVRkpP84VBOtJs,964
|
30
30
|
warp_beacon/scraper/link_resolver.py,sha256=Rc9ZuMyOo3iPywDHwjngy-WRQ2SXhJwxcg-5ripx7tM,2447
|
31
31
|
warp_beacon/scraper/instagram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
32
32
|
warp_beacon/scraper/instagram/captcha.py,sha256=9UYziuqB3Tsat_ET6ex-cnZDbi6yCnsXHSpmE8MuUHk,4651
|
@@ -45,9 +45,9 @@ warp_beacon/telegram/handlers.py,sha256=uvR6TPHSqdSxigp3wR-ewiE6t3TvVcbVLVcYGwkg
|
|
45
45
|
warp_beacon/telegram/placeholder_message.py,sha256=wN9-BRiyrtHG-EvXtZkGJHt2CX71munQ57ITttjt0mw,6400
|
46
46
|
warp_beacon/telegram/utils.py,sha256=1Lq67aRylVJzbwSyvAgjPAGjJZFATkICvAj3TJGuJiM,4635
|
47
47
|
warp_beacon/uploader/__init__.py,sha256=j3qcuKhpchseZLGzSsSiogqe6WdMbkK8d3I-ConhNRs,5687
|
48
|
-
warp_beacon-2.6.
|
49
|
-
warp_beacon-2.6.
|
50
|
-
warp_beacon-2.6.
|
51
|
-
warp_beacon-2.6.
|
52
|
-
warp_beacon-2.6.
|
53
|
-
warp_beacon-2.6.
|
48
|
+
warp_beacon-2.6.17.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
49
|
+
warp_beacon-2.6.17.dist-info/METADATA,sha256=oWESJ8WFz9XTMXake_tV2ezRui08bIGVwi9b7m3491c,22706
|
50
|
+
warp_beacon-2.6.17.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
|
51
|
+
warp_beacon-2.6.17.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
|
52
|
+
warp_beacon-2.6.17.dist-info/top_level.txt,sha256=4ML0-mXsezLtRXyxQUntL_ktc5HX9npTeQWzvV8kFvA,1161
|
53
|
+
warp_beacon-2.6.17.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|