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
pull/1352/head
loragja 4 years ago committed by GitHub
parent 5ad2b9c82b
commit 7b5ee922b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

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

@ -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
Loading…
Cancel
Save