warp-beacon 2.7.31__py3-none-any.whl → 2.7.32__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.
@@ -1,2 +1,2 @@
1
- __version__ = "2.7.31"
1
+ __version__ = "2.7.32"
2
2
 
@@ -5,7 +5,7 @@ from datetime import datetime
5
5
 
6
6
  import logging
7
7
 
8
- from instagrapi.types import UserShort
8
+ from instagrapi.types import UserShort, Story
9
9
  from warp_beacon.scraper.instagram.instagram import InstagramScraper
10
10
 
11
11
  class InstagramHuman(object):
@@ -69,7 +69,7 @@ class InstagramHuman(object):
69
69
 
70
70
  def watch_stories(self) -> None:
71
71
  logging.info("Simulating stories watch ...")
72
- stories = []
72
+ stories: list[Story] = []
73
73
  try:
74
74
  raw_tray = self.reel_tray_feed_if_needed()
75
75
  if not raw_tray:
@@ -77,16 +77,17 @@ class InstagramHuman(object):
77
77
  return
78
78
  #logging.info("raw_tray: %s", str(raw_tray))
79
79
  tray = raw_tray.get("tray", [])
80
- if tray:
80
+ filtered_tray = [item for item in tray if item.get("seen", 0) == 0]
81
+ if filtered_tray:
81
82
  reels_tray = []
82
83
  target_len = random.randint(1, 5)
83
- for el in tray[:target_len]:
84
+ for el in filtered_tray[:target_len]:
84
85
  user = el["user"]
85
86
  user_id = user["pk"]
86
- if el.get("seen", 0) == 0:
87
- reels_tray.append({"user_id": user_id})
87
+ reels_tray.append({"user_id": user_id})
88
88
 
89
89
  for el in reels_tray:
90
+ # amount?
90
91
  _stories = self.scrapler.download_hndlr(self.scrapler.cl.user_stories, el["user_id"])
91
92
  self.operations_count += 1
92
93
  if _stories:
@@ -106,7 +107,16 @@ class InstagramHuman(object):
106
107
  explore_user = m.user
107
108
  self.operations_count += 1
108
109
  break
109
- self.random_pause()
110
+ pause = 0.0
111
+ if m.media_type == 2:
112
+ pause = m.video_duration or random.uniform(2, 20)
113
+ elif m.media_type == 8:
114
+ pause = random.uniform(2, 31)
115
+ else: # img, etc.
116
+ pause = random.uniform(2, 14)
117
+ logging.info("Pause for '%.2f' sec ...", round(pause, 2))
118
+ time.sleep(pause)
119
+ #self.random_pause()
110
120
 
111
121
  if seen:
112
122
  self.scrapler.download_hndlr(self.scrapler.cl.media_seen, seen)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: warp_beacon
3
- Version: 2.7.31
3
+ Version: 2.7.32
4
4
  Summary: Telegram bot for expanding external media links
5
5
  Home-page: https://github.com/sb0y/warp_beacon
6
6
  Author: Andrey Bagrintsev
@@ -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=1yyk4aKxhgTdmz7ZQA7_49PVJ9hCdQw1x0iVp7PFoDA,24
7
+ warp_beacon/__version__.py,sha256=FZAWrGPJKT5yGtGhrPoGyQVd4Z5-ybQndhXGRZ8bKPI,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
@@ -20,7 +20,7 @@ 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=OMv8PbJ6ITa7VqAvhgn97fjdSjBnFdY3T1DLhPhbwT4,12547
23
+ warp_beacon/scheduler/instagram_human.py,sha256=WuS3KX9Gj-Rjjglxe7uVrm7WT9pygFnNS-G5-NpeJwY,12949
24
24
  warp_beacon/scheduler/scheduler.py,sha256=Bf4sGXjX75Dox3q-yzUHhagtzUAj3hl5GzfnZya-_io,4995
25
25
  warp_beacon/scraper/__init__.py,sha256=rcI8hYeXZPfmINwK_yB2pUmPtWh_BfrEF1IYVg5-67w,20520
26
26
  warp_beacon/scraper/abstract.py,sha256=pWbaTu-gDZgi-iFjqMR_uGzPl5KLv-4gTdJ9w6cD4sk,3802
@@ -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=S1N_JbHM_ExiM5tS0CeYKWIlvaJMlyq85TQNbK_GVds,5029
54
54
  warp_beacon/uploader/__init__.py,sha256=1enK6qMWaTZEaK456JwaKOfvCvznHA8cjgceOsrF6Po,5732
55
- warp_beacon-2.7.31.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
56
- warp_beacon-2.7.31.dist-info/METADATA,sha256=KZ1ph06Yl2PO6n5z3eXttmAgTan8qYfFnRsLEZTx0aE,23215
57
- warp_beacon-2.7.31.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
58
- warp_beacon-2.7.31.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
59
- warp_beacon-2.7.31.dist-info/top_level.txt,sha256=5YQRN46STNg81V_3jdzZ6bftkMxhe1hTPSFvJugDu84,1405
60
- warp_beacon-2.7.31.dist-info/RECORD,,
55
+ warp_beacon-2.7.32.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
56
+ warp_beacon-2.7.32.dist-info/METADATA,sha256=iWI1w5SRrKieybUXzFFXIxw16j9vLI1bZm1noLo-abg,23215
57
+ warp_beacon-2.7.32.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
58
+ warp_beacon-2.7.32.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
59
+ warp_beacon-2.7.32.dist-info/top_level.txt,sha256=5YQRN46STNg81V_3jdzZ6bftkMxhe1hTPSFvJugDu84,1405
60
+ warp_beacon-2.7.32.dist-info/RECORD,,