[saint] support 'turbovid.cr' URLs (#8851)
This commit is contained in:
@@ -1129,6 +1129,12 @@ Consider all listed sites to potentially be NSFW.
|
|||||||
<td>Models, Posts, User Profiles</td>
|
<td>Models, Posts, User Profiles</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr id="turbovid" title="turbovid">
|
||||||
|
<td>turbovid.cr</td>
|
||||||
|
<td>https://turbovid.cr/</td>
|
||||||
|
<td>Albums, Media Files</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
<tr id="twibooru" title="twibooru">
|
<tr id="twibooru" title="twibooru">
|
||||||
<td>Twibooru</td>
|
<td>Twibooru</td>
|
||||||
<td>https://twibooru.org/</td>
|
<td>https://twibooru.org/</td>
|
||||||
|
|||||||
@@ -60,10 +60,11 @@ class LolisafeAlbumExtractor(LolisafeExtractor):
|
|||||||
file["filename"] = file["name"]
|
file["filename"] = file["name"]
|
||||||
else:
|
else:
|
||||||
file["id"] = fid
|
file["id"] = fid
|
||||||
file["filename"] = file["name"] + "-" + fid
|
file["filename"] = f"{file['name']}-{fid}"
|
||||||
elif "id" in file:
|
elif "id" in file:
|
||||||
file["name"] = file["filename"]
|
file["name"] = file["filename"]
|
||||||
file["filename"] = f"{file['name']}-{file['id']}"
|
if file["filename"] != file["id"]:
|
||||||
|
file["filename"] = f"{file['name']}-{file['id']}"
|
||||||
else:
|
else:
|
||||||
file["name"], sep, file["id"] = \
|
file["name"], sep, file["id"] = \
|
||||||
file["filename"].rpartition("-")
|
file["filename"].rpartition("-")
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright 2024-2025 Mike Fährmann
|
# Copyright 2024-2026 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
|
||||||
# published by the Free Software Foundation.
|
# published by the Free Software Foundation.
|
||||||
|
|
||||||
"""Extractors for https://saint2.su/"""
|
"""Extractors for https://saint2.su/ and https://turbovid.cr/"""
|
||||||
|
|
||||||
from .lolisafe import LolisafeAlbumExtractor
|
from .lolisafe import LolisafeAlbumExtractor
|
||||||
from .. import text
|
from .. import text
|
||||||
|
|
||||||
BASE_PATTERN = r"(?:https?://)?saint\d*\.(?:su|pk|cr|to)"
|
BASE_PATTERN = r"(?:https?://)?(?:turbovid\.cr|saint\d*\.(?:su|pk|cr|to))"
|
||||||
|
|
||||||
|
|
||||||
class SaintAlbumExtractor(LolisafeAlbumExtractor):
|
class SaintAlbumExtractor(LolisafeAlbumExtractor):
|
||||||
@@ -26,18 +26,27 @@ class SaintAlbumExtractor(LolisafeAlbumExtractor):
|
|||||||
response = self.request(self.root + "/a/" + album_id)
|
response = self.request(self.root + "/a/" + album_id)
|
||||||
extr = text.extract_from(response.text)
|
extr = text.extract_from(response.text)
|
||||||
|
|
||||||
title = extr("<title>", "<")
|
title = extr("<title>", "</title")
|
||||||
descr = extr('name="description" content="', '"')
|
descr = extr('name="description" content="', '"/>')
|
||||||
files = []
|
files = []
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
id2 = extr("/thumbs/", "-")
|
id2 = extr("/thumbs/", '"')
|
||||||
if not id2:
|
if not id2:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
id2, sep, ts = id2.rpartition(".")[0].rpartition("-")
|
||||||
|
if sep:
|
||||||
|
date = self.parse_timestamp(ts)
|
||||||
|
else:
|
||||||
|
date = None
|
||||||
|
id2 = ts
|
||||||
|
|
||||||
files.append({
|
files.append({
|
||||||
"id2" : id2,
|
|
||||||
"date" : self.parse_timestamp(extr("", ".")),
|
|
||||||
"id" : extr("/embed/", '"'),
|
"id" : extr("/embed/", '"'),
|
||||||
|
"id2" : id2,
|
||||||
|
"date" : date,
|
||||||
|
# "extension": extr("<td>", "</"),
|
||||||
"size" : text.parse_int(extr('data="', '"')),
|
"size" : text.parse_int(extr('data="', '"')),
|
||||||
"file" : text.unescape(extr(
|
"file" : text.unescape(extr(
|
||||||
"onclick=\"play(", ")").strip("\"'")),
|
"onclick=\"play(", ")").strip("\"'")),
|
||||||
@@ -70,10 +79,18 @@ class SaintMediaExtractor(SaintAlbumExtractor):
|
|||||||
extr = text.extract_from(response.text)
|
extr = text.extract_from(response.text)
|
||||||
|
|
||||||
if embed:
|
if embed:
|
||||||
|
id2, sep, ts = extr(
|
||||||
|
"/thumbs/", '"').rpartition(".")[0].rpartition("-")
|
||||||
|
if sep:
|
||||||
|
date = self.parse_timestamp(ts)
|
||||||
|
else:
|
||||||
|
date = None
|
||||||
|
id2 = ts
|
||||||
|
|
||||||
file = {
|
file = {
|
||||||
"id" : album_id,
|
"id" : album_id,
|
||||||
"id2" : extr("/thumbs/", "-"),
|
"id2" : id2,
|
||||||
"date" : self.parse_timestamp(extr("", ".")),
|
"date" : date,
|
||||||
"file" : text.unescape(extr('<source src="', '"')),
|
"file" : text.unescape(extr('<source src="', '"')),
|
||||||
"id_dl": extr("/d/", "'"),
|
"id_dl": extr("/d/", "'"),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,6 +198,7 @@ CATEGORY_MAP = {
|
|||||||
"tmohentai" : "TMOHentai",
|
"tmohentai" : "TMOHentai",
|
||||||
"tumblrgallery" : "TumblrGallery",
|
"tumblrgallery" : "TumblrGallery",
|
||||||
"turboimagehost" : "TurboImageHost.com",
|
"turboimagehost" : "TurboImageHost.com",
|
||||||
|
"turbovid" : "turbovid.cr",
|
||||||
"vanillarock" : "もえぴりあ",
|
"vanillarock" : "もえぴりあ",
|
||||||
"vidyart2" : "/v/idyart2",
|
"vidyart2" : "/v/idyart2",
|
||||||
"vidyapics" : "Vidya Booru",
|
"vidyapics" : "Vidya Booru",
|
||||||
@@ -703,6 +704,11 @@ def build_extractor_list():
|
|||||||
default["wikifeetx"] = default["wikifeet"]
|
default["wikifeetx"] = default["wikifeet"]
|
||||||
domains["wikifeetx"] = "https://www.wikifeetx.com/"
|
domains["wikifeetx"] = "https://www.wikifeetx.com/"
|
||||||
|
|
||||||
|
# turbovid
|
||||||
|
default["turbovid"] = default["saint"]
|
||||||
|
domains["turbovid"] = "https://turbovid.cr/"
|
||||||
|
domains["saint"] = "https://saint2.su/"
|
||||||
|
|
||||||
# imgdrive / imgtaxi / imgwallet
|
# imgdrive / imgtaxi / imgwallet
|
||||||
base = categories["imagehost"]
|
base = categories["imagehost"]
|
||||||
base["imgtaxi"] = base["imgdrive"]
|
base["imgtaxi"] = base["imgdrive"]
|
||||||
|
|||||||
@@ -37,6 +37,34 @@ __tests__ = (
|
|||||||
"num" : {1, 2},
|
"num" : {1, 2},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"#url" : "https://turbovid.cr/a/FiphGijfJoR",
|
||||||
|
"#comment" : "'turbovid' album (#8851)",
|
||||||
|
"#category": ("lolisafe", "saint", "album"),
|
||||||
|
"#class" : saint.SaintAlbumExtractor,
|
||||||
|
"#results" : (
|
||||||
|
"https://data.saint2.cr/data/jZqe1xxqw9bX7.mp4",
|
||||||
|
"https://data.saint2.cr/data/eJ9fLurGdaHqS.mp4",
|
||||||
|
"https://data.saint2.cr/data/WkD7hRaHdBpBI.mp4",
|
||||||
|
),
|
||||||
|
|
||||||
|
"album_id" : "FiphGijfJoR",
|
||||||
|
"album_name" : """test-???-"&> album""",
|
||||||
|
"album_size" : 37165256,
|
||||||
|
"count" : 3,
|
||||||
|
"num" : range(1, 3),
|
||||||
|
"date" : None,
|
||||||
|
"description": """test-???-"&> description""",
|
||||||
|
"extension" : "mp4",
|
||||||
|
"file" : r"re:https://data.saint2.cr/data/\w+.mp4",
|
||||||
|
"filename" : str,
|
||||||
|
"id" : str,
|
||||||
|
"id2" : str,
|
||||||
|
"id_dl" : str,
|
||||||
|
"name" : str,
|
||||||
|
"size" : int,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"#url" : "https://saint2.su/embed/6lC7mKrJst8",
|
"#url" : "https://saint2.su/embed/6lC7mKrJst8",
|
||||||
"#class": saint.SaintMediaExtractor,
|
"#class": saint.SaintMediaExtractor,
|
||||||
@@ -85,4 +113,21 @@ __tests__ = (
|
|||||||
"#class": saint.SaintMediaExtractor,
|
"#class": saint.SaintMediaExtractor,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"#url" : "https://turbovid.cr/embed/WkD7hRaHdBpBI",
|
||||||
|
"#comment" : "'turbovid' URL/video",
|
||||||
|
"#category": ("lolisafe", "saint", "media"),
|
||||||
|
"#class" : saint.SaintMediaExtractor,
|
||||||
|
"#results" : "https://data.saint2.cr/data/WkD7hRaHdBpBI.mp4",
|
||||||
|
|
||||||
|
"date" : None,
|
||||||
|
"extension" : "mp4",
|
||||||
|
"file" : "https://data.saint2.cr/data/WkD7hRaHdBpBI.mp4",
|
||||||
|
"filename" : "WkD7hRaHdBpBI",
|
||||||
|
"id" : "WkD7hRaHdBpBI",
|
||||||
|
"id2" : "WkD7hRaHdBpBI",
|
||||||
|
"id_dl" : "V2tEN2hSYUhkQnBCSS5tcDQ=",
|
||||||
|
"name" : "WkD7hRaHdBpBI",
|
||||||
|
},
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user