|
19 | 19 | from app.reports.WeaponRaceReport import WeaponRaceReport |
20 | 20 | from app.reports.WeaponReport import WeaponReport |
21 | 21 | from app.reports.WeekdayReport import WeekdayReport |
22 | | -# from app.DiscordSender import DiscordSender |
23 | 22 |
|
24 | 23 | ############################################################################### |
25 | 24 | # |
|
31 | 30 |
|
32 | 31 | # build argument parsing |
33 | 32 | descriptionString = """Get and compile stats for a Destiny 2 user. |
34 | | - example: main.py 3 4611686018482684809""" |
| 33 | + example: main.py -p 3 -id 4611686018482684809""" |
35 | 34 | platformString = """ Xbox 1 |
36 | 35 | Psn 2 |
37 | 36 | Steam 3 |
38 | 37 | Blizzard 4 |
39 | 38 | Stadia 5 |
40 | 39 | Egs 6""" |
41 | 40 | parser = argparse.ArgumentParser(prog='main.py', description=f'{descriptionString}', formatter_class=argparse.RawTextHelpFormatter) |
42 | | - parser.add_argument('-p', type=int, required=False, dest='platform', help=f'{platformString}') |
43 | | - parser.add_argument('-id', type=int, required=False, help='bungie ID') |
| 41 | + parser.add_argument('--platform', '-p', type=int, required=False, help=f'{platformString}') |
| 42 | + parser.add_argument('--membership_id', '-id', type=int, required=False, help='Bungie ID') |
44 | 43 | args = vars(parser.parse_args()) |
45 | 44 | platform = args['platform'] |
46 | | - id = args['id'] |
| 45 | + id = args['membership_id'] |
47 | 46 |
|
48 | 47 | if platform != None and id != None: |
49 | 48 | USED_MEMBERSHIP = (platform, id) |
50 | 49 | else: |
51 | 50 | MIJAGO = (3, 4611686018482684809) |
52 | | - SUPERQ = (3, 4611686018472661350) |
53 | | - SHTGUNWEDDING = (2, 4611686018428655241) |
54 | | - EURO = (3, 4611686018471254627) |
55 | | - DREDGENQ = (3, 4611686018534347056) |
56 | | - SPRQMAN = (2, 4611686018436271063) |
57 | | - USED_MEMBERSHIP = DREDGENQ |
| 51 | + # You can easily set your own ID here: |
| 52 | + MYCOOLID = (3, 1234567890123456789) |
| 53 | + USED_MEMBERSHIP = MIJAGO |
58 | 54 |
|
59 | | - from pathos.multiprocessing import ProcessPool |
| 55 | + from pathos.multiprocessing import ProcessPool, ThreadPool, ThreadingPool |
60 | 56 | pathos.helpers.freeze_support() # required for windows |
61 | 57 | pool = ProcessPool() |
62 | | - # You could also specify the amount of threads. Not that this DRASTICALLY speeds up the process but takes serious computation power. |
63 | | - # pool = ProcessPool(60) |
| 58 | + # You could also specify the amount of threads. Note that this DRASTICALLY speeds up the process but takes serious computation power. |
| 59 | + # pool = ProcessPool(40) |
64 | 60 |
|
65 | 61 | # check manifest |
66 | 62 | manifest = DestinyManifest().update() |
67 | 63 |
|
68 | | - api = BungieApi(os.getenv('BUNGIE_API_KEY')) |
| 64 | + # You can also set an api key manually, if you do not want to use environment variables. |
| 65 | + API_KEY = os.getenv('BUNGIE_API_KEY') |
| 66 | + # API_KEY = "123456789" |
| 67 | + |
| 68 | + api = BungieApi(API_KEY) |
69 | 69 | # "gif by default, "mp4" if you installed ffmpeg which you should; see README.d |
70 | 70 | VIDEO_TYPE = "mp4" |
71 | 71 |
|
72 | 72 | Director.CreateDirectoriesForUser(*USED_MEMBERSHIP) |
73 | 73 | Director.ClearResultDirectory(*USED_MEMBERSHIP) |
74 | 74 | Director.CreateDirectoriesForUser(*USED_MEMBERSHIP) |
75 | 75 | pc = PGCRCollector(*USED_MEMBERSHIP, api, pool) |
76 | | - pc.getCharacters().getActivities(limit=None).getPGCRs(pagesize=1000) # .combineAllPgcrs() |
| 76 | + pc.getCharacters().getActivities(limit=None).getPGCRs() # .combineAllPgcrs() |
77 | 77 | data = pc.getAllPgcrs() |
78 | 78 |
|
79 | 79 | pool.close() |
|
101 | 101 |
|
102 | 102 | Zipper.zip_directory(Director.GetResultDirectory(*USED_MEMBERSHIP), Director.GetZipPath(*USED_MEMBERSHIP)) |
103 | 103 | print("Generated ZIP:", Director.GetZipPath(*USED_MEMBERSHIP)) |
104 | | - |
105 | | - # DiscordSender.send(Director.GetZipPath(*USED_MEMBERSHIP), *USED_MEMBERSHIP) |
106 | | - # print("Sent ZIP:", Director.GetZipPath(*USED_MEMBERSHIP)) |
0 commit comments