diff options
| author | 2024-09-07 18:33:19 -0400 | |
|---|---|---|
| committer | 2024-09-07 18:33:19 -0400 | |
| commit | 1f3ffe32342852fd9ea9e7704022488f3a1222bd (patch) | |
| tree | cb255a091b73e96840de0f6f44b36dff1acab4b9 /gallery_dl/extractor/cyberdrop.py | |
| parent | b5e56c51e491b41f9eb6a895459c185788a377e5 (diff) | |
New upstream version 1.27.4.upstream/1.27.4
Diffstat (limited to 'gallery_dl/extractor/cyberdrop.py')
| -rw-r--r-- | gallery_dl/extractor/cyberdrop.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gallery_dl/extractor/cyberdrop.py b/gallery_dl/extractor/cyberdrop.py index d864960..a514696 100644 --- a/gallery_dl/extractor/cyberdrop.py +++ b/gallery_dl/extractor/cyberdrop.py @@ -14,6 +14,7 @@ from .. import text class CyberdropAlbumExtractor(lolisafe.LolisafeAlbumExtractor): category = "cyberdrop" root = "https://cyberdrop.me" + root_api = "https://api.cyberdrop.me" pattern = r"(?:https?://)?(?:www\.)?cyberdrop\.(?:me|to)/a/([^/?#]+)" example = "https://cyberdrop.me/a/ID" @@ -55,5 +56,14 @@ class CyberdropAlbumExtractor(lolisafe.LolisafeAlbumExtractor): def _extract_files(self, file_ids): for file_id in file_ids: - url = "{}/api/f/{}".format(self.root, file_id) - yield self.request(url).json() + try: + url = "{}/api/file/info/{}".format(self.root_api, file_id) + file = self.request(url).json() + auth = self.request(file["auth_url"]).json() + file["url"] = auth["url"] + except Exception as exc: + self.log.warning("%s (%s: %s)", + file_id, exc.__class__.__name__, exc) + continue + + yield file |
