Skip to content

Commit

Permalink
Merge pull request #629 from ArjixGamer/patch-29
Browse files Browse the repository at this point in the history
removed unneeded regex from nyaa
  • Loading branch information
AbdullahM0hamed committed Feb 13, 2021
2 parents a25f10a + b024456 commit 465a451
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions anime_downloader/sites/nyaa.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import re

from anime_downloader.sites.anime import Anime, AnimeEpisode, SearchResult
from anime_downloader.sites import helpers

Expand All @@ -22,7 +20,6 @@ def search(cls, query):
filters = {"No filter": 0, "No remakes": 1, "Trusted only": 2}
categories = {"Anime Music Video": "1_1", "English-translated": "1_2", "Non-English-translated": "1_3"}

rex = r'(magnet:)+[^"]*'
self = cls()

parameters = {"f": filters[self.config["filter"]], "c": categories[self.config["category"]], "q": query, "s": "size", "o": "desc"}
Expand All @@ -31,7 +28,7 @@ def search(cls, query):
search_results = [
SearchResult(
title=i.select("a:not(.comments)")[1].get("title"),
url=i.find_all('a', {'href': re.compile(rex)})[0].get('href'),
url=i.select_one('a[href*="magnet"]')['href'],
meta={'peers': i.find_all('td', class_='text-center')[3].text + ' peers', 'size':i.find_all('td', class_='text-center')[1].text})

for i in search_results.select("tr.default, tr.success")
Expand Down

0 comments on commit 465a451

Please sign in to comment.