mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 01:34: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
|
import re
|
||||||
from typing import Set, List
|
from typing import Set, List
|
||||||
|
|
||||||
import requests
|
|
||||||
|
|
||||||
from bauh.api.http import HttpClient
|
from bauh.api.http import HttpClient
|
||||||
|
import urllib.parse
|
||||||
|
|
||||||
URL_INFO = 'https://aur.archlinux.org/rpc/?v=5&type=info&'
|
URL_INFO = 'https://aur.archlinux.org/rpc/?v=5&type=info&'
|
||||||
URL_SRC_INFO = 'https://aur.archlinux.org/cgit/aur.git/plain/.SRCINFO?h='
|
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 []
|
return res['results'] if res and res.get('results') else []
|
||||||
|
|
||||||
def get_src_info(self, name: str) -> dict:
|
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:
|
if res and res.text:
|
||||||
info = {}
|
info = {}
|
||||||
@@ -48,4 +47,4 @@ class AURClient:
|
|||||||
return info
|
return info
|
||||||
|
|
||||||
def _map_names_as_queries(self, names) -> str:
|
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
|
sportsgame=juego de deportes
|
||||||
arcadegame=juego arcade
|
arcadegame=juego arcade
|
||||||
player=jugador
|
player=jugador
|
||||||
|
fonts=fuentes
|
||||||
screenshots.bt_next.label=próxima
|
screenshots.bt_next.label=próxima
|
||||||
screenshots.bt_back.label=anterior
|
screenshots.bt_back.label=anterior
|
||||||
screenshots,download.running=descargando imagen
|
screenshots,download.running=descargando imagen
|
||||||
|
|||||||
@@ -186,6 +186,7 @@ packagemanager=gerenciador de pacotes
|
|||||||
sportsgame=jogo de esportes
|
sportsgame=jogo de esportes
|
||||||
arcadegame=jogo arcade
|
arcadegame=jogo arcade
|
||||||
player=jogador
|
player=jogador
|
||||||
|
fonts=fontes
|
||||||
screenshots.bt_next.label=próxima
|
screenshots.bt_next.label=próxima
|
||||||
screenshots.bt_back.label=anterior
|
screenshots.bt_back.label=anterior
|
||||||
screenshots,download.running=baixando imagem
|
screenshots,download.running=baixando imagem
|
||||||
|
|||||||
Reference in New Issue
Block a user