This commit is contained in:
Alfonso E.M 2021-02-15 20:11:06 +01:00
commit 27fefaee8d

View file

@ -59,7 +59,7 @@ parser.add_argument(
parser.add_argument(
"--temp",
type=str,
default=TELEGRAM_DAEMON_DEST,
default=TELEGRAM_DAEMON_TEMP,
help=
'Destination path for temporary files (default is using the same downloaded files directory).')
parser.add_argument(
@ -79,6 +79,9 @@ downloadFolder = args.dest
tempFolder = args.temp
worker_count = multiprocessing.cpu_count()
if not tempFolder:
tempFolder = downloadFolder
# Edit these lines:
proxy = None
@ -95,9 +98,11 @@ async def log_reply(message, reply):
await message.edit(reply)
def getFilename(event: events.NewMessage.Event):
mediaFileName = "unknown"
for attribute in event.media.document.attributes:
if isinstance(attribute, DocumentAttributeFilename): return attribute.file_name
if isinstance(attribute, DocumentAttributeVideo): return event.original_update.message.message
if isinstance(attribute, DocumentAttributeVideo): mediaFileName = event.original_update.message.message
return mediaFileName
in_progress={}