warp-beacon 2.6.88__py3-none-any.whl → 2.6.90__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 +8 -1
- warp_beacon/scraper/instagram/instagram.py +18 -8
- warp_beacon/warp_beacon.py +32 -7
- {warp_beacon-2.6.88.dist-info → warp_beacon-2.6.90.dist-info}/METADATA +1 -1
- {warp_beacon-2.6.88.dist-info → warp_beacon-2.6.90.dist-info}/RECORD +12 -12
- {warp_beacon-2.6.88.dist-info → warp_beacon-2.6.90.dist-info}/WHEEL +0 -0
- {warp_beacon-2.6.88.dist-info → warp_beacon-2.6.90.dist-info}/entry_points.txt +0 -0
- {warp_beacon-2.6.88.dist-info → warp_beacon-2.6.90.dist-info}/licenses/LICENSE +0 -0
- {warp_beacon-2.6.88.dist-info → warp_beacon-2.6.90.dist-info}/top_level.txt +0 -0
warp_beacon/__version__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
__version__ = "2.6.
|
1
|
+
__version__ = "2.6.90"
|
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
|
@@ -271,4 +271,11 @@ class AccountSelector(object):
|
|
271
271
|
#if random.random() > 0.95:
|
272
272
|
# self.ig_accounts_session_id[idx] = str(uuid.uuid4())
|
273
273
|
# logging.info("Rotated client_session_id — simulating app restart")
|
274
|
-
return self.ig_accounts_session_id[idx]
|
274
|
+
return self.ig_accounts_session_id[idx]
|
275
|
+
|
276
|
+
def generate_new_session_id(self) -> str:
|
277
|
+
with self.lock:
|
278
|
+
idx = self.account_index[self.current_module_name].value
|
279
|
+
session_id = str(uuid.uuid4())
|
280
|
+
self.ig_accounts_session_id[idx] = session_id
|
281
|
+
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,
|
warp_beacon/warp_beacon.py
CHANGED
@@ -1,14 +1,39 @@
|
|
1
1
|
import os
|
2
|
+
import sys
|
3
|
+
import uuid
|
4
|
+
import secrets
|
5
|
+
import hashlib
|
6
|
+
import argparse
|
2
7
|
|
3
8
|
from warp_beacon.telegram.bot import Bot
|
4
9
|
|
5
10
|
#import logging
|
6
11
|
|
12
|
+
def generate_uuid() -> str:
|
13
|
+
return str(uuid.uuid4())
|
14
|
+
|
15
|
+
def generate_device_id(seed: str = None) -> str:
|
16
|
+
raw = secrets.token_hex(8) if not seed else seed.encode()
|
17
|
+
hex_part = hashlib.md5(raw).hexdigest()[:16]
|
18
|
+
return f"android-{hex_part}"
|
19
|
+
|
7
20
|
def main() -> None:
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
21
|
+
parser = argparse.ArgumentParser(description="Warp Beacon Telegram bot.")
|
22
|
+
parser.add_argument("--uuid", action="store_true", help="Generate UUID")
|
23
|
+
parser.add_argument("--generate-device-id", type=str, metavar="INSTAGRAM_LOGIN", help="Generate device_id with account login")
|
24
|
+
|
25
|
+
args = parser.parse_args()
|
26
|
+
|
27
|
+
if args.uuid:
|
28
|
+
print(generate_uuid())
|
29
|
+
elif args.generate_device_id:
|
30
|
+
print(generate_device_id(args.generate_device_id))
|
31
|
+
else:
|
32
|
+
bot = Bot(
|
33
|
+
tg_bot_name=os.environ.get("TG_BOT_NAME", default=None),
|
34
|
+
tg_token=os.environ.get("TG_TOKEN", default=None),
|
35
|
+
tg_api_id=os.environ.get("TG_API_ID", default=None),
|
36
|
+
tg_api_hash=os.environ.get("TG_API_HASH", default=None)
|
37
|
+
)
|
38
|
+
bot.start()
|
39
|
+
sys.exit(0)
|
@@ -4,8 +4,8 @@ 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=
|
8
|
-
warp_beacon/warp_beacon.py,sha256=
|
7
|
+
warp_beacon/__version__.py,sha256=s1Gyn8bxYLPbGb2iRK_aVDbVJNFzFOD-7xUCIDIPtcQ,24
|
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
|
11
11
|
warp_beacon/compress/video.py,sha256=_PDMVYCyzLYxHv1uZmmzGcG_8rjaZr7BTXsXTTy_oS4,2846
|
@@ -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=eTAxA5Agf9TIey8-5zrv-uvCoRl5xR6jPvbmgLppSXk,9959
|
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.90.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
56
|
+
warp_beacon-2.6.90.dist-info/METADATA,sha256=G6-5MRiRevMZ5yT9uHbvvyRarP692cJloM7XFDFI_kk,22736
|
57
|
+
warp_beacon-2.6.90.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
58
|
+
warp_beacon-2.6.90.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
|
59
|
+
warp_beacon-2.6.90.dist-info/top_level.txt,sha256=5YQRN46STNg81V_3jdzZ6bftkMxhe1hTPSFvJugDu84,1405
|
60
|
+
warp_beacon-2.6.90.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|