warp-beacon 2.6.89__py3-none-any.whl → 2.6.91__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 +1 -0
- warp_beacon/scraper/abstract.py +3 -0
- warp_beacon/scraper/account_selector.py +11 -3
- warp_beacon/scraper/instagram/instagram.py +18 -8
- {warp_beacon-2.6.89.dist-info → warp_beacon-2.6.91.dist-info}/METADATA +1 -1
- {warp_beacon-2.6.89.dist-info → warp_beacon-2.6.91.dist-info}/RECORD +11 -11
- {warp_beacon-2.6.89.dist-info → warp_beacon-2.6.91.dist-info}/WHEEL +0 -0
- {warp_beacon-2.6.89.dist-info → warp_beacon-2.6.91.dist-info}/entry_points.txt +0 -0
- {warp_beacon-2.6.89.dist-info → warp_beacon-2.6.91.dist-info}/licenses/LICENSE +0 -0
- {warp_beacon-2.6.89.dist-info → warp_beacon-2.6.91.dist-info}/top_level.txt +0 -0
warp_beacon/__version__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
__version__ = "2.6.
|
1
|
+
__version__ = "2.6.91"
|
2
2
|
|
warp_beacon/scraper/__init__.py
CHANGED
@@ -150,6 +150,7 @@ class AsyncDownloader(object):
|
|
150
150
|
actor.auth_event = self.auth_event
|
151
151
|
actor.status_pipe = self.status_pipe
|
152
152
|
actor.yt_validate_event = self.yt_validate_event
|
153
|
+
actor.acc_selector = selector
|
153
154
|
# job retry loop
|
154
155
|
while self.allow_loop.value == 1:
|
155
156
|
try:
|
warp_beacon/scraper/abstract.py
CHANGED
@@ -16,6 +16,8 @@ import requests.packages.urllib3.util.connection as urllib3_cn
|
|
16
16
|
if TYPE_CHECKING:
|
17
17
|
from multiprocessing.synchronize import Event as EventType
|
18
18
|
|
19
|
+
from warp_beacon.scraper.account_selector import AccountSelector
|
20
|
+
|
19
21
|
class ScraperAbstract(ABC):
|
20
22
|
def __init__(self, account: tuple, proxy: dict = None) -> None:
|
21
23
|
self.original_gai_family = None
|
@@ -24,6 +26,7 @@ class ScraperAbstract(ABC):
|
|
24
26
|
self.status_pipe: multiprocessing.connection.Connection = None
|
25
27
|
self.yt_validate_event: EventType = None
|
26
28
|
self.auth_event = None
|
29
|
+
self.acc_selector: AccountSelector = None
|
27
30
|
self.account = None
|
28
31
|
self.account_index = 0
|
29
32
|
self.proxy = None
|
@@ -60,8 +60,9 @@ class AccountSelector(object):
|
|
60
60
|
|
61
61
|
def save_ig_sessions_id(self) -> None:
|
62
62
|
try:
|
63
|
-
with
|
64
|
-
f.
|
63
|
+
with self.lock:
|
64
|
+
with open(f"{self.session_dir}/ig_sessions_client_id.json", "w+", encoding="utf-8") as f:
|
65
|
+
f.write(json.dumps(dict(self.ig_accounts_session_id)))
|
65
66
|
except Exception as e:
|
66
67
|
logging.warning("Failed to save session ig_session_client_id!")
|
67
68
|
logging.exception(e)
|
@@ -271,4 +272,11 @@ class AccountSelector(object):
|
|
271
272
|
#if random.random() > 0.95:
|
272
273
|
# self.ig_accounts_session_id[idx] = str(uuid.uuid4())
|
273
274
|
# logging.info("Rotated client_session_id — simulating app restart")
|
274
|
-
return self.ig_accounts_session_id[idx]
|
275
|
+
return self.ig_accounts_session_id[idx]
|
276
|
+
|
277
|
+
def generate_new_session_id(self) -> str:
|
278
|
+
with self.lock:
|
279
|
+
idx = self.account_index[self.current_module_name].value
|
280
|
+
session_id = str(uuid.uuid4())
|
281
|
+
self.ig_accounts_session_id[idx] = session_id
|
282
|
+
return session_id
|
@@ -208,14 +208,24 @@ class InstagramScraper(ScraperAbstract):
|
|
208
208
|
except exceptions.LoginRequired as e:
|
209
209
|
logging.error("LoginRequired occurred in download handler!")
|
210
210
|
logging.exception(e)
|
211
|
-
|
212
|
-
self.cl.
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
211
|
+
relogin_success = False
|
212
|
+
if self.cl.relogin_attempt > 1:
|
213
|
+
try:
|
214
|
+
relogin_success = self.cl.relogin()
|
215
|
+
except Exception as exc:
|
216
|
+
logging.warning("Relogin failed!", exc_info=exc)
|
217
|
+
if not relogin_success:
|
218
|
+
old_session = self.cl.get_settings()
|
219
|
+
# change session id after relogin
|
220
|
+
self.client_session_id = self.acc_selector.generate_new_session_id()
|
221
|
+
old_session["uuids"]["client_session_id"] = self.client_session_id
|
222
|
+
self.cl.set_settings({})
|
223
|
+
self.setup_device()
|
224
|
+
self.cl.set_uuids(old_session["uuids"])
|
225
|
+
if os.path.exists(self.inst_session_file):
|
226
|
+
os.unlink(self.inst_session_file)
|
227
|
+
time.sleep(random.uniform(5, 10))
|
228
|
+
self.load_session()
|
219
229
|
except AssertionError as e:
|
220
230
|
raise IGRateLimitOccurred("IG rate limit occurred")
|
221
231
|
except (socket.timeout,
|
@@ -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=x-o_8g53KASf2TV8bAzbD2eaHaPm0YzBkxIAUR3MBh4,24
|
8
8
|
warp_beacon/warp_beacon.py,sha256=ADCR30uGXIsDrt9WoiI9Ghu2QtWs0qZIK6x3pQKM_B4,1109
|
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,16 +22,16 @@ 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=JF5K8jgdwW0ncpKsEAj2yWMP9Y40kKgCM_i3HoHwNnM,8307
|
24
24
|
warp_beacon/scheduler/scheduler.py,sha256=Bf4sGXjX75Dox3q-yzUHhagtzUAj3hl5GzfnZya-_io,4995
|
25
|
-
warp_beacon/scraper/__init__.py,sha256=
|
26
|
-
warp_beacon/scraper/abstract.py,sha256=
|
27
|
-
warp_beacon/scraper/account_selector.py,sha256=
|
25
|
+
warp_beacon/scraper/__init__.py,sha256=k3M0X_m5f7b_DbBB3Ahk62ewEYr5AkqJL0PJXf0G4mI,20140
|
26
|
+
warp_beacon/scraper/abstract.py,sha256=pWbaTu-gDZgi-iFjqMR_uGzPl5KLv-4gTdJ9w6cD4sk,3802
|
27
|
+
warp_beacon/scraper/account_selector.py,sha256=hl3tvX0FtDbEbSXphUXl7eWTKGFbHJOxqjPcwZZ-n6A,9980
|
28
28
|
warp_beacon/scraper/exceptions.py,sha256=EKwoF0oH2xZWbNU-v8DOaWK5skKwa3s1yTIBdlcfMpc,1452
|
29
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/utils.py,sha256=Kk_lDmdJiCSaHmOV80OFK05O1wRL2H0agH98JiO8dyg,1268
|
32
32
|
warp_beacon/scraper/instagram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
33
33
|
warp_beacon/scraper/instagram/captcha.py,sha256=9UYziuqB3Tsat_ET6ex-cnZDbi6yCnsXHSpmE8MuUHk,4651
|
34
|
-
warp_beacon/scraper/instagram/instagram.py,sha256=
|
34
|
+
warp_beacon/scraper/instagram/instagram.py,sha256=4dhan3PO1dT8lCxHD5bdNuEvgutcNvYqxDNG93Wlkkg,17583
|
35
35
|
warp_beacon/scraper/instagram/wb_instagrapi.py,sha256=OECHz1eK6J5bfw2H84CdywwxBNegkNb_UhDr0MtNtZ4,5237
|
36
36
|
warp_beacon/scraper/youtube/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
37
|
warp_beacon/scraper/youtube/abstract.py,sha256=0ub4O8kNBzcrYCbMaNoNQzwE5vBdpNcSYNtxT-cBXe4,15024
|
@@ -52,9 +52,9 @@ warp_beacon/telegram/progress_file_reader.py,sha256=e3equyNKlKs764AD-iE9QRsh3YDH
|
|
52
52
|
warp_beacon/telegram/types.py,sha256=Kvdng6uCF1HRoqQgGW1ZYYPJoVuYkFb-LDvMBbW5Hjk,89
|
53
53
|
warp_beacon/telegram/utils.py,sha256=1Lq67aRylVJzbwSyvAgjPAGjJZFATkICvAj3TJGuJiM,4635
|
54
54
|
warp_beacon/uploader/__init__.py,sha256=j3qcuKhpchseZLGzSsSiogqe6WdMbkK8d3I-ConhNRs,5687
|
55
|
-
warp_beacon-2.6.
|
56
|
-
warp_beacon-2.6.
|
57
|
-
warp_beacon-2.6.
|
58
|
-
warp_beacon-2.6.
|
59
|
-
warp_beacon-2.6.
|
60
|
-
warp_beacon-2.6.
|
55
|
+
warp_beacon-2.6.91.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
56
|
+
warp_beacon-2.6.91.dist-info/METADATA,sha256=9vCEK4emG8JVlHjucbJuZ0Y3pbVLyz_AhaRBG8Gui2g,22736
|
57
|
+
warp_beacon-2.6.91.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
58
|
+
warp_beacon-2.6.91.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
|
59
|
+
warp_beacon-2.6.91.dist-info/top_level.txt,sha256=5YQRN46STNg81V_3jdzZ6bftkMxhe1hTPSFvJugDu84,1405
|
60
|
+
warp_beacon-2.6.91.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|