mirror of
https://github.com/alfem/telegram-download-daemon.git
synced 2024-11-10 17:05:26 +08:00
Merge branch 'master' of https://github.com/alfem/telegram-download-daemon
This commit is contained in:
commit
27fefaee8d
1 changed files with 7 additions and 2 deletions
|
@ -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={}
|
||||
|
|
Loading…
Reference in a new issue