Sfoglia il codice sorgente

added a return for filename in the filedownloaded for roxbot.

tags/v1.8.0
Roxie Gibson 6 anni fa
parent
commit
c927451358
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. +1
    -1
      roxbot/http.py

+ 1
- 1
roxbot/http.py Vedi File

:param url: :param url:
""" """
if filename is None: if filename is None:
filename = url.split("/")[-1]
filename = url.split("/")[-1].split("?")[0]
async with aiohttp.ClientSession() as session: async with aiohttp.ClientSession() as session:
async with session.get(url, headers={'User-agent': 'RoxBot Discord Bot'}) as data: async with session.get(url, headers={'User-agent': 'RoxBot Discord Bot'}) as data:
with open(filename, 'wb') as f: with open(filename, 'wb') as f:

Loading…
Annulla
Salva