warp-beacon 2.7.26__tar.gz → 2.7.28__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.26/warp_beacon.egg-info → warp_beacon-2.7.28}/PKG-INFO +1 -1
- warp_beacon-2.7.28/warp_beacon/__version__.py +2 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scheduler/instagram_human.py +44 -63
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scraper/__init__.py +8 -4
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scraper/account_selector.py +2 -2
- {warp_beacon-2.7.26 → warp_beacon-2.7.28/warp_beacon.egg-info}/PKG-INFO +1 -1
- warp_beacon-2.7.26/warp_beacon/__version__.py +0 -2
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/LICENSE +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/MANIFEST.in +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/README.md +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/assets/cc-group-black.png +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/assets/placeholder.gif +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/etc/.gitignore +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/etc/accounts.json +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/etc/proxies.json +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/etc/warp_beacon.conf +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/etc/warp_beacon.service +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/pyproject.toml +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/setup.cfg +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/setup.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/__init__.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/compress/__init__.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/compress/video.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/jobs/__init__.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/jobs/abstract.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/jobs/download_job.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/jobs/types.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/jobs/upload_job.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/mediainfo/__init__.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/mediainfo/abstract.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/mediainfo/audio.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/mediainfo/silencer.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/mediainfo/video.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scheduler/__init__.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scheduler/scheduler.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scraper/abstract.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scraper/exceptions.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scraper/fail_handler.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scraper/instagram/__init__.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scraper/instagram/captcha.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scraper/instagram/instagram.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scraper/instagram/wb_instagrapi.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scraper/link_resolver.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scraper/utils.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scraper/youtube/__init__.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scraper/youtube/abstract.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scraper/youtube/music.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scraper/youtube/shorts.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/scraper/youtube/youtube.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/storage/__init__.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/storage/mongo.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/telegram/__init__.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/telegram/bot.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/telegram/caption_shortener.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/telegram/download_status.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/telegram/edit_message.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/telegram/handlers.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/telegram/placeholder_message.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/telegram/progress_bar.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/telegram/progress_file_reader.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/telegram/types.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/telegram/utils.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/uploader/__init__.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/warp_beacon.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon/yt_auth.py +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon.egg-info/SOURCES.txt +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon.egg-info/dependency_links.txt +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon.egg-info/entry_points.txt +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon.egg-info/requires.txt +0 -0
- {warp_beacon-2.7.26 → warp_beacon-2.7.28}/warp_beacon.egg-info/top_level.txt +0 -0
@@ -71,34 +71,28 @@ class InstagramHuman(object):
|
|
71
71
|
logging.info("Simulating stories watch ...")
|
72
72
|
stories = []
|
73
73
|
try:
|
74
|
-
|
75
|
-
if not
|
74
|
+
raw_tray = self.reel_tray_feed_if_needed()
|
75
|
+
if not raw_tray:
|
76
76
|
logging.info("No stories tray available.")
|
77
77
|
return
|
78
|
+
logging.info("raw_tray: %s", str(raw_tray))
|
79
|
+
tray = raw_tray.get("tray", [])
|
78
80
|
for user_story in tray:
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
stories.extend(_stories)
|
87
|
-
self.random_pause()
|
88
|
-
except Exception as exc:
|
89
|
-
logging.warning("Failed to fetch stories for user '%s'", user_story.get("user", {}).get("username", ""), exc_info=exc)
|
90
|
-
self.random_pause()
|
91
|
-
except Exception as e:
|
92
|
-
logging.warning("Failed to get user stories!", exc_info=e)
|
81
|
+
user = user_story["user"]
|
82
|
+
user_id = user["pk"]
|
83
|
+
_stories = self.scrapler.cl.user_stories(user_id)
|
84
|
+
self.operations_count += 1
|
85
|
+
if _stories:
|
86
|
+
stories.extend(_stories)
|
87
|
+
self.random_pause()
|
93
88
|
|
94
|
-
|
95
|
-
|
89
|
+
if not stories:
|
90
|
+
return
|
96
91
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
try:
|
92
|
+
seen = []
|
93
|
+
explore_user = None
|
94
|
+
if stories:
|
95
|
+
for m in stories[:random.randint(1, len(stories))]:
|
102
96
|
logging.info("Wathing story with pk '%s'", str(m.id))
|
103
97
|
seen.append(str(m.id))
|
104
98
|
if random.random() > 0.9:
|
@@ -106,19 +100,16 @@ class InstagramHuman(object):
|
|
106
100
|
self.operations_count += 1
|
107
101
|
break
|
108
102
|
self.random_pause()
|
109
|
-
except Exception as e:
|
110
|
-
logging.warning("Exception while watching content", exc_info=e)
|
111
103
|
|
112
|
-
|
113
|
-
try:
|
104
|
+
if seen:
|
114
105
|
self.scrapler.cl.media_seen(seen)
|
115
106
|
self.operations_count += 1
|
116
107
|
logging.info("Marked '%d' stories as seen", len(seen))
|
117
|
-
except Exception as e:
|
118
|
-
logging.warning("Failed to mark seen watched watch stories!", exc_info=e)
|
119
108
|
|
120
|
-
|
121
|
-
|
109
|
+
if explore_user:
|
110
|
+
self.explore_profile(explore_user)
|
111
|
+
except Exception as e:
|
112
|
+
logging.warning("Failed to get user stories!", exc_info=e)
|
122
113
|
|
123
114
|
def watch_content(self, media: list) -> None:
|
124
115
|
if not media:
|
@@ -127,22 +118,16 @@ class InstagramHuman(object):
|
|
127
118
|
seen = []
|
128
119
|
random.seed(time.time())
|
129
120
|
for m in media[:random.randint(1, len(media))]:
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
logging.exception(e)
|
141
|
-
try:
|
142
|
-
self.scrapler.download_hndlr(self.scrapler.cl.media_seen, seen)
|
143
|
-
self.operations_count += 1
|
144
|
-
except Exception as e:
|
145
|
-
logging.warning("Failed to mark seen watched videos!", exc_info=e)
|
121
|
+
logging.info("Watching content with pk '%s'", str(m.id))
|
122
|
+
seen.append(str(m.id))
|
123
|
+
logging.info("Watched content with id '%s'", str(m.id))
|
124
|
+
if random.random() > 0.9:
|
125
|
+
explore_user = m.user
|
126
|
+
break
|
127
|
+
self.random_pause()
|
128
|
+
|
129
|
+
self.scrapler.download_hndlr(self.scrapler.cl.media_seen, seen)
|
130
|
+
self.operations_count += 1
|
146
131
|
|
147
132
|
if explore_user:
|
148
133
|
self.explore_profile(explore_user)
|
@@ -289,22 +274,18 @@ class InstagramHuman(object):
|
|
289
274
|
threads = self.scrapler.download_hndlr(self.scrapler.cl.direct_threads, amount=random.randint(3, 7))
|
290
275
|
self.operations_count += 1
|
291
276
|
for thread in threads:
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
self.random_pause()
|
305
|
-
except Exception as e:
|
306
|
-
logging.warning("Failed to read thread %s", thread.id)
|
307
|
-
logging.exception(e)
|
277
|
+
messages = self.scrapler.cl.direct_messages(thread.id, amount=random.randint(5, 15))
|
278
|
+
self.operations_count += 1
|
279
|
+
if not messages:
|
280
|
+
continue
|
281
|
+
#msg_sample = random.sample(messages, k=random.randint(1, min(len(messages), 5)))
|
282
|
+
#for msg in msg_sample:
|
283
|
+
#if random.random() < 0.85:
|
284
|
+
#self.scrapler.cl.direct_message_seen(msg.thread_id, msg.id)
|
285
|
+
#self.operations_count += 1
|
286
|
+
#logging.info("visual_media: '%s'", msg.visual_media)
|
287
|
+
#self.random_pause()
|
288
|
+
#self.random_pause()
|
308
289
|
|
309
290
|
def explore_profile(self, user: UserShort) -> None:
|
310
291
|
try:
|
@@ -130,8 +130,10 @@ class AsyncDownloader(object):
|
|
130
130
|
proxy = selector.get_current_proxy()
|
131
131
|
if job.job_origin is Origin.INSTAGRAM:
|
132
132
|
from warp_beacon.scraper.instagram.instagram import InstagramScraper
|
133
|
-
|
134
|
-
|
133
|
+
ig_requests_limit = int(os.environ.get("IG_REQUESTS_PER_ACCOUNT", default="20"))
|
134
|
+
ig_requests = selector.get_ig_request_count()
|
135
|
+
if not job.scroll_content and ig_requests >= ig_requests_limit:
|
136
|
+
logging.info("The account requests limit '%d' has been reached value '%d'. Selecting the next account.", ig_requests_limit, ig_requests)
|
135
137
|
selector.reset_ig_request_count()
|
136
138
|
selector.next()
|
137
139
|
actor = InstagramScraper(client_session_id=selector.get_ig_session_id(), account=selector.get_current(), proxy=proxy)
|
@@ -165,8 +167,10 @@ class AsyncDownloader(object):
|
|
165
167
|
break
|
166
168
|
if job.session_validation and job.job_origin in (Origin.INSTAGRAM, Origin.YOUTUBE):
|
167
169
|
if job.job_origin is Origin.INSTAGRAM:
|
168
|
-
|
169
|
-
|
170
|
+
ig_requests_limit = int(os.environ.get("IG_REQUESTS_PER_ACCOUNT", default="20"))
|
171
|
+
if selector.get_ig_request_count() >= ig_requests_limit:
|
172
|
+
ig_requests = selector.get_ig_request_count()
|
173
|
+
logging.info("The account requests limit '%d' has been reached value '%d'. Selecting the next account.", ig_requests_limit, ig_requests)
|
170
174
|
selector.reset_ig_request_count()
|
171
175
|
selector.next()
|
172
176
|
logging.info("Validating '%s' session ...", job.job_origin.value)
|
@@ -257,13 +257,13 @@ class AccountSelector(object):
|
|
257
257
|
return len(self.accounts[module_name])
|
258
258
|
|
259
259
|
def inc_ig_request_count(self, amount: int = 1) -> None:
|
260
|
-
self.ig_request_count.value += amount
|
260
|
+
self.ig_request_count.value += int(amount)
|
261
261
|
|
262
262
|
def reset_ig_request_count(self) -> None:
|
263
263
|
self.ig_request_count.value = 0
|
264
264
|
|
265
265
|
def get_ig_request_count(self) -> int:
|
266
|
-
return self.ig_request_count.value
|
266
|
+
return int(self.ig_request_count.value)
|
267
267
|
|
268
268
|
def get_ig_session_id(self) -> str:
|
269
269
|
with self.lock:
|
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
|