diff --git a/gallery_dl/extractor/__init__.py b/gallery_dl/extractor/__init__.py index a81c67b1..7988bb4f 100644 --- a/gallery_dl/extractor/__init__.py +++ b/gallery_dl/extractor/__init__.py @@ -18,6 +18,7 @@ modules = [ "4chan", "8chan", "batoto", + "chronos", "danbooru", "deviantart", "e621", diff --git a/gallery_dl/extractor/chronos.py b/gallery_dl/extractor/chronos.py new file mode 100644 index 00000000..af8d6653 --- /dev/null +++ b/gallery_dl/extractor/chronos.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- + +# Copyright 2015 Mike Fährmann +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. + +"""Extract images from http://chronos.to/""" + +from .common import Extractor, Message +from .. import text + +class ChronosExtractor(Extractor): + + category = "chronos" + directory_fmt = ["{category}"] + filename_fmt = "{filename}" + pattern = [r"(?:https?://)?(?:www\.)?chronos\.to/([a-z0-9]{12})"] + + def __init__(self, match): + Extractor.__init__(self) + self.token = match.group(1) + + def items(self): + params = { + "op": "view", + "id": self.token, + "pre": 1, + "next": "Continue to image.", + } + page = self.request("http://chronos.to/" + self.token, method="post", + data=params).text + url , pos = text.extract(page, '