Erfan commited on
Commit
91f7053
·
1 Parent(s): 7ae3637

fix: replace html.unquote with urllib.parse.unquote

Browse files
Files changed (1) hide show
  1. bot/filedl.py +2 -3
bot/filedl.py CHANGED
@@ -38,13 +38,12 @@ def _extract_filename(headers, url: str, content_type: str) -> str:
38
  if name:
39
  return name
40
 
41
- from urllib.parse import urlparse
42
  path = urlparse(url).path
43
  if "/" in path:
44
  name = path.rsplit("/", 1)[-1]
45
  if name and "." in name:
46
- import html
47
- return html.unquote(name)
48
 
49
  ext = _ext_from_url(url, content_type)
50
  if ext:
 
38
  if name:
39
  return name
40
 
41
+ from urllib.parse import urlparse, unquote
42
  path = urlparse(url).path
43
  if "/" in path:
44
  name = path.rsplit("/", 1)[-1]
45
  if name and "." in name:
46
+ return unquote(name)
 
47
 
48
  ext = _ext_from_url(url, content_type)
49
  if ext: