warp-beacon 2.6.10__tar.gz → 2.6.11__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.6.10/warp_beacon.egg-info → warp_beacon-2.6.11}/PKG-INFO +1 -1
- warp_beacon-2.6.11/warp_beacon/__version__.py +2 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/scraper/youtube/youtube.py +28 -2
- {warp_beacon-2.6.10 → warp_beacon-2.6.11/warp_beacon.egg-info}/PKG-INFO +1 -1
- warp_beacon-2.6.10/warp_beacon/__version__.py +0 -2
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/LICENSE +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/MANIFEST.in +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/README.md +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/assets/placeholder.gif +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/etc/.gitignore +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/etc/accounts.json +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/etc/proxies.json +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/etc/warp_beacon.conf +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/etc/warp_beacon.service +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/pyproject.toml +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/setup.cfg +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/setup.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/__init__.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/compress/__init__.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/compress/video.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/jobs/__init__.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/jobs/abstract.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/jobs/download_job.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/jobs/types.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/jobs/upload_job.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/mediainfo/__init__.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/mediainfo/abstract.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/mediainfo/audio.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/mediainfo/silencer.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/mediainfo/video.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/scheduler/__init__.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/scheduler/instagram_human.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/scheduler/scheduler.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/scraper/__init__.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/scraper/abstract.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/scraper/account_selector.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/scraper/exceptions.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/scraper/fail_handler.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/scraper/instagram/__init__.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/scraper/instagram/captcha.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/scraper/instagram/instagram.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/scraper/link_resolver.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/scraper/youtube/__init__.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/scraper/youtube/abstract.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/scraper/youtube/music.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/scraper/youtube/shorts.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/storage/__init__.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/storage/mongo.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/telegram/__init__.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/telegram/bot.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/telegram/caption_shortener.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/telegram/handlers.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/telegram/placeholder_message.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/telegram/utils.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/uploader/__init__.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/warp_beacon.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon/yt_auth.py +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon.egg-info/SOURCES.txt +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon.egg-info/dependency_links.txt +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon.egg-info/entry_points.txt +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon.egg-info/requires.txt +0 -0
- {warp_beacon-2.6.10 → warp_beacon-2.6.11}/warp_beacon.egg-info/top_level.txt +0 -0
@@ -78,6 +78,9 @@ class YoutubeScraper(YoutubeAbstract):
|
|
78
78
|
|
79
79
|
video_stream = yt.streams.filter(adaptive=True, file_extension='mp4', only_video=True).order_by('resolution').desc().first()
|
80
80
|
audio_stream = yt.streams.filter(adaptive=True, file_extension='mp4', only_audio=True).order_by('abr').desc().first()
|
81
|
+
size_in_bytes = video_stream.filesize + audio_stream.filesize
|
82
|
+
if size_in_bytes > 2147483648: # 2 GiB
|
83
|
+
video_stream = yt.streams.filter(adaptive=True, file_extension='mp4', only_video=True, res='720p').order_by('resolution').desc().first()
|
81
84
|
|
82
85
|
local_video_file = video_stream.download(
|
83
86
|
output_path=self.DOWNLOAD_DIR,
|
@@ -161,7 +164,30 @@ class YoutubeScraper(YoutubeAbstract):
|
|
161
164
|
def _download_yt_dlp(self, url: str, thumbnail: Optional[io.BytesIO] = None, timeout: int = 60) -> list:
|
162
165
|
res = []
|
163
166
|
with self.build_yt_dlp(timeout) as ydl:
|
164
|
-
info = ydl.extract_info(url, download=
|
167
|
+
info = ydl.extract_info(url, download=False)
|
168
|
+
formats = info.get('formats', [])
|
169
|
+
|
170
|
+
dl_format = {}
|
171
|
+
for f in sorted(formats, key=lambda x: (x.get('height') or 0), reverse=True):
|
172
|
+
if f.get('vcodec') != 'none' and f.get('acodec') != 'none' and f.get('ext') == 'mp4':
|
173
|
+
dl_format = f
|
174
|
+
break
|
175
|
+
|
176
|
+
filesize = dl_format.get('filesize', 0) or dl_format.get('filesize_approx', 0)
|
177
|
+
if filesize:
|
178
|
+
if filesize > 2147483648: # 2 GiB
|
179
|
+
logging.warning("Max resolution exceeding TG limits")
|
180
|
+
for f in sorted(formats, key=lambda x: (x.get('height') or 0), reverse=True):
|
181
|
+
if (f.get('vcodec') != 'none' and f.get('acodec') != 'none'
|
182
|
+
and (f.get('height') or 0) <= 720 and f.get('ext') == 'mp4'):
|
183
|
+
alt_filesize = f.get('filesize', 0) or f.get('filesize_approx', 0)
|
184
|
+
if alt_filesize: #and alt_filesize <= max_size_bytes:
|
185
|
+
dl_format = f
|
186
|
+
break
|
187
|
+
else:
|
188
|
+
logging.warning("Unknown filesize!")
|
189
|
+
ydl.params['format'] = dl_format['format_id']
|
190
|
+
ydl.download([url])
|
165
191
|
local_file = ydl.prepare_filename(info)
|
166
192
|
logging.debug("Temp filename: '%s'", local_file)
|
167
193
|
res.append({
|
@@ -172,4 +198,4 @@ class YoutubeScraper(YoutubeAbstract):
|
|
172
198
|
"media_type": JobType.VIDEO
|
173
199
|
})
|
174
200
|
|
175
|
-
return res
|
201
|
+
return res
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|