'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

@@ -26,7 +26,7 @@ class UnsplashExtractor(Extractor):
def __init__(self, match):
Extractor.__init__(self, match)
self.item = match.group(1)
self.item = match[1]
def items(self):
fmt = self.config("format") or "raw"
@@ -114,7 +114,7 @@ class UnsplashCollectionExtractor(UnsplashExtractor):
def __init__(self, match):
UnsplashExtractor.__init__(self, match)
self.title = match.group(2) or ""
self.title = match[2] or ""
def metadata(self):
return {"collection_id": self.item, "collection_title": self.title}
@@ -133,7 +133,7 @@ class UnsplashSearchExtractor(UnsplashExtractor):
def __init__(self, match):
UnsplashExtractor.__init__(self, match)
self.query = match.group(2)
self.query = match[2]
def photos(self):
url = self.root + "/napi/search/photos"