warp-beacon 2.4.6__tar.gz → 2.4.8__tar.gz

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.
Files changed (61) hide show
  1. {warp_beacon-2.4.6/warp_beacon.egg-info → warp_beacon-2.4.8}/PKG-INFO +1 -1
  2. warp_beacon-2.4.8/warp_beacon/__version__.py +2 -0
  3. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/scraper/__init__.py +4 -2
  4. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/scraper/abstract.py +4 -2
  5. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/scraper/instagram/instagram.py +3 -2
  6. {warp_beacon-2.4.6 → warp_beacon-2.4.8/warp_beacon.egg-info}/PKG-INFO +1 -1
  7. warp_beacon-2.4.6/warp_beacon/__version__.py +0 -2
  8. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/LICENSE +0 -0
  9. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/MANIFEST.in +0 -0
  10. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/README.md +0 -0
  11. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/assets/placeholder.gif +0 -0
  12. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/etc/.gitignore +0 -0
  13. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/etc/accounts.json +0 -0
  14. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/etc/proxies.json +0 -0
  15. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/etc/warp_beacon.conf +0 -0
  16. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/etc/warp_beacon.service +0 -0
  17. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/pyproject.toml +0 -0
  18. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/setup.cfg +0 -0
  19. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/setup.py +0 -0
  20. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/__init__.py +0 -0
  21. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/compress/__init__.py +0 -0
  22. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/compress/video.py +0 -0
  23. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/jobs/__init__.py +0 -0
  24. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/jobs/abstract.py +0 -0
  25. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/jobs/download_job.py +0 -0
  26. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/jobs/types.py +0 -0
  27. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/jobs/upload_job.py +0 -0
  28. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/mediainfo/__init__.py +0 -0
  29. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/mediainfo/abstract.py +0 -0
  30. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/mediainfo/audio.py +0 -0
  31. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/mediainfo/silencer.py +0 -0
  32. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/mediainfo/video.py +0 -0
  33. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/scheduler/__init__.py +0 -0
  34. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/scheduler/instagram_human.py +0 -0
  35. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/scheduler/scheduler.py +0 -0
  36. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/scraper/account_selector.py +0 -0
  37. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/scraper/exceptions.py +0 -0
  38. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/scraper/fail_handler.py +0 -0
  39. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/scraper/instagram/__init__.py +0 -0
  40. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/scraper/link_resolver.py +0 -0
  41. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/scraper/youtube/__init__.py +0 -0
  42. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/scraper/youtube/abstract.py +0 -0
  43. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/scraper/youtube/music.py +0 -0
  44. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/scraper/youtube/shorts.py +0 -0
  45. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/scraper/youtube/youtube.py +0 -0
  46. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/storage/__init__.py +0 -0
  47. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/storage/mongo.py +0 -0
  48. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/telegram/__init__.py +0 -0
  49. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/telegram/bot.py +0 -0
  50. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/telegram/caption_shortener.py +0 -0
  51. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/telegram/handlers.py +0 -0
  52. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/telegram/placeholder_message.py +0 -0
  53. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/telegram/utils.py +0 -0
  54. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/uploader/__init__.py +0 -0
  55. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/warp_beacon.py +0 -0
  56. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon/yt_auth.py +0 -0
  57. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon.egg-info/SOURCES.txt +0 -0
  58. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon.egg-info/dependency_links.txt +0 -0
  59. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon.egg-info/entry_points.txt +0 -0
  60. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon.egg-info/requires.txt +0 -0
  61. {warp_beacon-2.4.6 → warp_beacon-2.4.8}/warp_beacon.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: warp_beacon
3
- Version: 2.4.6
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
@@ -0,0 +1,2 @@
1
+ __version__ = "2.4.8"
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
@@ -14,6 +14,7 @@ import urllib3
14
14
  from urllib.parse import urljoin, urlparse
15
15
 
16
16
  from instagrapi import exceptions
17
+ from instagrapi.exceptions import UnknownError as IGUnknownError
17
18
  from instagrapi.mixins.story import Story
18
19
  from instagrapi.types import Media
19
20
  from instagrapi import Client
@@ -301,13 +302,13 @@ class InstagramScraper(ScraperAbstract):
301
302
  logging.info("Stories download mode")
302
303
  res.append(self.download_stories(self.scrap_stories(media_id)))
303
304
  break
304
- except PleaseWaitFewMinutes as e:
305
+ except exceptions.PleaseWaitFewMinutes as e:
305
306
  logging.warning("Please wait a few minutes error.")
306
307
  logging.exception(e)
307
308
  if os.path.exists(self.inst_session_file):
308
309
  os.unlink(self.inst_session_file)
309
310
  raise IGRateLimitOccurred("Instagram ratelimit")
310
- except (MediaNotFound, ClientNotFoundError, UserNotFound) as e:
311
+ except (exceptions.MediaNotFound, exceptions.ClientNotFoundError, exceptions.UserNotFound) as e:
311
312
  raise NotFound(extract_exception_message(e))
312
313
  except IGUnknownError as e:
313
314
  raise UnknownError(extract_exception_message(e))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: warp_beacon
3
- Version: 2.4.6
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
@@ -1,2 +0,0 @@
1
- __version__ = "2.4.6"
2
-
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes