fix: update JDownloader script to include download password in crawljob format
Some checks failed
validate / lint (push) Failing after 1s
Some checks failed
validate / lint (push) Failing after 1s
This commit is contained in:
parent
c354e6c39f
commit
d95806cd32
@ -169,8 +169,14 @@ spec:
|
|||||||
|
|
||||||
package_name = basename.split('.', 1)[0] or 'subyshare'
|
package_name = basename.split('.', 1)[0] or 'subyshare'
|
||||||
fname = f'{WATCH_DIR}/{int(time.time()*1000)}.crawljob'
|
fname = f'{WATCH_DIR}/{int(time.time()*1000)}.crawljob'
|
||||||
|
lines = [f'text={url}', 'autoStart=TRUE', 'autoConfirm=TRUE', f'packageName={package_name}']
|
||||||
|
password = params.get('password', [''])[0]
|
||||||
|
if password:
|
||||||
|
# crawljob format requires literal backslashes doubled
|
||||||
|
escaped_pw = password.replace('\\', '\\\\')
|
||||||
|
lines.append(f'downloadPassword={escaped_pw}')
|
||||||
with open(fname, 'w') as f:
|
with open(fname, 'w') as f:
|
||||||
f.write(f'text={url}\nautoStart=TRUE\nautoConfirm=TRUE\npackageName={package_name}\n')
|
f.write('\n'.join(lines) + '\n')
|
||||||
self.send_response(200); self.end_headers()
|
self.send_response(200); self.end_headers()
|
||||||
self.wfile.write(b'Ok.')
|
self.wfile.write(b'Ok.')
|
||||||
def log_message(self, *a): pass
|
def log_message(self, *a): pass
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user