[sankaku] rewrite URLs to s.sankakucomplex.com (#2746)

This commit is contained in:
Mike Fährmann
2022-07-11 12:43:04 +02:00
parent d5ded11aa8
commit 32c75d12e8

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright 2014-2021 Mike Fährmann # Copyright 2014-2022 Mike Fährmann
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License version 2 as
@@ -49,6 +49,8 @@ class SankakuExtractor(BooruExtractor):
self.log.warning( self.log.warning(
"Login required to download 'contentious_content' posts") "Login required to download 'contentious_content' posts")
SankakuExtractor._warning = False SankakuExtractor._warning = False
elif url[8] == "v":
url = "https://s.sankakucomplex.com" + url[url.index("/", 8):]
return url return url
@staticmethod @staticmethod
@@ -79,8 +81,8 @@ class SankakuTagExtractor(SankakuExtractor):
test = ( test = (
("https://sankaku.app/?tags=bonocho", { ("https://sankaku.app/?tags=bonocho", {
"count": 5, "count": 5,
"pattern": r"https://v\.sankakucomplex\.com/data/[^/]{2}/[^/]{2}" "pattern": r"https://s\.sankakucomplex\.com/data/[^/]{2}/[^/]{2}"
r"/[^/]{32}\.\w+\?e=\d+&expires=\d+&m=[^&#]+", r"/[^/]{32}\.\w+\?e=\d+&(expires=\d+&)?m=[^&#]+",
}), }),
("https://beta.sankakucomplex.com/?tags=bonocho"), ("https://beta.sankakucomplex.com/?tags=bonocho"),
("https://chan.sankakucomplex.com/?tags=bonocho"), ("https://chan.sankakucomplex.com/?tags=bonocho"),
@@ -160,7 +162,7 @@ class SankakuPostExtractor(SankakuExtractor):
}), }),
# 'contentious_content' # 'contentious_content'
("https://sankaku.app/post/show/21418978", { ("https://sankaku.app/post/show/21418978", {
"pattern": r"https://v\.sankakucomplex\.com" "pattern": r"https://s\.sankakucomplex\.com"
r"/data/13/3c/133cda3bfde249c504284493903fb985\.jpg", r"/data/13/3c/133cda3bfde249c504284493903fb985\.jpg",
}), }),
# empty tags (#1617) # empty tags (#1617)