warp-beacon 1.0.2__tar.gz → 1.0.3__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.
- {warp_beacon-1.0.2/warp_beacon.egg-info → warp_beacon-1.0.3}/PKG-INFO +75 -8
- warp_beacon-1.0.3/README.md +120 -0
- warp_beacon-1.0.3/etc/.gitignore +2 -0
- warp_beacon-1.0.3/warp_beacon/__version__.py +2 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/warp_beacon/jobs/abstract.py +8 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/warp_beacon/jobs/download_job.py +1 -1
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/warp_beacon/jobs/upload_job.py +1 -1
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/warp_beacon/scrapler/__init__.py +13 -4
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/warp_beacon/scrapler/instagram.py +5 -1
- {warp_beacon-1.0.2 → warp_beacon-1.0.3/warp_beacon.egg-info}/PKG-INFO +75 -8
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/warp_beacon.egg-info/SOURCES.txt +1 -0
- warp_beacon-1.0.2/README.md +0 -53
- warp_beacon-1.0.2/warp_beacon/__version__.py +0 -2
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/LICENSE +0 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/MANIFEST.in +0 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/etc/warp_beacon.conf +0 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/etc/warp_beacon.service +0 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/pyproject.toml +0 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/setup.cfg +0 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/setup.py +0 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/warp_beacon/__init__.py +0 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/warp_beacon/jobs/__init__.py +0 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/warp_beacon/mediainfo/__init__.py +0 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/warp_beacon/mediainfo/video.py +0 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/warp_beacon/scrapler/abstract.py +0 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/warp_beacon/storage/__init__.py +0 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/warp_beacon/uploader/__init__.py +0 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/warp_beacon/warp_beacon.py +0 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/warp_beacon.egg-info/dependency_links.txt +0 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/warp_beacon.egg-info/entry_points.txt +0 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/warp_beacon.egg-info/requires.txt +0 -0
- {warp_beacon-1.0.2 → warp_beacon-1.0.3}/warp_beacon.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: warp_beacon
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.3
|
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
|
@@ -231,14 +231,14 @@ Requires-Dist: pillow
|
|
231
231
|
Requires-Dist: pymongo
|
232
232
|
Requires-Dist: instagrapi==2.0.0
|
233
233
|
|
234
|
-
# warp_beacon [](https://github.com/sb0y/warp_beacon/actions/workflows/python-publish.yml) [](https://github.com/sb0y/warp_beacon/actions/workflows/docker-image.yml)
|
234
|
+
# warp_beacon [](https://github.com/sb0y/warp_beacon/actions/workflows/python-publish.yml) [](https://github.com/sb0y/warp_beacon/actions/workflows/docker-image.yml) [](https://github.com/sb0y/warp_beacon/actions/workflows/build-deb.yml)
|
235
235
|
|
236
236
|
Telegram bot for external social networks media scrapling.
|
237
237
|
Works with links in personal messages and also with group chats.
|
238
238
|
|
239
239
|
Just send to bot media link and get video.
|
240
240
|
|
241
|
-
All bot configuration stored in [
|
241
|
+
All bot configuration stored in [warp_beacon.conf](https://github.com/sb0y/warp_beacon/blob/main/etc/warp_beacon.conf) file.
|
242
242
|
|
243
243
|
## Configuration example ##
|
244
244
|
|
@@ -261,9 +261,21 @@ WORKERS_POOL_SIZE=3
|
|
261
261
|
Any Linux machine will suit in.
|
262
262
|
|
263
263
|
Install docker and git
|
264
|
-
```
|
265
|
-
apt update
|
266
|
-
|
264
|
+
```bash
|
265
|
+
sudo apt update
|
266
|
+
# uninstall old docker packages
|
267
|
+
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
|
268
|
+
sudo apt install ca-certificates curl git
|
269
|
+
sudo install -m 0755 -d /etc/apt/keyrings
|
270
|
+
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
271
|
+
sudo chmod a+r /etc/apt/keyrings/docker.asc
|
272
|
+
# Add the repository to Apt sources:
|
273
|
+
echo \
|
274
|
+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
|
275
|
+
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
276
|
+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
277
|
+
sudo apt update
|
278
|
+
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin git
|
267
279
|
```
|
268
280
|
|
269
281
|
Download sources
|
@@ -277,10 +289,65 @@ cd warp_beacon
|
|
277
289
|
|
278
290
|
Run app
|
279
291
|
```bash
|
280
|
-
docker
|
292
|
+
sudo docker compose up -d
|
281
293
|
```
|
282
294
|
|
283
295
|
Check logs
|
284
296
|
```bash
|
285
|
-
docker
|
297
|
+
sudo docker compose logs warp_beacon -f
|
298
|
+
```
|
299
|
+
|
300
|
+
## How to install from PIP ##
|
301
|
+
|
302
|
+
```bash
|
303
|
+
sudo apt update
|
304
|
+
sudo apt install python3-pip
|
305
|
+
sudo pip install warp-beacon
|
306
|
+
```
|
307
|
+
|
308
|
+
Your configuration file will be located at `/usr/local/lib/python3.10/dist-packages/etc/warp_beacon/warp_beacon.conf`.
|
309
|
+
For convenience, we will copy it to a common directory:
|
310
|
+
|
311
|
+
```bash
|
312
|
+
mkdir /etc/warp_beacon
|
313
|
+
cp /usr/local/lib/python3.10/dist-packages/etc/warp_beacon/warp_beacon.conf /etc/warp_beacon/warp_beacon.conf
|
314
|
+
```
|
315
|
+
|
316
|
+
Run the app
|
317
|
+
|
318
|
+
```bash
|
319
|
+
source /etc/warp_beacon/warp_beacon.conf && /usr/local/bin/warp_beacon
|
320
|
+
```
|
321
|
+
|
322
|
+
Most likely you will need a systemd service so that you don't have to start the service manually and don't have to worry about service start on server reboot.
|
323
|
+
|
324
|
+
```bash
|
325
|
+
cp /usr/local/lib/python3.10/dist-packages/lib/systemd/system/warp_beacon.service /lib/systemd/system
|
326
|
+
systemctl unmask warp_beacon.service
|
327
|
+
systemctl enable warp_beacon.service
|
328
|
+
# start the service app
|
329
|
+
systemctl start warp_beacon.service
|
330
|
+
```
|
331
|
+
|
332
|
+
## How to build Python whl package ##
|
333
|
+
```bash
|
334
|
+
sudo apt install python3-pip python3-build python3-virtualenv dh-virtualenv
|
335
|
+
# If you are getting build errors you probably need the latest version of python3-build
|
336
|
+
sudo python3 -m pip install --upgrade build
|
337
|
+
python3 -m build
|
338
|
+
```
|
339
|
+
|
340
|
+
## How to build Ubuntu deb package ##
|
341
|
+
|
342
|
+
```bash
|
343
|
+
sudo apt update
|
344
|
+
sudo apt install debhelper python3-pip python3-build python3-virtualenv dh-virtualenv dh-python
|
345
|
+
# If you are getting build errors you probably need the latest version of python3-build
|
346
|
+
sudo python3 -m pip install --upgrade build
|
347
|
+
```
|
348
|
+
|
349
|
+
build deb file
|
350
|
+
|
351
|
+
```bash
|
352
|
+
dpkg-buildpackage -us -uc -b
|
286
353
|
```
|
@@ -0,0 +1,120 @@
|
|
1
|
+
# warp_beacon [](https://github.com/sb0y/warp_beacon/actions/workflows/python-publish.yml) [](https://github.com/sb0y/warp_beacon/actions/workflows/docker-image.yml) [](https://github.com/sb0y/warp_beacon/actions/workflows/build-deb.yml)
|
2
|
+
|
3
|
+
Telegram bot for external social networks media scrapling.
|
4
|
+
Works with links in personal messages and also with group chats.
|
5
|
+
|
6
|
+
Just send to bot media link and get video.
|
7
|
+
|
8
|
+
All bot configuration stored in [warp_beacon.conf](https://github.com/sb0y/warp_beacon/blob/main/etc/warp_beacon.conf) file.
|
9
|
+
|
10
|
+
## Configuration example ##
|
11
|
+
|
12
|
+
```env
|
13
|
+
TG_TOKEN="you telegram token received from @BotFather"
|
14
|
+
INSTAGRAM_LOGIN="instagram login (email or cell phone)"
|
15
|
+
INSTAGRAM_PASSWORD="instgram password"
|
16
|
+
INSTAGRAM_VERIFICATION_CODE="instagram 2FA if required, default empty"
|
17
|
+
MONGODB_HOST="mongodb"
|
18
|
+
MONGODB_PORT="27017"
|
19
|
+
MONGODB_USER="root"
|
20
|
+
MONGODB_PASSWORD="changeme"
|
21
|
+
VIDEO_STORAGE_DIR="/var/warp_beacon/videos"
|
22
|
+
WORKERS_POOL_SIZE=3
|
23
|
+
```
|
24
|
+
## Deployed example bot ##
|
25
|
+
[Try it 🚀](https://t.me/anus_sebe_zablokiruy_bot)
|
26
|
+
|
27
|
+
## How to run ##
|
28
|
+
Any Linux machine will suit in.
|
29
|
+
|
30
|
+
Install docker and git
|
31
|
+
```bash
|
32
|
+
sudo apt update
|
33
|
+
# uninstall old docker packages
|
34
|
+
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
|
35
|
+
sudo apt install ca-certificates curl git
|
36
|
+
sudo install -m 0755 -d /etc/apt/keyrings
|
37
|
+
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
38
|
+
sudo chmod a+r /etc/apt/keyrings/docker.asc
|
39
|
+
# Add the repository to Apt sources:
|
40
|
+
echo \
|
41
|
+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
|
42
|
+
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
43
|
+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
44
|
+
sudo apt update
|
45
|
+
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin git
|
46
|
+
```
|
47
|
+
|
48
|
+
Download sources
|
49
|
+
```bash
|
50
|
+
git clone https://github.com/sb0y/warp_beacon.git
|
51
|
+
```
|
52
|
+
Go to sources directory
|
53
|
+
```bash
|
54
|
+
cd warp_beacon
|
55
|
+
```
|
56
|
+
|
57
|
+
Run app
|
58
|
+
```bash
|
59
|
+
sudo docker compose up -d
|
60
|
+
```
|
61
|
+
|
62
|
+
Check logs
|
63
|
+
```bash
|
64
|
+
sudo docker compose logs warp_beacon -f
|
65
|
+
```
|
66
|
+
|
67
|
+
## How to install from PIP ##
|
68
|
+
|
69
|
+
```bash
|
70
|
+
sudo apt update
|
71
|
+
sudo apt install python3-pip
|
72
|
+
sudo pip install warp-beacon
|
73
|
+
```
|
74
|
+
|
75
|
+
Your configuration file will be located at `/usr/local/lib/python3.10/dist-packages/etc/warp_beacon/warp_beacon.conf`.
|
76
|
+
For convenience, we will copy it to a common directory:
|
77
|
+
|
78
|
+
```bash
|
79
|
+
mkdir /etc/warp_beacon
|
80
|
+
cp /usr/local/lib/python3.10/dist-packages/etc/warp_beacon/warp_beacon.conf /etc/warp_beacon/warp_beacon.conf
|
81
|
+
```
|
82
|
+
|
83
|
+
Run the app
|
84
|
+
|
85
|
+
```bash
|
86
|
+
source /etc/warp_beacon/warp_beacon.conf && /usr/local/bin/warp_beacon
|
87
|
+
```
|
88
|
+
|
89
|
+
Most likely you will need a systemd service so that you don't have to start the service manually and don't have to worry about service start on server reboot.
|
90
|
+
|
91
|
+
```bash
|
92
|
+
cp /usr/local/lib/python3.10/dist-packages/lib/systemd/system/warp_beacon.service /lib/systemd/system
|
93
|
+
systemctl unmask warp_beacon.service
|
94
|
+
systemctl enable warp_beacon.service
|
95
|
+
# start the service app
|
96
|
+
systemctl start warp_beacon.service
|
97
|
+
```
|
98
|
+
|
99
|
+
## How to build Python whl package ##
|
100
|
+
```bash
|
101
|
+
sudo apt install python3-pip python3-build python3-virtualenv dh-virtualenv
|
102
|
+
# If you are getting build errors you probably need the latest version of python3-build
|
103
|
+
sudo python3 -m pip install --upgrade build
|
104
|
+
python3 -m build
|
105
|
+
```
|
106
|
+
|
107
|
+
## How to build Ubuntu deb package ##
|
108
|
+
|
109
|
+
```bash
|
110
|
+
sudo apt update
|
111
|
+
sudo apt install debhelper python3-pip python3-build python3-virtualenv dh-virtualenv dh-python
|
112
|
+
# If you are getting build errors you probably need the latest version of python3-build
|
113
|
+
sudo python3 -m pip install --upgrade build
|
114
|
+
```
|
115
|
+
|
116
|
+
build deb file
|
117
|
+
|
118
|
+
```bash
|
119
|
+
dpkg-buildpackage -us -uc -b
|
120
|
+
```
|
@@ -49,6 +49,14 @@ class AbstractJob(ABC):
|
|
49
49
|
def __repr__(self) -> str:
|
50
50
|
return str(self.to_dict())
|
51
51
|
|
52
|
+
def is_empty(self) -> bool:
|
53
|
+
if self.media_type == "collection":
|
54
|
+
if not self.media_collection:
|
55
|
+
return True
|
56
|
+
elif not self.local_media_path:
|
57
|
+
return True
|
58
|
+
return False
|
59
|
+
|
52
60
|
def to_dict(self) -> dict:
|
53
61
|
d = {}
|
54
62
|
for key in dir(self.__class__):
|
@@ -3,7 +3,7 @@ import multiprocessing
|
|
3
3
|
import time
|
4
4
|
import logging
|
5
5
|
from requests.exceptions import ConnectTimeout, HTTPError
|
6
|
-
from instagrapi.exceptions import MediaNotFound, UnknownError
|
6
|
+
from instagrapi.exceptions import MediaNotFound, UnknownError, ClientNotFoundError, UserNotFound
|
7
7
|
|
8
8
|
from warp_beacon.mediainfo.video import VideoInfo
|
9
9
|
from warp_beacon.uploader import AsyncUploader
|
@@ -70,8 +70,8 @@ class AsyncDownloader(object):
|
|
70
70
|
logging.error("ConnectTimeout download error!")
|
71
71
|
logging.exception(e)
|
72
72
|
time.sleep(2)
|
73
|
-
except MediaNotFound as e:
|
74
|
-
logging.warning("
|
73
|
+
except (MediaNotFound, ClientNotFoundError, UserNotFound) as e:
|
74
|
+
logging.warning("Not found error occurred!")
|
75
75
|
logging.exception(e)
|
76
76
|
self.uploader.queue_task(job.to_upload_job(
|
77
77
|
job_failed=True,
|
@@ -118,8 +118,17 @@ class AsyncDownloader(object):
|
|
118
118
|
else:
|
119
119
|
job_args["local_media_path"] = item["local_media_path"]
|
120
120
|
|
121
|
+
logging.debug("local_media_path: '%s'", job_args.get("local_media_path", ""))
|
122
|
+
logging.debug("media_collection: '%s'", str(job_args.get("media_collection", {})))
|
121
123
|
upload_job = job.to_upload_job(**job_args)
|
122
|
-
|
124
|
+
if upload_job.is_empty():
|
125
|
+
logging.info("Upload job is empty. Nothing to do here!")
|
126
|
+
self.uploader.queue_task(job.to_upload_job(
|
127
|
+
job_failed=True,
|
128
|
+
job_failed_msg="Seems like this link doesn't contains any media.")
|
129
|
+
)
|
130
|
+
else:
|
131
|
+
self.uploader.queue_task(upload_job)
|
123
132
|
else:
|
124
133
|
logging.info("Job already in work in parallel worker. Redirecting job to upload worker.")
|
125
134
|
self.uploader.queue_task(job.to_upload_job())
|
@@ -6,6 +6,7 @@ from typing import Callable, Optional, Union
|
|
6
6
|
|
7
7
|
import requests
|
8
8
|
import urllib3
|
9
|
+
from urllib.parse import urljoin, urlparse
|
9
10
|
import logging
|
10
11
|
|
11
12
|
from instagrapi.mixins.story import Story
|
@@ -51,7 +52,10 @@ class InstagramScrapler(ScraplerAbstract):
|
|
51
52
|
self.load_session()
|
52
53
|
def _scrap() -> tuple[str]:
|
53
54
|
if "stories" in url:
|
54
|
-
|
55
|
+
# remove URL options
|
56
|
+
_url = urljoin(url, urlparse(url).path)
|
57
|
+
url_last_part = list(filter(None, _url.split('/')))[-1]
|
58
|
+
logging.debug("url last part: '%s'", url_last_part)
|
55
59
|
if url_last_part.isnumeric():
|
56
60
|
return "story", self.scrap_story(url)
|
57
61
|
else:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: warp_beacon
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.3
|
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
|
@@ -231,14 +231,14 @@ Requires-Dist: pillow
|
|
231
231
|
Requires-Dist: pymongo
|
232
232
|
Requires-Dist: instagrapi==2.0.0
|
233
233
|
|
234
|
-
# warp_beacon [](https://github.com/sb0y/warp_beacon/actions/workflows/python-publish.yml) [](https://github.com/sb0y/warp_beacon/actions/workflows/docker-image.yml)
|
234
|
+
# warp_beacon [](https://github.com/sb0y/warp_beacon/actions/workflows/python-publish.yml) [](https://github.com/sb0y/warp_beacon/actions/workflows/docker-image.yml) [](https://github.com/sb0y/warp_beacon/actions/workflows/build-deb.yml)
|
235
235
|
|
236
236
|
Telegram bot for external social networks media scrapling.
|
237
237
|
Works with links in personal messages and also with group chats.
|
238
238
|
|
239
239
|
Just send to bot media link and get video.
|
240
240
|
|
241
|
-
All bot configuration stored in [
|
241
|
+
All bot configuration stored in [warp_beacon.conf](https://github.com/sb0y/warp_beacon/blob/main/etc/warp_beacon.conf) file.
|
242
242
|
|
243
243
|
## Configuration example ##
|
244
244
|
|
@@ -261,9 +261,21 @@ WORKERS_POOL_SIZE=3
|
|
261
261
|
Any Linux machine will suit in.
|
262
262
|
|
263
263
|
Install docker and git
|
264
|
-
```
|
265
|
-
apt update
|
266
|
-
|
264
|
+
```bash
|
265
|
+
sudo apt update
|
266
|
+
# uninstall old docker packages
|
267
|
+
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
|
268
|
+
sudo apt install ca-certificates curl git
|
269
|
+
sudo install -m 0755 -d /etc/apt/keyrings
|
270
|
+
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
271
|
+
sudo chmod a+r /etc/apt/keyrings/docker.asc
|
272
|
+
# Add the repository to Apt sources:
|
273
|
+
echo \
|
274
|
+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
|
275
|
+
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
276
|
+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
277
|
+
sudo apt update
|
278
|
+
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin git
|
267
279
|
```
|
268
280
|
|
269
281
|
Download sources
|
@@ -277,10 +289,65 @@ cd warp_beacon
|
|
277
289
|
|
278
290
|
Run app
|
279
291
|
```bash
|
280
|
-
docker
|
292
|
+
sudo docker compose up -d
|
281
293
|
```
|
282
294
|
|
283
295
|
Check logs
|
284
296
|
```bash
|
285
|
-
docker
|
297
|
+
sudo docker compose logs warp_beacon -f
|
298
|
+
```
|
299
|
+
|
300
|
+
## How to install from PIP ##
|
301
|
+
|
302
|
+
```bash
|
303
|
+
sudo apt update
|
304
|
+
sudo apt install python3-pip
|
305
|
+
sudo pip install warp-beacon
|
306
|
+
```
|
307
|
+
|
308
|
+
Your configuration file will be located at `/usr/local/lib/python3.10/dist-packages/etc/warp_beacon/warp_beacon.conf`.
|
309
|
+
For convenience, we will copy it to a common directory:
|
310
|
+
|
311
|
+
```bash
|
312
|
+
mkdir /etc/warp_beacon
|
313
|
+
cp /usr/local/lib/python3.10/dist-packages/etc/warp_beacon/warp_beacon.conf /etc/warp_beacon/warp_beacon.conf
|
314
|
+
```
|
315
|
+
|
316
|
+
Run the app
|
317
|
+
|
318
|
+
```bash
|
319
|
+
source /etc/warp_beacon/warp_beacon.conf && /usr/local/bin/warp_beacon
|
320
|
+
```
|
321
|
+
|
322
|
+
Most likely you will need a systemd service so that you don't have to start the service manually and don't have to worry about service start on server reboot.
|
323
|
+
|
324
|
+
```bash
|
325
|
+
cp /usr/local/lib/python3.10/dist-packages/lib/systemd/system/warp_beacon.service /lib/systemd/system
|
326
|
+
systemctl unmask warp_beacon.service
|
327
|
+
systemctl enable warp_beacon.service
|
328
|
+
# start the service app
|
329
|
+
systemctl start warp_beacon.service
|
330
|
+
```
|
331
|
+
|
332
|
+
## How to build Python whl package ##
|
333
|
+
```bash
|
334
|
+
sudo apt install python3-pip python3-build python3-virtualenv dh-virtualenv
|
335
|
+
# If you are getting build errors you probably need the latest version of python3-build
|
336
|
+
sudo python3 -m pip install --upgrade build
|
337
|
+
python3 -m build
|
338
|
+
```
|
339
|
+
|
340
|
+
## How to build Ubuntu deb package ##
|
341
|
+
|
342
|
+
```bash
|
343
|
+
sudo apt update
|
344
|
+
sudo apt install debhelper python3-pip python3-build python3-virtualenv dh-virtualenv dh-python
|
345
|
+
# If you are getting build errors you probably need the latest version of python3-build
|
346
|
+
sudo python3 -m pip install --upgrade build
|
347
|
+
```
|
348
|
+
|
349
|
+
build deb file
|
350
|
+
|
351
|
+
```bash
|
352
|
+
dpkg-buildpackage -us -uc -b
|
286
353
|
```
|
warp_beacon-1.0.2/README.md
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
# warp_beacon [](https://github.com/sb0y/warp_beacon/actions/workflows/python-publish.yml) [](https://github.com/sb0y/warp_beacon/actions/workflows/docker-image.yml)
|
2
|
-
|
3
|
-
Telegram bot for external social networks media scrapling.
|
4
|
-
Works with links in personal messages and also with group chats.
|
5
|
-
|
6
|
-
Just send to bot media link and get video.
|
7
|
-
|
8
|
-
All bot configuration stored in [variables.env](https://github.com/sb0y/warp_beacon/blob/main/variables.env) file.
|
9
|
-
|
10
|
-
## Configuration example ##
|
11
|
-
|
12
|
-
```env
|
13
|
-
TG_TOKEN="you telegram token received from @BotFather"
|
14
|
-
INSTAGRAM_LOGIN="instagram login (email or cell phone)"
|
15
|
-
INSTAGRAM_PASSWORD="instgram password"
|
16
|
-
INSTAGRAM_VERIFICATION_CODE="instagram 2FA if required, default empty"
|
17
|
-
MONGODB_HOST="mongodb"
|
18
|
-
MONGODB_PORT="27017"
|
19
|
-
MONGODB_USER="root"
|
20
|
-
MONGODB_PASSWORD="changeme"
|
21
|
-
VIDEO_STORAGE_DIR="/var/warp_beacon/videos"
|
22
|
-
WORKERS_POOL_SIZE=3
|
23
|
-
```
|
24
|
-
## Deployed example bot ##
|
25
|
-
[Try it 🚀](https://t.me/anus_sebe_zablokiruy_bot)
|
26
|
-
|
27
|
-
## How to run ##
|
28
|
-
Any Linux machine will suit in.
|
29
|
-
|
30
|
-
Install docker and git
|
31
|
-
```
|
32
|
-
apt update
|
33
|
-
apt install docker-compose git
|
34
|
-
```
|
35
|
-
|
36
|
-
Download sources
|
37
|
-
```bash
|
38
|
-
git clone https://github.com/sb0y/warp_beacon.git
|
39
|
-
```
|
40
|
-
Go to sources directory
|
41
|
-
```bash
|
42
|
-
cd warp_beacon
|
43
|
-
```
|
44
|
-
|
45
|
-
Run app
|
46
|
-
```bash
|
47
|
-
docker-compose up -d
|
48
|
-
```
|
49
|
-
|
50
|
-
Check logs
|
51
|
-
```bash
|
52
|
-
docker-compose logs warp_beacon -f
|
53
|
-
```
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|