update handling of extractor URL patterns

When loading extractor classes during 'extractor.find(…)', their
'pattern' attribute will be replaced with a compiled version of itself.
This commit is contained in:
Mike Fährmann
2019-02-08 20:08:16 +01:00
parent 6284731107
commit abbd45d0f4
6 changed files with 43 additions and 41 deletions

View File

@@ -13,7 +13,6 @@ from .. import text, util, extractor, exception
from ..cache import cache
import datetime
import time
import re
class RedditExtractor(Extractor):
@@ -27,7 +26,7 @@ class RedditExtractor(Extractor):
self._visited = set()
def items(self):
subre = re.compile(RedditSubmissionExtractor.pattern)
subre = RedditSubmissionExtractor.pattern
submissions = self.submissions()
depth = 0