warp-beacon 2.4.7__py3-none-any.whl → 2.4.9__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.4.7"
1
+ __version__ = "2.4.9"
2
2
 
@@ -33,6 +33,7 @@ class InstagramHuman(object):
33
33
  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"))
34
34
  time.sleep(random.uniform(3, 7))
35
35
  if random.random() > 0.5:
36
+ logging.info("Checking direct ...")
36
37
  self.scrapler.download_hndlr(self.scrapler.cl.direct_active_presence)
37
38
  time.sleep(random.uniform(2, 5))
38
39
  if random.random() > 0.3:
@@ -71,6 +72,7 @@ class InstagramHuman(object):
71
72
  self.scrapler.download_hndlr(self.scrapler.cl.direct_active_presence)
72
73
  time.sleep(random.uniform(2, 5))
73
74
  if random.random() > 0.5:
75
+ logging.info("Checking notifications, tags ...")
74
76
  self.scrapler.download_hndlr(self.scrapler.cl.notification_like_and_comment_on_photo_user_tagged, "everyone")
75
77
  self.random_pause()
76
78
  if random.random() > 0.4:
@@ -123,12 +125,21 @@ class InstagramHuman(object):
123
125
  logging.info("user_info with target_user_id = '%s' ...", target_user_id)
124
126
  #self.scrapler.download_hndlr(self.scrapler.cl.user_info, target_user_id)
125
127
  self.scrapler.download_hndlr(self.scrapler.cl.user_info_v1, target_user_id)
128
+ time.sleep(random.uniform(2, 5))
129
+
130
+ if random.random() > 0.5:
131
+ logging.info("Checking direct ...")
132
+ self.scrapler.download_hndlr(self.scrapler.cl.direct_active_presence)
133
+ self.random_pause()
126
134
 
127
- time.sleep(random.uniform(2, 5))
128
-
135
+ if random.random() > 0.3:
136
+ logging.info("Checking notifications, tags ...")
137
+ self.scrapler.download_hndlr(self.scrapler.cl.notification_like_and_comment_on_photo_user_tagged, "everyone")
138
+ self.random_pause()
139
+
129
140
  if random.random() > 0.5:
130
141
  logging.info("user_medias with target_user_id = '%s' ...", target_user_id)
131
- self.scrapler.download_hndlr(self.scrapler.cl.user_medias, target_user_id, amount=random.randint(1, 5))
142
+ self.scrapler.download_hndlr(self.scrapler.cl.user_medias_v1, target_user_id, amount=random.randint(1, 5))
132
143
  self.random_pause()
133
144
  except Exception as e:
134
145
  logging.warning("Error in profile view")
@@ -116,14 +116,13 @@ class AsyncDownloader(object):
116
116
  time.sleep(2)
117
117
  self.job_queue.put(job)
118
118
  continue
119
- actor = None
120
119
  self.acc_selector.set_module(job.job_origin)
121
120
  proxy = selector.get_current_proxy()
122
121
  if job.job_origin is Origin.INSTAGRAM:
123
122
  from warp_beacon.scraper.instagram.instagram import InstagramScraper
124
123
  actor = InstagramScraper(selector.get_current(), proxy)
125
124
  selector.inc_ig_request_count()
126
- if selector.get_ig_request_count() >= int(os.environ.get("IG_REQUESTS_PER_ACCOUNT", default="20")):
125
+ if selector.get_ig_request_count() >= int(os.environ.get("IG_REQUESTS_PER_ACCOUNT", default="10")):
127
126
  logging.info("The account request limit has been reached. Selecting the next account.")
128
127
  selector.reset_ig_request_count()
129
128
  selector.next()
@@ -379,6 +378,9 @@ class AsyncDownloader(object):
379
378
  logging.error("Error inside download worker!")
380
379
  logging.exception(e)
381
380
  self.notify_task_failed(job)
381
+ finally:
382
+ if actor:
383
+ actor.restore_gai()
382
384
  except Empty:
383
385
  pass
384
386
  except Exception as e:
@@ -92,5 +92,7 @@ class ScraperAbstract(ABC):
92
92
  urllib3_cn.allowed_gai_family = allowed_gai_family
93
93
 
94
94
  def restore_gai(self) -> None:
95
- logging.info("Restoring normal IP stack ...")
96
- urllib3_cn.allowed_gai_family = self.original_gai_family
95
+ if self.original_gai_family:
96
+ logging.info("Restoring normal IP stack ...")
97
+ urllib3_cn.allowed_gai_family = self.original_gai_family
98
+ self.original_gai_family = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: warp_beacon
3
- Version: 2.4.7
3
+ Version: 2.4.9
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=0c0bpB5wFFlErbF0KdROy3tNIFjn1giE6i593iSOKoc,23
7
+ warp_beacon/__version__.py,sha256=l-V_qEXIZrlX8QwaaaseijPbJ-z1Jc6zZG2fmxo6s1c,23
8
8
  warp_beacon/warp_beacon.py,sha256=7KEtZDj-pdhtl6m-zFLsSojs1ZR4o7L0xbqtdmYPvfE,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
@@ -20,10 +20,10 @@ 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=8d_CQQi4vy1ESitZxQemogGfRR3d2GaV0MIozWC_cRA,5182
23
+ warp_beacon/scheduler/instagram_human.py,sha256=xbh37egaTiSOasIMibpF0n9xwmWbq5ktGyNglyZQpvc,5673
24
24
  warp_beacon/scheduler/scheduler.py,sha256=MoPdPKiMNqVD19N-8yDc0wkTlwghFeQV3STBipAgbeQ,4602
25
- warp_beacon/scraper/__init__.py,sha256=frWsdVQC2_eP2whKb18j8sr5nAltBUceKG8LFqJQ4_4,18181
26
- warp_beacon/scraper/abstract.py,sha256=jbD-cJO9W6zQNGPql67YB-fqPyIrMp44FqXpi6NCArE,2784
25
+ warp_beacon/scraper/__init__.py,sha256=Wl_GHtBW6GMH45nD9jjzSJGxBkkkrDZAFx9QIqkagO0,18218
26
+ warp_beacon/scraper/abstract.py,sha256=CiOyKCxVYWhPnOUpLAVIRNuHBftN6gmxqATdhjzkaS4,2852
27
27
  warp_beacon/scraper/account_selector.py,sha256=1ftgBKyaW_JiC6KX6wPfid3YWk8hRctfOTROrH1OnJ8,6943
28
28
  warp_beacon/scraper/exceptions.py,sha256=L4UCZqDOLKu5-TPUcTErIbNDLrAQJghkMaPqzTfsm1g,1376
29
29
  warp_beacon/scraper/fail_handler.py,sha256=_blvckfTZ4xWVancQKVRXH5ClKGwfrBxMwvXIFZh1qA,975
@@ -44,9 +44,9 @@ warp_beacon/telegram/handlers.py,sha256=uvR6TPHSqdSxigp3wR-ewiE6t3TvVcbVLVcYGwkg
44
44
  warp_beacon/telegram/placeholder_message.py,sha256=wN9-BRiyrtHG-EvXtZkGJHt2CX71munQ57ITttjt0mw,6400
45
45
  warp_beacon/telegram/utils.py,sha256=9uebX53G16mV7ER7WgfdWBLFHHw14S8HBt9URrIskg0,4440
46
46
  warp_beacon/uploader/__init__.py,sha256=e75mOcC0vrUVjrTNMQzVUTgXGdGo4J6n8t5doOnYG5I,5616
47
- warp_beacon-2.4.7.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
48
- warp_beacon-2.4.7.dist-info/METADATA,sha256=Z4is_1X-vYH1NYmsagCWHacg9YDg4m0bCMQXhGBAV4k,22625
49
- warp_beacon-2.4.7.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
50
- warp_beacon-2.4.7.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
51
- warp_beacon-2.4.7.dist-info/top_level.txt,sha256=4ML0-mXsezLtRXyxQUntL_ktc5HX9npTeQWzvV8kFvA,1161
52
- warp_beacon-2.4.7.dist-info/RECORD,,
47
+ warp_beacon-2.4.9.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
48
+ warp_beacon-2.4.9.dist-info/METADATA,sha256=dC7rqsC_fNG3FzPDgtomzOTT3_f8rgl6WGmoRtuNa0E,22625
49
+ warp_beacon-2.4.9.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
50
+ warp_beacon-2.4.9.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
51
+ warp_beacon-2.4.9.dist-info/top_level.txt,sha256=4ML0-mXsezLtRXyxQUntL_ktc5HX9npTeQWzvV8kFvA,1161
52
+ warp_beacon-2.4.9.dist-info/RECORD,,