warp-beacon 2.2.11__tar.gz → 2.2.12__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.11/warp_beacon.egg-info → warp_beacon-2.2.12}/PKG-INFO +1 -1
- warp_beacon-2.2.12/warp_beacon/__version__.py +2 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/scraper/youtube/abstract.py +18 -14
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/scraper/youtube/music.py +3 -3
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/scraper/youtube/shorts.py +2 -2
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/scraper/youtube/youtube.py +2 -2
- {warp_beacon-2.2.11 → warp_beacon-2.2.12/warp_beacon.egg-info}/PKG-INFO +1 -1
- warp_beacon-2.2.11/warp_beacon/__version__.py +0 -2
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/LICENSE +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/MANIFEST.in +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/README.md +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/assets/placeholder.gif +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/etc/.gitignore +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/etc/accounts.json +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/etc/warp_beacon.conf +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/etc/warp_beacon.service +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/pyproject.toml +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/setup.cfg +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/setup.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/__init__.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/compress/__init__.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/compress/video.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/jobs/__init__.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/jobs/abstract.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/jobs/download_job.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/jobs/types.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/jobs/upload_job.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/mediainfo/__init__.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/mediainfo/abstract.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/mediainfo/audio.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/mediainfo/silencer.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/mediainfo/video.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/scheduler/__init__.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/scheduler/scheduler.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/scraper/__init__.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/scraper/abstract.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/scraper/account_selector.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/scraper/exceptions.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/scraper/instagram/__init__.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/scraper/instagram/instagram.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/scraper/youtube/__init__.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/storage/__init__.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/telegram/__init__.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/telegram/bot.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/telegram/handlers.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/telegram/placeholder_message.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/telegram/utils.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/uploader/__init__.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon/warp_beacon.py +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon.egg-info/SOURCES.txt +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon.egg-info/dependency_links.txt +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon.egg-info/entry_points.txt +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon.egg-info/requires.txt +0 -0
- {warp_beacon-2.2.11 → warp_beacon-2.2.12}/warp_beacon.egg-info/top_level.txt +0 -0
@@ -7,7 +7,7 @@ import ssl
|
|
7
7
|
from typing import Callable, Union, Optional
|
8
8
|
import json
|
9
9
|
import urllib
|
10
|
-
import
|
10
|
+
import requests
|
11
11
|
import http.client
|
12
12
|
from PIL import Image
|
13
13
|
|
@@ -102,19 +102,23 @@ class YoutubeAbstract(ScraperAbstract):
|
|
102
102
|
if "yt_download_" in i:
|
103
103
|
os.unlink("%s/%s" % (self.DOWNLOAD_DIR, i))
|
104
104
|
|
105
|
-
def download_thumbnail(self,
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
105
|
+
def download_thumbnail(self, video_id: str, timeout: int) -> Optional[io.BytesIO]:
|
106
|
+
for i in ("https://img.youtube.com/vi/{VIDEO_ID}/maxresdefault.jpg",
|
107
|
+
"https://img.youtube.com/vi/{VIDEO_ID}/hqdefault.jpg",
|
108
|
+
"https://img.youtube.com/vi/{VIDEO_ID}/sddefault.jpg"):
|
109
|
+
try:
|
110
|
+
url = i.format(VIDEO_ID=video_id)
|
111
|
+
logging.info("Youtube thumbnail url '%s'", url)
|
112
|
+
with requests.get(url, timeout=(timeout, timeout)) as response:
|
113
|
+
image = Image.open(io.BytesIO(response.content))
|
114
|
+
image = MediaInfoAbstract.shrink_image_to_fit(image, size=(320, 180))
|
115
|
+
io_buf = io.BytesIO()
|
116
|
+
image.save(io_buf, format='JPEG', subsampling=0, quality=100, progressive=True, optimize=False, icc_profile=image.info.get('icc_profile'))
|
117
|
+
io_buf.seek(0)
|
118
|
+
return io_buf
|
119
|
+
except Exception as e:
|
120
|
+
logging.error("Failed to download download thumbnail!")
|
121
|
+
logging.exception(e)
|
118
122
|
|
119
123
|
return None
|
120
124
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from warp_beacon.jobs.types import JobType
|
2
2
|
from warp_beacon.scraper.youtube.abstract import YoutubeAbstract
|
3
|
-
from warp_beacon.scraper.exceptions import NotFound
|
3
|
+
from warp_beacon.scraper.exceptions import NotFound, FileTooBig
|
4
4
|
|
5
5
|
import logging
|
6
6
|
|
@@ -15,8 +15,8 @@ class YoutubeMusicScraper(YoutubeAbstract):
|
|
15
15
|
thumbnail = None
|
16
16
|
yt = self.build_yt(url)
|
17
17
|
|
18
|
-
if yt
|
19
|
-
thumbnail = self._download_hndlr(self.download_thumbnail, yt.
|
18
|
+
if yt:
|
19
|
+
thumbnail = self._download_hndlr(self.download_thumbnail, yt.video_id)
|
20
20
|
|
21
21
|
stream = yt.streams.get_audio_only()
|
22
22
|
|
@@ -19,8 +19,8 @@ class YoutubeShortsScraper(YoutubeAbstract):
|
|
19
19
|
if not stream:
|
20
20
|
raise NotFound("No suitable video stream found")
|
21
21
|
|
22
|
-
if yt
|
23
|
-
thumbnail = self._download_hndlr(self.download_thumbnail, yt.
|
22
|
+
if yt:
|
23
|
+
thumbnail = self._download_hndlr(self.download_thumbnail, yt.video_id)
|
24
24
|
|
25
25
|
local_file = stream.download(
|
26
26
|
output_path=self.DOWNLOAD_DIR,
|
@@ -37,8 +37,8 @@ class YoutubeScraper(YoutubeAbstract):
|
|
37
37
|
if self.is_live(yt.initial_data):
|
38
38
|
raise YotubeLiveError("Youtube Live is not supported")
|
39
39
|
|
40
|
-
if yt
|
41
|
-
thumbnail = self._download_hndlr(self.download_thumbnail, yt.
|
40
|
+
if yt:
|
41
|
+
thumbnail = self._download_hndlr(self.download_thumbnail, yt.video_id)
|
42
42
|
|
43
43
|
stream = yt.streams.get_highest_resolution()
|
44
44
|
|
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
|