24 lines
528 B
Python
Executable File
24 lines
528 B
Python
Executable File
#!/usr/bin/env python3
|
|
# -*- encoding: utf-8 -*-
|
|
|
|
import json
|
|
from pathlib import Path
|
|
import sys
|
|
|
|
|
|
def main():
|
|
if not Path('r_gdl_lbe.json').exists():
|
|
print('"r_gdl_lbe.json" does not exist')
|
|
elif len(sys.argv) != 3:
|
|
print('Usage:')
|
|
print(f' {sys.argv[0]} <downloader> <remaining_links>')
|
|
else:
|
|
dldr = sys.argv[1]
|
|
rlnk = int(sys.argv[2])
|
|
data = json.loads(Path('r_gdl_lbe.json').read_bytes())
|
|
print(data[dldr][-rlnk])
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|