warp-beacon 2.2.16__tar.gz → 2.2.17__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-2.2.16/warp_beacon.egg-info → warp_beacon-2.2.17}/PKG-INFO +1 -1
- warp_beacon-2.2.17/warp_beacon/__version__.py +2 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/scraper/youtube/abstract.py +17 -16
- {warp_beacon-2.2.16 → warp_beacon-2.2.17/warp_beacon.egg-info}/PKG-INFO +1 -1
- warp_beacon-2.2.16/warp_beacon/__version__.py +0 -2
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/LICENSE +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/MANIFEST.in +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/README.md +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/assets/placeholder.gif +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/etc/.gitignore +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/etc/accounts.json +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/etc/warp_beacon.conf +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/etc/warp_beacon.service +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/pyproject.toml +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/setup.cfg +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/setup.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/__init__.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/compress/__init__.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/compress/video.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/jobs/__init__.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/jobs/abstract.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/jobs/download_job.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/jobs/types.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/jobs/upload_job.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/mediainfo/__init__.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/mediainfo/abstract.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/mediainfo/audio.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/mediainfo/silencer.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/mediainfo/video.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/scheduler/__init__.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/scheduler/scheduler.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/scraper/__init__.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/scraper/abstract.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/scraper/account_selector.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/scraper/exceptions.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/scraper/instagram/__init__.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/scraper/instagram/instagram.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/scraper/youtube/__init__.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/scraper/youtube/music.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/scraper/youtube/shorts.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/scraper/youtube/youtube.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/storage/__init__.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/telegram/__init__.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/telegram/bot.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/telegram/handlers.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/telegram/placeholder_message.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/telegram/utils.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/uploader/__init__.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon/warp_beacon.py +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon.egg-info/SOURCES.txt +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon.egg-info/dependency_links.txt +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon.egg-info/entry_points.txt +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon.egg-info/requires.txt +0 -0
- {warp_beacon-2.2.16 → warp_beacon-2.2.17}/warp_beacon.egg-info/top_level.txt +0 -0
@@ -103,27 +103,28 @@ class YoutubeAbstract(ScraperAbstract):
|
|
103
103
|
if "yt_download_" in i:
|
104
104
|
os.unlink("%s/%s" % (self.DOWNLOAD_DIR, i))
|
105
105
|
|
106
|
-
def calculate_size(self, aspect_ratio_width: int, aspect_ratio_height: int, max_width: int=1280, max_height: int=1280, min_width: int=
|
106
|
+
def calculate_size(self, aspect_ratio_width: int, aspect_ratio_height: int, max_width: int=1280, max_height: int=1280, min_width: int=320, min_height: int=320, prefer_min_size: bool=False) -> tuple:
|
107
107
|
# check ratio
|
108
108
|
aspect_ratio = aspect_ratio_width / aspect_ratio_height
|
109
109
|
|
110
|
-
|
111
|
-
|
112
|
-
height = int(width / aspect_ratio)
|
113
|
-
|
114
|
-
# if height exceeds max height of Telegram recalculate based on max height
|
115
|
-
if height > max_height:
|
116
|
-
height = max_height
|
117
|
-
width = int(height * aspect_ratio)
|
118
|
-
|
119
|
-
# check min sizes
|
120
|
-
if width < min_width:
|
110
|
+
if prefer_min_size:
|
111
|
+
# Probing min width and calculating height
|
121
112
|
width = min_width
|
122
113
|
height = int(width / aspect_ratio)
|
123
|
-
|
124
|
-
|
125
|
-
height
|
126
|
-
|
114
|
+
|
115
|
+
# if height is less than min, recalculatng based on min height
|
116
|
+
if height < min_height:
|
117
|
+
height = min_height
|
118
|
+
width = int(height * aspect_ratio)
|
119
|
+
else:
|
120
|
+
# Probing max width and calculating height
|
121
|
+
width = max_width
|
122
|
+
height = int(width / aspect_ratio)
|
123
|
+
|
124
|
+
# if height exceeds max height Telegram, recalculatng based on max height
|
125
|
+
if height > max_height:
|
126
|
+
height = max_height
|
127
|
+
width = int(height * aspect_ratio)
|
127
128
|
|
128
129
|
return width, height
|
129
130
|
|
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
|
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
|
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
|