warp-beacon 2.3.0__tar.gz → 2.3.2__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 (58) hide show
  1. {warp_beacon-2.3.0/warp_beacon.egg-info → warp_beacon-2.3.2}/PKG-INFO +11 -3
  2. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/README.md +10 -2
  3. warp_beacon-2.3.2/warp_beacon/__version__.py +2 -0
  4. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/scraper/exceptions.py +1 -1
  5. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/scraper/instagram/instagram.py +11 -3
  6. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/telegram/handlers.py +4 -2
  7. {warp_beacon-2.3.0 → warp_beacon-2.3.2/warp_beacon.egg-info}/PKG-INFO +11 -3
  8. warp_beacon-2.3.0/warp_beacon/__version__.py +0 -2
  9. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/LICENSE +0 -0
  10. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/MANIFEST.in +0 -0
  11. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/assets/placeholder.gif +0 -0
  12. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/etc/.gitignore +0 -0
  13. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/etc/accounts.json +0 -0
  14. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/etc/proxies.json +0 -0
  15. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/etc/warp_beacon.conf +0 -0
  16. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/etc/warp_beacon.service +0 -0
  17. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/pyproject.toml +0 -0
  18. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/setup.cfg +0 -0
  19. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/setup.py +0 -0
  20. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/__init__.py +0 -0
  21. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/compress/__init__.py +0 -0
  22. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/compress/video.py +0 -0
  23. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/jobs/__init__.py +0 -0
  24. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/jobs/abstract.py +0 -0
  25. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/jobs/download_job.py +0 -0
  26. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/jobs/types.py +0 -0
  27. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/jobs/upload_job.py +0 -0
  28. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/mediainfo/__init__.py +0 -0
  29. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/mediainfo/abstract.py +0 -0
  30. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/mediainfo/audio.py +0 -0
  31. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/mediainfo/silencer.py +0 -0
  32. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/mediainfo/video.py +0 -0
  33. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/scheduler/__init__.py +0 -0
  34. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/scheduler/scheduler.py +0 -0
  35. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/scraper/__init__.py +0 -0
  36. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/scraper/abstract.py +0 -0
  37. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/scraper/account_selector.py +0 -0
  38. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/scraper/fail_handler.py +0 -0
  39. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/scraper/instagram/__init__.py +0 -0
  40. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/scraper/link_resolver.py +0 -0
  41. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/scraper/youtube/__init__.py +0 -0
  42. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/scraper/youtube/abstract.py +0 -0
  43. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/scraper/youtube/music.py +0 -0
  44. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/scraper/youtube/shorts.py +0 -0
  45. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/scraper/youtube/youtube.py +0 -0
  46. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/storage/__init__.py +0 -0
  47. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/storage/mongo.py +0 -0
  48. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/telegram/__init__.py +0 -0
  49. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/telegram/bot.py +0 -0
  50. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/telegram/placeholder_message.py +0 -0
  51. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/telegram/utils.py +0 -0
  52. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/uploader/__init__.py +0 -0
  53. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon/warp_beacon.py +0 -0
  54. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon.egg-info/SOURCES.txt +0 -0
  55. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon.egg-info/dependency_links.txt +0 -0
  56. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon.egg-info/entry_points.txt +0 -0
  57. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon.egg-info/requires.txt +0 -0
  58. {warp_beacon-2.3.0 → warp_beacon-2.3.2}/warp_beacon.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: warp_beacon
3
- Version: 2.3.0
3
+ Version: 2.3.2
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
@@ -277,12 +277,16 @@ TG_BOT_ADMIN_USERNAME=""
277
277
  ###
278
278
  INSTAGRAM_LOGIN="instagram login (email or cell phone)"
279
279
  INSTAGRAM_PASSWORD="instgram password"
280
- INSTAGRAM_VERIFICATION_CODE="instagram 2FA if required, default empty"
281
280
  MONGODB_HOST="mongodb"
282
281
  MONGODB_PORT="27017"
283
282
  MONGODB_USER="root"
284
283
  MONGODB_PASSWORD="changeme"
285
- VIDEO_STORAGE_DIR="/var/warp_beacon/videos"
284
+ # more information about accounts.json and proxies.json
285
+ # can be found in project wiki
286
+ # https://github.com/sb0y/warp_beacon/wiki/Introduction-in-account.json-file
287
+ SERVICE_ACCOUNTS_FILE=/var/warp_beacon/accounts.json
288
+ PROXY_FILE=/var/warp_beacon/proxies.json
289
+
286
290
  # workers settings
287
291
  # default: min(32, os.cpu_count() + 4)
288
292
  #TG_WORKERS_POOL_SIZE=3
@@ -399,6 +403,10 @@ build deb file
399
403
  dpkg-buildpackage -us -uc -b
400
404
  ```
401
405
 
406
+ # Wiki
407
+ * [MongoDB backup and restore](https://github.com/sb0y/warp_beacon/wiki/MongoDB-backup-and-restore)
408
+ * [Introduction in account.json file](https://github.com/sb0y/warp_beacon/wiki/Introduction-in-account.json-file)
409
+
402
410
  # Support Warp Beacon project
403
411
 
404
412
  [<img src="https://cdn.cryptocloud.plus/brand/cc-group-black.png" alt="CryptoCloud Accepted" width="250px">](https://pay.cryptocloud.plus/pos/W5BMtNQt5bJFoW2E)
@@ -36,12 +36,16 @@ TG_BOT_ADMIN_USERNAME=""
36
36
  ###
37
37
  INSTAGRAM_LOGIN="instagram login (email or cell phone)"
38
38
  INSTAGRAM_PASSWORD="instgram password"
39
- INSTAGRAM_VERIFICATION_CODE="instagram 2FA if required, default empty"
40
39
  MONGODB_HOST="mongodb"
41
40
  MONGODB_PORT="27017"
42
41
  MONGODB_USER="root"
43
42
  MONGODB_PASSWORD="changeme"
44
- VIDEO_STORAGE_DIR="/var/warp_beacon/videos"
43
+ # more information about accounts.json and proxies.json
44
+ # can be found in project wiki
45
+ # https://github.com/sb0y/warp_beacon/wiki/Introduction-in-account.json-file
46
+ SERVICE_ACCOUNTS_FILE=/var/warp_beacon/accounts.json
47
+ PROXY_FILE=/var/warp_beacon/proxies.json
48
+
45
49
  # workers settings
46
50
  # default: min(32, os.cpu_count() + 4)
47
51
  #TG_WORKERS_POOL_SIZE=3
@@ -158,6 +162,10 @@ build deb file
158
162
  dpkg-buildpackage -us -uc -b
159
163
  ```
160
164
 
165
+ # Wiki
166
+ * [MongoDB backup and restore](https://github.com/sb0y/warp_beacon/wiki/MongoDB-backup-and-restore)
167
+ * [Introduction in account.json file](https://github.com/sb0y/warp_beacon/wiki/Introduction-in-account.json-file)
168
+
161
169
  # Support Warp Beacon project
162
170
 
163
171
  [<img src="https://cdn.cryptocloud.plus/brand/cc-group-black.png" alt="CryptoCloud Accepted" width="250px">](https://pay.cryptocloud.plus/pos/W5BMtNQt5bJFoW2E)
@@ -0,0 +1,2 @@
1
+ __version__ = "2.3.2"
2
+
@@ -11,7 +11,7 @@ class ScraperError(Exception):
11
11
  body=getattr(self, "error_type", vars(self)),
12
12
  )
13
13
  super().__init__(self.message, *args, **kwargs)
14
- if hasattr(self, "response") and self.response:
14
+ if hasattr(self, "response") and self.response:
15
15
  self.code = self.response.status_code
16
16
 
17
17
  class TimeOut(ScraperError):
@@ -33,6 +33,7 @@ INST_SESSION_FILE_TPL = "/var/warp_beacon/inst_session_account_%d.json"
33
33
  class InstagramScraper(ScraperAbstract):
34
34
  cl = None
35
35
  inst_session_file = ""
36
+ timeline_cursor = {}
36
37
 
37
38
  def __init__(self, account: tuple, proxy: dict=None) -> None:
38
39
  super().__init__(account, proxy)
@@ -71,9 +72,11 @@ class InstagramScraper(ScraperAbstract):
71
72
  })
72
73
 
73
74
  def safe_write_session(self) -> None:
75
+ cl_settings = self.cl.get_settings()
76
+ cl_settings["warp_timeline_cursor"] = self.timeline_cursor
74
77
  tmp_fname = "%s~" % self.inst_session_file
75
78
  with open(tmp_fname, 'w+', encoding="utf-8") as f:
76
- f.write(json.dumps(self.cl.get_settings()))
79
+ f.write(json.dumps(cl_settings))
77
80
  if os.path.exists(self.inst_session_file):
78
81
  os.unlink(self.inst_session_file)
79
82
  os.rename(tmp_fname, self.inst_session_file)
@@ -81,7 +84,12 @@ class InstagramScraper(ScraperAbstract):
81
84
  def load_session(self) -> None:
82
85
  if os.path.exists(self.inst_session_file):
83
86
  logging.info("Loading existing session file '%s'", self.inst_session_file)
84
- self.cl.load_settings(self.inst_session_file)
87
+ with open(self.inst_session_file, 'r', encoding="utf-8") as f:
88
+ js = json.loads(f.read())
89
+ if "warp_timeline_cursor" in js:
90
+ self.timeline_cursor = js.get("warp_timeline_cursor", {})
91
+ del js["warp_timeline_cursor"]
92
+ self.cl.set_settings(js)
85
93
  else:
86
94
  self._download_hndlr(self.login)
87
95
 
@@ -94,7 +102,7 @@ class InstagramScraper(ScraperAbstract):
94
102
 
95
103
  def validate_session(self) -> None:
96
104
  self.load_session()
97
- self._download_hndlr(self.cl.get_timeline_feed)
105
+ self.timeline_cursor = self._download_hndlr(self.cl.get_timeline_feed, "pull_to_refresh", self.timeline_cursor.get("next_max_id", None))
98
106
  self._download_hndlr(self.cl.get_reels_tray_feed, "pull_to_refresh")
99
107
  self._download_hndlr(self.cl.direct_active_presence)
100
108
  self._download_hndlr(self.cl.reels)
@@ -175,7 +175,8 @@ class Handlers(object):
175
175
  media_type=JobType.COLLECTION,
176
176
  chat_id=chat.id,
177
177
  chat_type=message.chat.type,
178
- source_username=Utils.extract_message_author(message)
178
+ source_username=Utils.extract_message_author(message),
179
+ message_leftover=msg_leftover
179
180
  )
180
181
  )
181
182
  elif ent_len:
@@ -203,7 +204,8 @@ class Handlers(object):
203
204
  uniq_id=uniq_id,
204
205
  job_origin=origin,
205
206
  source_username=Utils.extract_message_author(message),
206
- chat_type=chat.type
207
+ chat_type=chat.type,
208
+ message_leftover=msg_leftover
207
209
  )):
208
210
  self.bot.uploader.set_inprocess(uniq_id)
209
211
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: warp_beacon
3
- Version: 2.3.0
3
+ Version: 2.3.2
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
@@ -277,12 +277,16 @@ TG_BOT_ADMIN_USERNAME=""
277
277
  ###
278
278
  INSTAGRAM_LOGIN="instagram login (email or cell phone)"
279
279
  INSTAGRAM_PASSWORD="instgram password"
280
- INSTAGRAM_VERIFICATION_CODE="instagram 2FA if required, default empty"
281
280
  MONGODB_HOST="mongodb"
282
281
  MONGODB_PORT="27017"
283
282
  MONGODB_USER="root"
284
283
  MONGODB_PASSWORD="changeme"
285
- VIDEO_STORAGE_DIR="/var/warp_beacon/videos"
284
+ # more information about accounts.json and proxies.json
285
+ # can be found in project wiki
286
+ # https://github.com/sb0y/warp_beacon/wiki/Introduction-in-account.json-file
287
+ SERVICE_ACCOUNTS_FILE=/var/warp_beacon/accounts.json
288
+ PROXY_FILE=/var/warp_beacon/proxies.json
289
+
286
290
  # workers settings
287
291
  # default: min(32, os.cpu_count() + 4)
288
292
  #TG_WORKERS_POOL_SIZE=3
@@ -399,6 +403,10 @@ build deb file
399
403
  dpkg-buildpackage -us -uc -b
400
404
  ```
401
405
 
406
+ # Wiki
407
+ * [MongoDB backup and restore](https://github.com/sb0y/warp_beacon/wiki/MongoDB-backup-and-restore)
408
+ * [Introduction in account.json file](https://github.com/sb0y/warp_beacon/wiki/Introduction-in-account.json-file)
409
+
402
410
  # Support Warp Beacon project
403
411
 
404
412
  [<img src="https://cdn.cryptocloud.plus/brand/cc-group-black.png" alt="CryptoCloud Accepted" width="250px">](https://pay.cryptocloud.plus/pos/W5BMtNQt5bJFoW2E)
@@ -1,2 +0,0 @@
1
- __version__ = "2.3.0"
2
-
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes