Skip to content

Commit

Permalink
[tapas] add 'creator' extractor (#5306)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Apr 11, 2024
1 parent 35d4a70 commit e02d2ff
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/supportedsites.md
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ Consider all listed sites to potentially be NSFW.
<tr>
<td>Tapas</td>
<td>https://tapas.io/</td>
<td>Episodes, Series</td>
<td>Creators, Episodes, Series</td>
<td>Supported</td>
</tr>
<tr>
Expand Down
15 changes: 15 additions & 0 deletions gallery_dl/extractor/tapas.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,18 @@ def __init__(self, match):

def episode_ids(self):
return (self.episode_id,)


class TapasCreatorExtractor(TapasExtractor):
subcategory = "creator"
pattern = BASE_PATTERN + r"/(?!series|episode)([^/?#]+)"
example = "https://tapas.io/CREATOR"

def items(self):
url = "{}/{}/series".format(self.root, self.groups[0])
page = self.request(url).text
page = text.extr(page, '<ul class="content-list-wrap', "</ul>")

data = {"_extractor": TapasSeriesExtractor}
for path in text.extract_iter(page, ' href="', '"'):
yield Message.Queue, self.root + path, data
13 changes: 13 additions & 0 deletions test/results/tapas.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,17 @@
},
},

{
"#url" : "https://tapas.io/SANG123/series",
"#comment" : "#5306",
"#category": ("", "tapas", "creator"),
"#class" : tapas.TapasCreatorExtractor,
"#urls" : (
"https://tapas.io/series/the-return-of-the-disaster-class-hero-novel",
"https://tapas.io/series/the-return-of-the-disaster-class-hero",
"https://tapas.io/series/tomb-raider-king",
"https://tapas.io/series/tomb-raider-king-novel",
),
},

)

0 comments on commit e02d2ff

Please sign in to comment.