misc: simplified export method
This commit is contained in:
parent
7054a3e181
commit
ff8bf341c4
1 changed files with 4 additions and 6 deletions
|
@ -15,10 +15,12 @@ class ExportChannels(commands.Cog):
|
|||
)
|
||||
|
||||
|
||||
def export(self, ctx, channel, token):
|
||||
async def export(self, channels: list):
|
||||
token = await self.config.bot_token()
|
||||
self.data_path = data_manager.cog_data_path(self)
|
||||
self.bundled_data_path = data_manager.bundled_data_path(self)
|
||||
out = f'{self.data_path}{os.sep}Exported Channels'
|
||||
channel = channels[0]
|
||||
try:
|
||||
os.mkdir(out)
|
||||
except FileExistsError:
|
||||
|
@ -34,8 +36,6 @@ class ExportChannels(commands.Cog):
|
|||
'--media',
|
||||
'--fuck_russia', 'true',
|
||||
]
|
||||
if bot:
|
||||
args += '--bot'
|
||||
os.chdir(self.bundled_data_path)
|
||||
subprocess.call(args)
|
||||
args = [
|
||||
|
@ -45,13 +45,11 @@ class ExportChannels(commands.Cog):
|
|||
'--format', 'Json',
|
||||
'--output', f'/{out}/%G (%g)/%C (%c)/DCE-f.json',
|
||||
'--token', f'{token}',
|
||||
'--channel', {channel},
|
||||
'--channel', {channels},
|
||||
'--reuse_media',
|
||||
'--media',
|
||||
'--fuck_russia', 'true',
|
||||
]
|
||||
if bot:
|
||||
args += '--bot'
|
||||
os.chdir(self.bundled_data_path)
|
||||
subprocess.call(args)
|
||||
|
||||
|
|
Loading…
Reference in a new issue