Merge pull request #685 from ArjixWasTaken/patch-32

the extractors getter now uses actual regex instead of substring search
master
Red 2021-05-27 15:42:41 +01:00 committed by GitHub
commit 9e3df85d3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,6 @@
from importlib import import_module
import re
ALL_EXTRACTORS = [
{
@ -186,7 +188,7 @@ ALL_EXTRACTORS = [
def get_extractor(name):
for extractor in ALL_EXTRACTORS:
if extractor['regex'] in name.lower():
if re.match(extractor['regex'], name.lower()):
module = import_module(
'anime_downloader.extractors.{}'.format(
extractor['modulename'])