warp-beacon 2.6.12__py3-none-any.whl → 2.6.14__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/scheduler/instagram_human.py +20 -0
- warp_beacon/scraper/__init__.py +3 -1
- warp_beacon/scraper/instagram/instagram.py +2 -1
- warp_beacon/scraper/youtube/abstract.py +3 -1
- warp_beacon/uploader/__init__.py +6 -3
- warp_beacon/warp_beacon.py +0 -4
- {warp_beacon-2.6.12.dist-info → warp_beacon-2.6.14.dist-info}/METADATA +1 -1
- {warp_beacon-2.6.12.dist-info → warp_beacon-2.6.14.dist-info}/RECORD +13 -13
- {warp_beacon-2.6.12.dist-info → warp_beacon-2.6.14.dist-info}/WHEEL +0 -0
- {warp_beacon-2.6.12.dist-info → warp_beacon-2.6.14.dist-info}/entry_points.txt +0 -0
- {warp_beacon-2.6.12.dist-info → warp_beacon-2.6.14.dist-info}/licenses/LICENSE +0 -0
- {warp_beacon-2.6.12.dist-info → warp_beacon-2.6.14.dist-info}/top_level.txt +0 -0
warp_beacon/__version__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
__version__ = "2.6.
|
1
|
+
__version__ = "2.6.14"
|
2
2
|
|
@@ -10,9 +10,11 @@ from warp_beacon.scraper.instagram.instagram import InstagramScraper
|
|
10
10
|
class InstagramHuman(object):
|
11
11
|
scrapler = None
|
12
12
|
default_profiles = ["nasa", "natgeo", "9gag", "spotify", "nba"]
|
13
|
+
operations_count = 0
|
13
14
|
|
14
15
|
def __init__(self, scrapler: InstagramScraper) -> None:
|
15
16
|
self.scrapler = scrapler
|
17
|
+
self.operations_count = 0
|
16
18
|
|
17
19
|
def simulate_activity(self) -> None:
|
18
20
|
now = datetime.now()
|
@@ -31,17 +33,21 @@ class InstagramHuman(object):
|
|
31
33
|
try:
|
32
34
|
logging.info("Starting morning activity simulation")
|
33
35
|
self.scrapler.timeline_cursor = self.scrapler.download_hndlr(self.scrapler.cl.get_timeline_feed, "pull_to_refresh", self.scrapler.timeline_cursor.get("next_max_id"))
|
36
|
+
self.operations_count += 1
|
34
37
|
time.sleep(random.uniform(3, 7))
|
35
38
|
if random.random() > 0.5:
|
36
39
|
logging.info("Checking direct ...")
|
37
40
|
self.scrapler.download_hndlr(self.scrapler.cl.direct_active_presence)
|
41
|
+
self.operations_count += 1
|
38
42
|
time.sleep(random.uniform(2, 5))
|
39
43
|
if random.random() > 0.3:
|
40
44
|
self.scrapler.download_hndlr(self.scrapler.cl.notification_like_and_comment_on_photo_user_tagged, "everyone")
|
45
|
+
self.operations_count += 1
|
41
46
|
self.random_pause()
|
42
47
|
if random.random() > 0.5:
|
43
48
|
logging.info("Simulation updating reels tray feed ...")
|
44
49
|
self.scrapler.download_hndlr(self.scrapler.cl.get_reels_tray_feed, "pull_to_refresh")
|
50
|
+
self.operations_count += 1
|
45
51
|
self.random_pause()
|
46
52
|
if random.random() > 0.8:
|
47
53
|
self.profile_view()
|
@@ -53,9 +59,11 @@ class InstagramHuman(object):
|
|
53
59
|
try:
|
54
60
|
logging.info("Starting day fast check activity simulation")
|
55
61
|
self.scrapler.download_hndlr(self.scrapler.cl.get_timeline_feed, "pull_to_refresh")
|
62
|
+
self.operations_count += 1
|
56
63
|
time.sleep(random.uniform(2, 5))
|
57
64
|
if random.random() > 0.5:
|
58
65
|
self.scrapler.download_hndlr(self.scrapler.cl.get_reels_tray_feed, "pull_to_refresh")
|
66
|
+
self.operations_count += 1
|
59
67
|
self.random_pause()
|
60
68
|
except Exception as e:
|
61
69
|
logging.warning("Error in daytime_routine")
|
@@ -65,19 +73,24 @@ class InstagramHuman(object):
|
|
65
73
|
try:
|
66
74
|
logging.info("Starting evening active user simulation")
|
67
75
|
self.scrapler.download_hndlr(self.scrapler.cl.get_timeline_feed, "pull_to_refresh")
|
76
|
+
self.operations_count += 1
|
68
77
|
time.sleep(random.uniform(2, 5))
|
69
78
|
self.scrapler.download_hndlr(self.scrapler.cl.get_reels_tray_feed, "pull_to_refresh")
|
79
|
+
self.operations_count += 1
|
70
80
|
time.sleep(random.uniform(2, 5))
|
71
81
|
if random.random() > 0.5:
|
72
82
|
self.scrapler.download_hndlr(self.scrapler.cl.direct_active_presence)
|
83
|
+
self.operations_count += 1
|
73
84
|
time.sleep(random.uniform(2, 5))
|
74
85
|
if random.random() > 0.5:
|
75
86
|
logging.info("Checking notifications, tags ...")
|
76
87
|
self.scrapler.download_hndlr(self.scrapler.cl.notification_like_and_comment_on_photo_user_tagged, "everyone")
|
88
|
+
self.operations_count += 1
|
77
89
|
self.random_pause()
|
78
90
|
if random.random() > 0.4:
|
79
91
|
logging.info("Watching reels ...")
|
80
92
|
self.scrapler.download_hndlr(self.scrapler.cl.reels)
|
93
|
+
self.operations_count += 1
|
81
94
|
self.random_pause()
|
82
95
|
if random.random() > 0.6:
|
83
96
|
logging.info("Simulation profile view ...")
|
@@ -92,6 +105,7 @@ class InstagramHuman(object):
|
|
92
105
|
logging.info("Starting night activity simulation")
|
93
106
|
if random.random() > 0.7:
|
94
107
|
self.scrapler.download_hndlr(self.scrapler.cl.direct_active_presence)
|
108
|
+
self.operations_count += 1
|
95
109
|
self.random_pause(short=True)
|
96
110
|
except Exception as e:
|
97
111
|
logging.warning("Error in night_routine")
|
@@ -108,6 +122,7 @@ class InstagramHuman(object):
|
|
108
122
|
my_user_id = self.scrapler.cl.user_id
|
109
123
|
logging.info("user_following ...")
|
110
124
|
friends = list(self.scrapler.download_hndlr(self.scrapler.cl.user_following, my_user_id, amount=random.randint(5, 50)).values())
|
125
|
+
self.operations_count += 1
|
111
126
|
time.sleep(random.uniform(2, 5))
|
112
127
|
if not friends:
|
113
128
|
friends = self.default_profiles
|
@@ -119,27 +134,32 @@ class InstagramHuman(object):
|
|
119
134
|
logging.info("user_info with target_user_id = '%s' ...", target_user_id)
|
120
135
|
#self.scrapler.download_hndlr(self.scrapler.cl.user_info, target_user_id)
|
121
136
|
self.scrapler.download_hndlr(self.scrapler.cl.user_info_v1, target_user_id)
|
137
|
+
self.operations_count += 1
|
122
138
|
time.sleep(random.uniform(2, 5))
|
123
139
|
elif isinstance(random_friend, str):
|
124
140
|
target_user_id = self.scrapler.download_hndlr(self.scrapler.cl.user_id_from_username, random_friend)
|
125
141
|
logging.info("user_info with target_user_id = '%s' ...", target_user_id)
|
126
142
|
#self.scrapler.download_hndlr(self.scrapler.cl.user_info, target_user_id)
|
127
143
|
self.scrapler.download_hndlr(self.scrapler.cl.user_info_v1, target_user_id)
|
144
|
+
self.operations_count += 1
|
128
145
|
time.sleep(random.uniform(2, 5))
|
129
146
|
|
130
147
|
if random.random() > 0.5:
|
131
148
|
logging.info("Checking direct ...")
|
132
149
|
self.scrapler.download_hndlr(self.scrapler.cl.direct_active_presence)
|
150
|
+
self.operations_count += 1
|
133
151
|
self.random_pause()
|
134
152
|
|
135
153
|
if random.random() > 0.3:
|
136
154
|
logging.info("Checking notifications, tags ...")
|
137
155
|
self.scrapler.download_hndlr(self.scrapler.cl.notification_like_and_comment_on_photo_user_tagged, "everyone")
|
156
|
+
self.operations_count += 1
|
138
157
|
self.random_pause()
|
139
158
|
|
140
159
|
if random.random() > 0.5:
|
141
160
|
logging.info("user_medias with target_user_id = '%s' ...", target_user_id)
|
142
161
|
self.scrapler.download_hndlr(self.scrapler.cl.user_medias_v1, target_user_id, amount=random.randint(1, 5))
|
162
|
+
self.operations_count += 1
|
143
163
|
self.random_pause()
|
144
164
|
except Exception as e:
|
145
165
|
logging.warning("Error in profile view")
|
warp_beacon/scraper/__init__.py
CHANGED
@@ -154,7 +154,9 @@ class AsyncDownloader(object):
|
|
154
154
|
selector.reset_ig_request_count()
|
155
155
|
selector.next()
|
156
156
|
logging.info("Validating '%s' session ...", job.job_origin.value)
|
157
|
-
actor.validate_session()
|
157
|
+
operations = actor.validate_session()
|
158
|
+
if job.job_origin is Origin.INSTAGRAM and operations:
|
159
|
+
selector.inc_ig_request_count(amount=operations)
|
158
160
|
logging.info("Validation done")
|
159
161
|
else:
|
160
162
|
logging.info("Downloading URL '%s'", job.url)
|
@@ -102,12 +102,13 @@ class InstagramScraper(ScraperAbstract):
|
|
102
102
|
self.cl.login(username=username, password=password, verification_code="")
|
103
103
|
self.safe_write_session()
|
104
104
|
|
105
|
-
def validate_session(self) ->
|
105
|
+
def validate_session(self) -> int:
|
106
106
|
from warp_beacon.scheduler.instagram_human import InstagramHuman
|
107
107
|
self.load_session()
|
108
108
|
inst_human = InstagramHuman(self)
|
109
109
|
inst_human.simulate_activity()
|
110
110
|
self.safe_write_session()
|
111
|
+
return inst_human.operations_count
|
111
112
|
|
112
113
|
def scrap(self, url: str) -> tuple[str]:
|
113
114
|
self.load_session()
|
@@ -34,7 +34,7 @@ class YoutubeAbstract(ScraperAbstract):
|
|
34
34
|
DOWNLOAD_DIR = "/tmp"
|
35
35
|
YT_SESSION_FILE = '/var/warp_beacon/yt_session_%d.json'
|
36
36
|
|
37
|
-
def validate_session(self) ->
|
37
|
+
def validate_session(self) -> int:
|
38
38
|
try:
|
39
39
|
logging.info("Validating YT session(s) ...")
|
40
40
|
session_dir = os.path.dirname(self.YT_SESSION_FILE)
|
@@ -59,6 +59,8 @@ class YoutubeAbstract(ScraperAbstract):
|
|
59
59
|
logging.error("Failed to refresh Youtube session!")
|
60
60
|
logging.exception(e)
|
61
61
|
|
62
|
+
return 0
|
63
|
+
|
62
64
|
def rename_local_file(self, filename: str) -> str:
|
63
65
|
if not os.path.exists(filename):
|
64
66
|
raise NameError("No file provided")
|
warp_beacon/uploader/__init__.py
CHANGED
@@ -11,12 +11,12 @@ from warp_beacon.storage import Storage
|
|
11
11
|
|
12
12
|
class AsyncUploader(object):
|
13
13
|
__JOE_BIDEN_WAKEUP = None
|
14
|
-
threads =
|
14
|
+
threads = None
|
15
15
|
allow_loop = True
|
16
16
|
job_queue = None
|
17
|
-
callbacks =
|
17
|
+
callbacks = None
|
18
18
|
storage = None
|
19
|
-
in_process =
|
19
|
+
in_process = None
|
20
20
|
loop = None
|
21
21
|
admin_message_callback = None
|
22
22
|
request_yt_auth_callback = None
|
@@ -29,6 +29,9 @@ class AsyncUploader(object):
|
|
29
29
|
request_yt_auth_callback: Callable,
|
30
30
|
pool_size: int=min(32, os.cpu_count() + 4)
|
31
31
|
) -> None:
|
32
|
+
self.threads = []
|
33
|
+
self.callbacks = {}
|
34
|
+
self.in_process = set()
|
32
35
|
self.storage = storage
|
33
36
|
self.loop = loop
|
34
37
|
self.job_queue = multiprocessing.Queue()
|
warp_beacon/warp_beacon.py
CHANGED
@@ -5,10 +5,6 @@ from warp_beacon.telegram.bot import Bot
|
|
5
5
|
#import logging
|
6
6
|
|
7
7
|
def main() -> None:
|
8
|
-
if __name__ == "__main__":
|
9
|
-
run()
|
10
|
-
|
11
|
-
def run() -> None:
|
12
8
|
bot = Bot(
|
13
9
|
tg_bot_name=os.environ.get("TG_BOT_NAME", default=None),
|
14
10
|
tg_token=os.environ.get("TG_TOKEN", default=None),
|
@@ -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=_-MdVWca4Czj9HpJDvK5U1aSpI1jLdult6-XPJpay_c,24
|
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
|
11
11
|
warp_beacon/compress/video.py,sha256=_PDMVYCyzLYxHv1uZmmzGcG_8rjaZr7BTXsXTTy_oS4,2846
|
@@ -20,9 +20,9 @@ warp_beacon/mediainfo/audio.py,sha256=ous88kwQj4bDIChN5wnGil5LqTs0IQHH0d-nyrL0-Z
|
|
20
20
|
warp_beacon/mediainfo/silencer.py,sha256=qxMuViOoVwUYb60uCVvqHiGrqByR1_4_rqMT-XdMkwc,1813
|
21
21
|
warp_beacon/mediainfo/video.py,sha256=UBZrhTN5IDI-aYu6tsJEILo9nFkjHhkldGVFmvV7tEI,2480
|
22
22
|
warp_beacon/scheduler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23
|
-
warp_beacon/scheduler/instagram_human.py,sha256=
|
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=ZfD_rn2k413r_BTmxakpOYsFXeuVVWOhDXv--_5cKNY,18808
|
26
26
|
warp_beacon/scraper/abstract.py,sha256=CiOyKCxVYWhPnOUpLAVIRNuHBftN6gmxqATdhjzkaS4,2852
|
27
27
|
warp_beacon/scraper/account_selector.py,sha256=mYNxAyAJj4ie9wMMkfb7ONjvAicS8xPEfE3iIe4gCog,6965
|
28
28
|
warp_beacon/scraper/exceptions.py,sha256=EKwoF0oH2xZWbNU-v8DOaWK5skKwa3s1yTIBdlcfMpc,1452
|
@@ -30,9 +30,9 @@ warp_beacon/scraper/fail_handler.py,sha256=_blvckfTZ4xWVancQKVRXH5ClKGwfrBxMwvXI
|
|
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
|
33
|
-
warp_beacon/scraper/instagram/instagram.py,sha256=
|
33
|
+
warp_beacon/scraper/instagram/instagram.py,sha256=Q08kaTYa1rdQehAdgGftDZog0LAm_nRzErjgIne6KDo,14677
|
34
34
|
warp_beacon/scraper/youtube/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
35
|
-
warp_beacon/scraper/youtube/abstract.py,sha256=
|
35
|
+
warp_beacon/scraper/youtube/abstract.py,sha256=QUSHR3aJjIykuRlBpGnmw3tq3m82AQeeZeWQUdJRvgQ,12538
|
36
36
|
warp_beacon/scraper/youtube/music.py,sha256=5AeSBQyUgVCJT2hoBCV2WvlyuV9US09SYJhmBG_P9F8,2755
|
37
37
|
warp_beacon/scraper/youtube/shorts.py,sha256=1GtoYUlxAwcgSQcn80u5ehNJytH5AN5dPOicmX-XD8E,1705
|
38
38
|
warp_beacon/scraper/youtube/youtube.py,sha256=x9v9p1coA9TvBhxjNAofGu4UBkAEdYPE2ePRnU-5tK0,7233
|
@@ -44,10 +44,10 @@ warp_beacon/telegram/caption_shortener.py,sha256=EnguNCF52ne7y4P-iJAbI6K3sqoJqJb
|
|
44
44
|
warp_beacon/telegram/handlers.py,sha256=uvR6TPHSqdSxigp3wR-ewiE6t3TvVcbVLVcYGwkgD2s,9559
|
45
45
|
warp_beacon/telegram/placeholder_message.py,sha256=wN9-BRiyrtHG-EvXtZkGJHt2CX71munQ57ITttjt0mw,6400
|
46
46
|
warp_beacon/telegram/utils.py,sha256=1Lq67aRylVJzbwSyvAgjPAGjJZFATkICvAj3TJGuJiM,4635
|
47
|
-
warp_beacon/uploader/__init__.py,sha256=
|
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.
|
47
|
+
warp_beacon/uploader/__init__.py,sha256=j3qcuKhpchseZLGzSsSiogqe6WdMbkK8d3I-ConhNRs,5687
|
48
|
+
warp_beacon-2.6.14.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
49
|
+
warp_beacon-2.6.14.dist-info/METADATA,sha256=FiGrANligHA5XoSyntMCOPbXrhYWcohYgi07Y3jOYDs,22706
|
50
|
+
warp_beacon-2.6.14.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
|
51
|
+
warp_beacon-2.6.14.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
|
52
|
+
warp_beacon-2.6.14.dist-info/top_level.txt,sha256=4ML0-mXsezLtRXyxQUntL_ktc5HX9npTeQWzvV8kFvA,1161
|
53
|
+
warp_beacon-2.6.14.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|