mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
[aur] fix: encoding dependency name before requesting info from the API
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import re
|
||||
from typing import Set, List
|
||||
|
||||
import requests
|
||||
|
||||
from bauh.api.http import HttpClient
|
||||
import urllib.parse
|
||||
|
||||
URL_INFO = 'https://aur.archlinux.org/rpc/?v=5&type=info&'
|
||||
URL_SRC_INFO = 'https://aur.archlinux.org/cgit/aur.git/plain/.SRCINFO?h='
|
||||
@@ -32,7 +31,7 @@ class AURClient:
|
||||
return res['results'] if res and res.get('results') else []
|
||||
|
||||
def get_src_info(self, name: str) -> dict:
|
||||
res = self.http_client.get(URL_SRC_INFO + name)
|
||||
res = self.http_client.get(URL_SRC_INFO + urllib.parse.quote(name))
|
||||
|
||||
if res and res.text:
|
||||
info = {}
|
||||
@@ -48,4 +47,4 @@ class AURClient:
|
||||
return info
|
||||
|
||||
def _map_names_as_queries(self, names) -> str:
|
||||
return '&'.join(['arg[{}]={}'.format(i, n) for i, n in enumerate(names)])
|
||||
return '&'.join(['arg[{}]={}'.format(i, urllib.parse.quote(n)) for i, n in enumerate(names)])
|
||||
|
||||
@@ -183,6 +183,7 @@ packagemanager=administrador de paquetes
|
||||
sportsgame=juego de deportes
|
||||
arcadegame=juego arcade
|
||||
player=jugador
|
||||
fonts=fuentes
|
||||
screenshots.bt_next.label=próxima
|
||||
screenshots.bt_back.label=anterior
|
||||
screenshots,download.running=descargando imagen
|
||||
|
||||
@@ -186,6 +186,7 @@ packagemanager=gerenciador de pacotes
|
||||
sportsgame=jogo de esportes
|
||||
arcadegame=jogo arcade
|
||||
player=jogador
|
||||
fonts=fontes
|
||||
screenshots.bt_next.label=próxima
|
||||
screenshots.bt_back.label=anterior
|
||||
screenshots,download.running=baixando imagem
|
||||
|
||||
Reference in New Issue
Block a user