'match.group(N)' -> 'match[N]' (#7671)

2.5x faster
This commit is contained in:
Mike Fährmann
2025-06-18 12:59:37 +02:00
parent 475506cc39
commit 41191bb60a
135 changed files with 363 additions and 363 deletions

View File

@@ -23,7 +23,7 @@ class RedgifsExtractor(Extractor):
def __init__(self, match):
Extractor.__init__(self, match)
self.key = match.group(1)
self.key = match[1]
def _init(self):
self.api = RedgifsAPI(self)
@@ -94,7 +94,7 @@ class RedgifsUserExtractor(RedgifsExtractor):
def __init__(self, match):
RedgifsExtractor.__init__(self, match)
self.query = match.group(2)
self.query = match[2]
def metadata(self):
return {"userName": self.key}
@@ -116,7 +116,7 @@ class RedgifsCollectionExtractor(RedgifsExtractor):
def __init__(self, match):
RedgifsExtractor.__init__(self, match)
self.collection_id = match.group(2)
self.collection_id = match[2]
def metadata(self):
collection = self.api.collection_info(self.key, self.collection_id)
@@ -151,7 +151,7 @@ class RedgifsNichesExtractor(RedgifsExtractor):
def __init__(self, match):
RedgifsExtractor.__init__(self, match)
self.query = match.group(2)
self.query = match[2]
def gifs(self):
order = text.parse_query(self.query).get("order")