Skip to content

Commit

Permalink
Merge pull request #685 from ArjixWasTaken/patch-32
Browse files Browse the repository at this point in the history
the extractors getter now uses actual regex instead of substring search
  • Loading branch information
AbdullahM0hamed committed May 27, 2021
2 parents e3889d0 + 0e270c0 commit 9e3df85
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion anime_downloader/extractors/init.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from importlib import import_module
import re


ALL_EXTRACTORS = [
{
Expand Down Expand Up @@ -186,7 +188,7 @@

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'])
Expand Down

0 comments on commit 9e3df85

Please sign in to comment.