fix: too long filename is now right supported

This commit is contained in:
starnakin 2023-05-15 19:01:55 +02:00
parent db937e1860
commit 5fa1d01808

View File

@ -6,6 +6,7 @@ import os
import sys import sys
import subprocess import subprocess
from operator import itemgetter from operator import itemgetter
from urllib.parse import unquote
def get_files(url: str) -> []: def get_files(url: str) -> []:
if (url in ["/../", "../"]): if (url in ["/../", "../"]):
@ -18,7 +19,7 @@ def get_files(url: str) -> []:
files = [] files = []
for element in soup.findAll("a"): for element in soup.findAll("a"):
file = {} file = {}
file.update({"name": element.text}) file.update({"name": unquote(element['href'])})
file.update({"link": element["href"]}) file.update({"link": element["href"]})
files.append(file) files.append(file)
return (files) return (files)