warp-beacon 1.0.7__py3-none-any.whl → 1.0.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.
- etc/warp_beacon/warp_beacon.conf +2 -1
- warp_beacon/__version__.py +1 -1
- warp_beacon/mediainfo/video.py +25 -12
- {warp_beacon-1.0.7.dist-info → warp_beacon-1.0.8.dist-info}/METADATA +1 -1
- {warp_beacon-1.0.7.dist-info → warp_beacon-1.0.8.dist-info}/RECORD +9 -9
- {warp_beacon-1.0.7.dist-info → warp_beacon-1.0.8.dist-info}/LICENSE +0 -0
- {warp_beacon-1.0.7.dist-info → warp_beacon-1.0.8.dist-info}/WHEEL +0 -0
- {warp_beacon-1.0.7.dist-info → warp_beacon-1.0.8.dist-info}/entry_points.txt +0 -0
- {warp_beacon-1.0.7.dist-info → warp_beacon-1.0.8.dist-info}/top_level.txt +0 -0
etc/warp_beacon/warp_beacon.conf
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
TG_TOKEN=""
|
2
2
|
INSTAGRAM_LOGIN=""
|
3
3
|
INSTAGRAM_PASSWORD=""
|
4
|
-
INSTAGRAM_VERIFICATION_CODE=""
|
4
|
+
INSTAGRAM_VERIFICATION_CODE="933917"
|
5
5
|
MONGODB_HOST="mongodb"
|
6
6
|
MONGODB_PORT="27017"
|
7
7
|
MONGODB_USER="root"
|
8
8
|
MONGODB_PASSWORD="changeme"
|
9
9
|
VIDEO_STORAGE_DIR="/var/warp_beacon/videos"
|
10
10
|
WORKERS_POOL_SIZE=3
|
11
|
+
ENABLE_DONATES=true
|
warp_beacon/__version__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
__version__ = "1.0.
|
1
|
+
__version__ = "1.0.8"
|
2
2
|
|
warp_beacon/mediainfo/video.py
CHANGED
@@ -43,13 +43,17 @@ class VideoInfo(object):
|
|
43
43
|
res = {}
|
44
44
|
res.update(self.get_demensions())
|
45
45
|
if "duration" not in except_info:
|
46
|
-
res["duration"] = self.get_duration()
|
46
|
+
res["duration"] = int(self.get_duration())
|
47
47
|
if "filesize" not in except_info:
|
48
|
-
res["filesize"] = VideoInfo.get_filesize(self.filename)
|
48
|
+
res["filesize"] = round(VideoInfo.get_filesize(self.filename), 2)
|
49
49
|
return res
|
50
50
|
|
51
51
|
def shrink_image_to_fit(self, image: Image, size: tuple = (320, 320)) -> Image:
|
52
52
|
image.thumbnail(size, Image.Resampling.LANCZOS)
|
53
|
+
#image.save(
|
54
|
+
# "/tmp/test.th.jpg",
|
55
|
+
# quality=80,
|
56
|
+
#)
|
53
57
|
return image
|
54
58
|
|
55
59
|
def generate_thumbnail(self) -> Union[io.BytesIO, None]:
|
@@ -59,17 +63,26 @@ class VideoInfo(object):
|
|
59
63
|
# Signal that we only want to look at keyframes.
|
60
64
|
stream = container.streams.video[0]
|
61
65
|
stream.codec_context.skip_frame = "NONKEY"
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
66
|
+
frame_num = 10
|
67
|
+
time_base = container.streams.video[0].time_base
|
68
|
+
framerate = container.streams.video[0].average_rate
|
69
|
+
frame_container_pts = round((frame_num / framerate) / time_base)
|
70
|
+
|
71
|
+
container.seek(frame_container_pts, backward=True, stream=container.streams.video[0])
|
72
|
+
frame = next(container.decode(stream))
|
73
|
+
|
67
74
|
image = frame.to_image()
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
75
|
+
#image.save(
|
76
|
+
# "/tmp/test.{:04d}.jpg".format(frame.pts),
|
77
|
+
# quality=80,
|
78
|
+
#)
|
79
|
+
#break
|
80
|
+
if image:
|
81
|
+
image = self.shrink_image_to_fit(image)
|
82
|
+
io_buf = io.BytesIO()
|
83
|
+
image.save(io_buf, format='JPEG')
|
84
|
+
io_buf.seek(0)
|
85
|
+
return io_buf
|
73
86
|
except Exception as e:
|
74
87
|
logging.error("Failed to generate thumbnail!")
|
75
88
|
logging.exception(e)
|
@@ -1,8 +1,8 @@
|
|
1
|
-
etc/warp_beacon/warp_beacon.conf,sha256=
|
1
|
+
etc/warp_beacon/warp_beacon.conf,sha256=1gGvh36cnFr0rU4mVomfy66hQz9EvugaNzeH6_tmBM0,266
|
2
2
|
lib/systemd/system/warp_beacon.service,sha256=lPmHqLqcI2eIV7nwHS0qcALQrznixqJuwwPfa2mDLUA,372
|
3
3
|
var/warp_beacon/placeholder.gif,sha256=cE5CGJVaop4Sx21zx6j4AyoHU0ncmvQuS2o6hJfEH88,6064
|
4
4
|
warp_beacon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
warp_beacon/__version__.py,sha256=
|
5
|
+
warp_beacon/__version__.py,sha256=jOGC2HGDoU2OhY9xBiOPgX9B0ssXLXx0OeKHzO1DTV8,23
|
6
6
|
warp_beacon/warp_beacon.py,sha256=agUu6_Qt1UnGTSqYqXQZtHeeWqRkhlIHt_Repph1G3k,19581
|
7
7
|
warp_beacon/compress/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
warp_beacon/compress/video.py,sha256=_PDMVYCyzLYxHv1uZmmzGcG_8rjaZr7BTXsXTTy_oS4,2846
|
@@ -11,15 +11,15 @@ warp_beacon/jobs/abstract.py,sha256=-eXvrRgrUBed1z9iYZd0RxZ8fi0Okq3r0i7PDN31FkY,
|
|
11
11
|
warp_beacon/jobs/download_job.py,sha256=wfZrKUerfYIjWkRxPzfl5gwIlcotIMH7OpTUM9ae8NY,736
|
12
12
|
warp_beacon/jobs/upload_job.py,sha256=Vaogc4vbpAfyaT4VkIHEPLFRELmM44TDqkmnPYh3Ymc,740
|
13
13
|
warp_beacon/mediainfo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
|
-
warp_beacon/mediainfo/video.py,sha256=
|
14
|
+
warp_beacon/mediainfo/video.py,sha256=CbaJmAoHAYNBI4bwvsIXYqTRNlFj9OtDhvxLgywMnho,2536
|
15
15
|
warp_beacon/scrapler/__init__.py,sha256=J1kRZfkCuTucRnklElXnrMUZUGpg8wIGYWGrfY5a1xc,7335
|
16
16
|
warp_beacon/scrapler/abstract.py,sha256=MJxpEovCWDYq2SwbbMsRDfp77WTwvbXXKiQxKWoj0ZQ,304
|
17
17
|
warp_beacon/scrapler/instagram.py,sha256=8CF_Zdxn1hStz_PgLxTc0FTt5heI84d-Ks0XzmD7-_o,7248
|
18
18
|
warp_beacon/storage/__init__.py,sha256=NhD3V7UNRiZNf61yQEAjXOfi-tfA2LaJa7a7kvbkmtE,2402
|
19
19
|
warp_beacon/uploader/__init__.py,sha256=9qQAuYisXiVIjQghxcxpF4WAdW7lm7HmpkOXQjGNJXk,4346
|
20
|
-
warp_beacon-1.0.
|
21
|
-
warp_beacon-1.0.
|
22
|
-
warp_beacon-1.0.
|
23
|
-
warp_beacon-1.0.
|
24
|
-
warp_beacon-1.0.
|
25
|
-
warp_beacon-1.0.
|
20
|
+
warp_beacon-1.0.8.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
21
|
+
warp_beacon-1.0.8.dist-info/METADATA,sha256=Ma5F75k0lR3JAK-aiZFYdZc_u2xO1IplbuWTQwzsKZ8,18219
|
22
|
+
warp_beacon-1.0.8.dist-info/WHEEL,sha256=rWxmBtp7hEUqVLOnTaDOPpR-cZpCDkzhhcBce-Zyd5k,91
|
23
|
+
warp_beacon-1.0.8.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
|
24
|
+
warp_beacon-1.0.8.dist-info/top_level.txt,sha256=510sqsM4LLO-DC4HbUkwdVKmYY_26lbnvJwSq_RLT00,382
|
25
|
+
warp_beacon-1.0.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|