Fix urlencode
This commit is contained in:
parent
39e9d123b5
commit
69b6562121
@ -1,7 +1,7 @@
|
||||
from datetime import datetime
|
||||
from os import getenv
|
||||
from typing import List
|
||||
from urllib.parse import urlencode
|
||||
from urllib import parse
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
from pydantic import HttpUrl, parse_obj_as
|
||||
@ -24,7 +24,7 @@ class Nyaa(Bridge):
|
||||
|
||||
def search_url(self, query: str = "", page: int = 1) -> HttpUrl:
|
||||
to_query = "|".join(map(lambda word: f"({query} {word})", VF_WORDS))
|
||||
params = urlencode(
|
||||
params = parse.urlencode(
|
||||
{
|
||||
"f": 0,
|
||||
"c": "1_3",
|
||||
@ -86,7 +86,7 @@ class EraiRaws(Nyaa):
|
||||
title = "Erai-raws"
|
||||
|
||||
def search_url(self, query: str = "", page: int = 1) -> HttpUrl:
|
||||
params = urlencode(
|
||||
params = parse.urlencode(
|
||||
{
|
||||
"f": 0,
|
||||
"c": "1_2",
|
||||
|
@ -1,4 +1,5 @@
|
||||
from typing import List
|
||||
from urllib import parse
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
from humanfriendly import parse_size
|
||||
@ -21,14 +22,16 @@ class YggTorrent(Bridge):
|
||||
sub_category = 2179
|
||||
|
||||
def search_url(self, query: str = "", page: int = 1) -> HttpUrl:
|
||||
params = {
|
||||
"name": query,
|
||||
"category": 2145,
|
||||
"sub_category": self.sub_category,
|
||||
"do": "search",
|
||||
"order": "desc",
|
||||
"sort": "size" if query else "publish_date",
|
||||
}
|
||||
params = parse.urlencode(
|
||||
{
|
||||
"name": query,
|
||||
"category": 2145,
|
||||
"sub_category": self.sub_category,
|
||||
"do": "search",
|
||||
"order": "desc",
|
||||
"sort": "size" if query else "publish_date",
|
||||
}
|
||||
)
|
||||
|
||||
return parse_obj_as(HttpUrl, f"{self.base_url}?{params}")
|
||||
|
||||
|
Reference in New Issue
Block a user