warp-beacon 2.4.7__py3-none-any.whl → 2.4.8__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.8"
2
2
 
@@ -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.8
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=c5okHyqy0xMTH-Vgb6oZnztLUqMuS7RU-XI2oi8wHdc,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
@@ -22,8 +22,8 @@ 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=8d_CQQi4vy1ESitZxQemogGfRR3d2GaV0MIozWC_cRA,5182
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.8.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
48
+ warp_beacon-2.4.8.dist-info/METADATA,sha256=kTucJ0RmRUkRTSbzQQrUKshaMkYKNJgG8k6VBDKFBDI,22625
49
+ warp_beacon-2.4.8.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
50
+ warp_beacon-2.4.8.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
51
+ warp_beacon-2.4.8.dist-info/top_level.txt,sha256=4ML0-mXsezLtRXyxQUntL_ktc5HX9npTeQWzvV8kFvA,1161
52
+ warp_beacon-2.4.8.dist-info/RECORD,,