1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 18:53:21 +01:00

cyberdrop extractor (#1328)

* create cyberdrop extractor

* add cyberdrop to list of extractors

* fix formatting

* change class name from CyberdropExtractor to CyberdropAlbumExtractor

* add cyberdrop to list of supported sites

* attempt to clean up diff of supportedsites.rst

* replace regex with functions from text library
This commit is contained in:
loragja 2021-02-21 20:42:45 +01:00 committed by GitHub
parent 5ad2b9c82b
commit 7b5ee922b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 0 deletions

View File

@ -26,6 +26,7 @@ ArtStation https://www.artstation.com/ |artstation-C|
baraag https://baraag.net/ Images from Statuses, User Profiles `OAuth <https://github.com/mikf/gallery-dl#oauth>`__
Behance https://www.behance.net/ Collections, Galleries, User Profiles
Blogger https://www.blogger.com/ Blogs, Posts, Search Results
Cyberdrop https://cyberdrop.me/ Albums
Danbooru https://danbooru.donmai.us/ Pools, Popular Images, Posts, Tag Searches Supported
Derpibooru https://derpibooru.org/ Galleries, Posts, Search Results `API Key <configuration.rst#extractorderpibooruapi-key>`__
Desuarchive https://desuarchive.org/ Boards, Search Results, Threads

View File

@ -23,6 +23,7 @@ modules = [
"bcy",
"behance",
"blogger",
"cyberdrop",
"danbooru",
"derpibooru",
"deviantart",

View File

@ -0,0 +1,34 @@
import base64
from .common import Extractor, Message
from .. import text
class CyberdropAlbumExtractor(Extractor):
pattern = r"(?:https?://)?(?:www\.)?cyberdrop\.me/a/([^/]+)/?"
category = "cyberdrop"
subcategory = "album"
directory_fmt = ("{category}", "{album}")
root = "https://cyberdrop.me"
def __init__(self, match):
Extractor.__init__(self, match)
self.album_id = match.group(1)
self.album_url = self.root + "/a/" + self.album_id
def items(self):
initial_page = self.request(self.album_url).text
albumName, _ = text.extract(initial_page, "name: '", "'")
encodedFileList, _ = text.extract(initial_page, "fl: '", "'")
fileList = [base64.b64decode(s.encode()).decode()
for s in encodedFileList.split(",")]
for f in fileList:
data = text.nameext_from_url(f)
yield Message.Directory, {
"album": self.album_id + ": " + albumName
}
yield Message.Url, "https://f.cyberdrop.cc/" + f, data