You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
2.8 KiB
60 lines
2.8 KiB
#!/usr/bin/env python3 |
|
import argparse |
|
import json as j |
|
from pseudbot.util import download_tweet_media |
|
from sys import argv as ARGV |
|
import typing |
|
|
|
|
|
def parse_args(args: [str], name: str): |
|
parser = argparse.ArgumentParser(prog=name) |
|
|
|
parser.add_argument( |
|
"json_dump", |
|
type=argparse.FileType("r"), |
|
help="JSON File containing a Twitter info dictionary dump", |
|
) |
|
|
|
return parser.parse_args(args=args) |
|
|
|
|
|
if __name__ == "__main__": |
|
prog_name = ARGV.pop(0) |
|
print( |
|
"" |
|
+ " ,▄▄▄▄▄,\n" |
|
+ " ▄▄ ▄███████████▄▄▄▄█▀\n" |
|
+ " ▐███▌ ,█████████████████▄▄▄\n" |
|
+ " ▐██████▄ ███████████████████▀\n" |
|
+ " ██████████▌▄, █████████████████\n" |
|
+ " ▓█████████████████████████████████\n" |
|
+ " ▐██████████████████████████████████▓\n" |
|
+ " ██████████████████████████████████\n" |
|
+ " ▀███████████████████████████████▌\n" |
|
+ " ,▐▓███████████████████████████▌\n" |
|
+ " ████████████████████████████▀\n" |
|
+ " ╙█████████████████████████`\n" |
|
+ " `▀▓██████████████████▀\n" |
|
+ " ,▄▓██████████████████▓└\n" |
|
+ "`▀██████████████████████▀└\n" |
|
+ " ╙▀▌▓████████▓▌▀└\n" |
|
+ " _ _\n" |
|
+ " _ __ ___ ___ __| (_) __ _\n" |
|
+ " | '_ ` _ \ / _ \/ _` | |/ _` |\n" |
|
+ " | | | | | | __/ (_| | | (_| |\n" |
|
+ " |_| |_| |_|\___|\__,_|_|\__,_|\n" |
|
+ " _\n" |
|
+ " __| |_ _ _ __ ___ _ __ ___ _ __\n" |
|
+ " / _` | | | | '_ ` _ \| '_ \ / _ \ '__|\n" |
|
+ "| (_| | |_| | | | | | | |_) | __/ |\n" |
|
+ " \__,_|\__,_|_| |_| |_| .__/ \___|_|\n" |
|
+ " |_|\n" |
|
) |
|
|
|
opts = parse_args(args=ARGV, name=prog_name) |
|
|
|
tweets = j.loads(opts.json_dump.read()) |
|
for tweet in tweets: |
|
download_tweet_media(tweet) |
|
|
|
opts.json_dump.close()
|
|
|