diff --git a/docs/supportedsites.rst b/docs/supportedsites.rst index 03a9d924..c16e0251 100644 --- a/docs/supportedsites.rst +++ b/docs/supportedsites.rst @@ -39,6 +39,7 @@ ImageFap https://imagefap.com/ Images from Users, Gall imgbox https://imgbox.com/ Galleries, individual Images imgth https://imgth.com/ Galleries imgur https://imgur.com/ Albums, individual Images +Instagram https://www.instagram.com/ Images from Users, individual Images Jaimini's Box https://jaiminisbox.com/ Chapters, Manga Joyreactor http://joyreactor.cc/ Images from Users, Posts, Tag-Searches Khinsider https://downloads.khinsider.com/ Soundtracks @@ -100,7 +101,7 @@ Turboimagehost https://turboimagehost.com/ individual Images .. |Site-0| replace:: yuki.la 4chan archive .. |Capabilities-0| replace:: Images from Users, Albums, Challenges, individual Images, Likes, Search Results -.. |Capabilities-1| replace:: Collections, Deviations, Favorites, Folders, Galleries, Journals, Popular Images +.. |Capabilities-1| replace:: Collections, Deviations, Favorites, Folders, Galleries, Journals, Popular Images, Sta.sh .. |Capabilities-2| replace:: Images from Users, Albums, Favorites, Galleries, Groups, individual Images, Search Results .. |Capabilities-3| replace:: Images from Users, Favorites, individual Images, Popular Images, Recent Images, Scraps .. |Capabilities-4| replace:: Images from Users, Doujin, Favorites, individual Images diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py index f3171402..32dfc312 100644 --- a/gallery_dl/extractor/deviantart.py +++ b/gallery_dl/extractor/deviantart.py @@ -275,8 +275,7 @@ class DeviantartDeviationExtractor(DeviantartExtractor): """Extractor for single deviations""" subcategory = "deviation" archive_fmt = "{index}.{extension}" - pattern = [BASE_PATTERN + r"/(?:art|journal)/[^/?]+-\d+", - r"(?:https?://)?sta\.sh/()()[a-z0-9]+"] + pattern = [BASE_PATTERN + r"/(?:art|journal)/[^/?]+-\d+"] test = [ (("https://www.deviantart.com/shimoda7/art/" "For-the-sake-of-a-memory-10073852"), { @@ -287,13 +286,6 @@ class DeviantartDeviationExtractor(DeviantartExtractor): ("https://www.deviantart.com/zzz/art/zzz-1234567890", { "exception": exception.NotFoundError, }), - ("https://sta.sh/01ijs78ebagf", { - "url": "35c0cd0e51494a1e01bddf5414a0d1585cd9fb0e", - "keyword": "d0c01d39b05519e4812cd3c7ac8267363171c053", - }), - ("https://sta.sh/abcdefghijkl", { - "exception": exception.NotFoundError, - }), (("https://www.deviantart.com/myria-moon/art/" "Aime-Moi-part-en-vadrouille-261986576"), { "pattern": (r"https?://s3\.amazonaws\.com/origin-orig\." @@ -320,6 +312,38 @@ class DeviantartDeviationExtractor(DeviantartExtractor): return (self.api.deviation(deviation_id),) +class DeviantartStashExtractor(DeviantartDeviationExtractor): + """Extractor for sta.sh-ed deviations""" + subcategory = "stash" + archive_fmt = "{index}.{extension}" + pattern = [r"(?:https?://)?sta\.sh/()()[a-z0-9]+"] + test = [ + ("https://sta.sh/022c83odnaxc", { + "pattern": r"https://s3.amazonaws.com/origin-orig.deviantart.net", + "count": 1, + }), + ("https://sta.sh/21jf51j7pzl2", { + "pattern": pattern[0], + "count": 4, + }), + ("https://sta.sh/abcdefghijkl", { + "exception": exception.HttpError, + }), + ] + + def deviations(self): + page = self.request(self.url).text + deviation_id = text.extract(page, '//deviation/', '"')[0] + + if deviation_id: + yield self.api.deviation(deviation_id) + else: + page = text.extract( + page, '