This repository has been archived by the owner on Dec 28, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
test.py
270 lines (219 loc) · 11 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
import asyncio
import os
from dotenv import load_dotenv
import callofduty
from callofduty import Mode, Platform, Reaction, Title
async def main():
load_dotenv()
# client = await callofduty.Login(
# os.environ["ATVI_EMAIL"], os.environ["ATVI_PASSWORD"]
# )
# OR
# client = await callofduty.Login(sso=os.environ["ATVI_SSO"])
# season = await client.GetLootSeason(Title.BlackOps4, 3)
# print(f"{season.title.name}: {season.name}")
# for tier in season.tiers:
# print(f"Tier {tier.tier}: {tier.name} - {tier.rarity} {tier.category}")
# for chase in season.chase:
# print(f"Chase: {chase.name} - {chase.rarity} {chase.category}")
# requests = await client.GetMyFriendRequests()
# for incoming in requests["incoming"]:
# print(f"Incoming Friend Request: {incoming.username} ({incoming.platform.name})")
# for outgoing in requests["outgoing"]:
# print(f"Outgoing Friend Request: {outgoing.username} ({outgoing.platform.name})")
# friends = await client.GetMyFriends()
# for friend in friends:
# print(f"{friend.platform.name}: {friend.username} ({friend.accountId}), Online? {friend.online}")
# for identity in friend.identities:
# print(f" - {identity.platform.name}: {identity.username} ({identity.accountId})")
# identities = await client.GetMyIdentities()
# for identity in identities:
# title = identity["title"].name
# username = identity["username"]
# platform = identity["platform"].name
# print(f"{title}: {username} ({platform})")
# accounts = await client.GetMyAccounts()
# for account in accounts:
# print(f"{account.username} ({account.platform.name})")
# player = await client.GetPlayer(Platform.BattleNet, "Yeah#11207")
# print(f"{player.username} ({player.platform.name})")
# player = await client.GetPlayer(Platform.BattleNet, "Yeah#11207")
# summary = await player.matchesSummary(Title.ModernWarfare, Mode.Warzone, limit=20)
# print(summary)
# news = await client.GetNewsFeed(limit=10)
# for post in news:
# print(f"{post.published.date()}: {post.title}")
# videos = await client.GetVideoFeed(limit=3)
# for video in videos:
# print(f"{video.title} - {video.url}")
# leaderboard = await client.GetLeaderboard(
# Title.ModernWarfare, Platform.BattleNet, gameMode="cyber", page=3
# )
# for entry in leaderboard.entries:
# print(f"#{entry.rank}: {entry.username} ({entry.platform.name})")
# leaderboard = await client.GetPlayerLeaderboard(
# Title.BlackOps4, Platform.BattleNet, "Yeah#11207"
# )
# for entry in leaderboard.entries:
# if entry.username == "Yeah#11207":
# print(f"#{entry.rank}: {entry.username} ({entry.platform.name})")
# player = await client.GetPlayer(Platform.Steam, "Mxtive")
# leaderboard = await player.leaderboard(Title.WWII)
# for entry in leaderboard.entries:
# if entry.username == player.username:
# print(f"#{entry.rank}: {entry.username} ({entry.platform.name})")
# feed = await client.GetFriendFeed(limit=3)
# for item in feed:
# print(f"[{item.date.strftime('%Y-%m-%d %H:%M')}] {item.text}")
# if (match := item.match) is not None:
# for team in await match.teams():
# for player in team:
# if player.username != item.player.username:
# print(f" {player.username} ({player.platform.name})")
# feed = await client.GetFriendFeed(limit=5)
# for item in feed:
# print(item.text)
# await item.react(Reaction.Fire)
# feed = await client.GetFriendFeed(limit=5)
# for item in feed:
# print(item.text)
# await item.unreact()
# feed = await client.GetFriendFeed(limit=1)
# for item in feed:
# print(item.text)
# test = await item.favorite()
# feed = await client.GetFriendFeed(limit=1)
# for item in feed:
# print(item.text)
# await item.unfavorite()
# maps = await client.GetAvailableMaps(Title.ModernWarfare)
# for mapName in maps:
# print(mapName)
# for mode in maps[mapName]:
# print(f" - {mode}")
# match = (await client.GetPlayerMatches(Platform.BattleNet, "Yeah#11207", Title.ModernWarfare, Mode.Warzone, limit=3))[0]
# teams = await match.teams()
# print(teams)
# player = await client.GetPlayer(Platform.BattleNet, "Yeah#11207")
# match = (await player.matches(Title.ModernWarfare, Mode.Multiplayer, limit=3))[1]
# match = await client.GetMatch(Title.ModernWarfare, Platform.Activision, match.id)
# teams = await match.teams()
# for team in teams:
# for player in team:
# print(player.username)
# details = await match.details()
# print(details)
# player = await client.GetPlayer(Platform.BattleNet, "Yeah#11207")
# match = (await player.matches(Title.ModernWarfare, Mode.Multiplayer, limit=3))[1]
# match = await client.GetFullMatch(Platform.Activision, Title.ModernWarfare, Mode.Multiplayer, match.id)
# print(match)
# results = await client.SearchPlayers(Platform.Activision, "Tustin")
# for player in results:
# print(f"{player.username} ({player.platform.name})")
# player = await client.GetPlayer(Platform.BattleNet, "Yeah#11207")
# profile = await player.profile(Title.ModernWarfare, Mode.Multiplayer)
# print(profile)
# localize = await client.GetLocalize()
# print(localize)
# loadouts = await client.GetPlayerLoadouts(Platform.PlayStation, "ImMotive__", Title.BlackOps4)
# for loadout in loadouts:
# if loadout.name != "":
# print(f"Class: {loadout.name} (Unlocked: {loadout.unlocked})")
# if loadout.primary.id is not None:
# print(f" - Primary Weapon: {loadout.primary.id} (Variant: {loadout.primary.variant})")
# print(f" - Camo: {loadout.primary.camo}")
# for attachment in loadout.primary.attachments:
# if attachment.id is not None:
# print(f" - Attachment: {attachment.id}")
# if loadout.secondary.id is not None:
# print(f" - Secondary Weapon: {loadout.secondary.id} (Variant: {loadout.secondary.variant})")
# print(f" - Camo: {loadout.secondary.camo}")
# for attachment in loadout.secondary.attachments:
# if attachment.id is not None:
# print(f" - Attachment: {attachment.id}")
# for equipment in loadout.equipment:
# if equipment.id is not None:
# print(f" - Equipment: {equipment.id}")
# for perk in loadout.perks:
# if perk.id is not None:
# print(f" - Perk: {perk.id}")
# for wildcard in loadout.wildcards:
# if wildcard.id is not None:
# print(f" - Wildcard: {wildcard.id}")
# player = await client.GetPlayer(Platform.PlayStation, "ImMotive__")
# loadouts = await player.loadouts(Title.BlackOps4)
# for loadout in loadouts:
# if loadout.name != "":
# print(f"Class: {loadout.name} (Unlocked: {loadout.unlocked})")
# unlocks = await client.GetPlayerLoadoutUnlocks(Platform.PlayStation, "ImMotive__", Title.BlackOps4)
# for unlock in unlocks:
# print(unlock.id)
# player = await client.GetPlayer(Platform.PlayStation, "ImMotive__")
# unlocks = await player.loadoutUnlocks(Title.BlackOps4)
# for unlock in unlocks:
# print(unlock.id)
# stamp = await client.GetAuthenticityStamp(
# Platform.BattleNet, "Slicky#21337", "Swiftly Snarling Gamy Generators"
# )
# print(stamp.data)
# player = await client.GetPlayer(Platform.BattleNet, "Slicky#21337")
# stamp = await player.authenticityStamp("Swiftly Snarling Gamy Generators")
# print(stamp.stats)
# req = await client.AddFriend(5273496286943517033)
# print(f"Friend Request Status: {req}")
# req = await client.RemoveFriend(13940176918450289589)
# print(f"Friend Request Status: {req}")
# results = await client.SearchPlayers(Platform.Activision, "Tustin")
# for player in results:
# print(f"{player.username} ({player.platform.name})")
# if player.username == "Tustin#1365515":
# req = await player.removeFriend()
# print(f"Removed Friend ({req})")
# req = await player.addFriend()
# print(f"Added Friend ({req})")
# favs = await client.GetMyFavorites()
# for favorite in favs:
# print(f"Favorite: {favorite.username} ({favorite.platform.name})")
# favs = await client.AddFavorite(Platform.Activision, "Dad#1869899")
# print(f"Favorites: {len(favs)}")
# player = await client.GetPlayer(Platform.Activision, "Dad#1869899")
# favs = await player.removeFavorite()
# print(f"Favorites: {len(favs)}")
# results = await client.SearchPlayers(Platform.Activision, "Tustin")
# for player in results:
# if player.username == "Tustin#1365515":
# await player.block()
# await player.unblock()
# req = await player.addFriend()
# print(req)
# squad = await client.GetSquad("Autists")
# print(f"{squad.name} - {squad.description}")
# print(f"Owner: {squad.owner.username} ({squad.owner.platform.name})")
# for member in squad.members:
# if member.username != squad.owner.username:
# print(f"Member: {member.username} ({member.platform.name})")
# squad = await client.GetPlayerSquad(Platform.Activision, "Yeah#11207")
# print(f"{squad.name} - {squad.description}")
# print(f"Owner: {squad.owner.username} ({squad.owner.platform.name})")
# for member in squad.members:
# if member.username != squad.owner.username:
# print(f"Member: {member.username} ({member.platform.name})")
# squad = await client.GetMySquad()
# print(f"{squad.name} - {squad.description}")
# print(f"Owner: {squad.owner.username} ({squad.owner.platform.name})")
# for member in squad.members:
# if member.username != squad.owner.username:
# print(f"Member: {member.username} ({member.platform.name})")
# print(f"Leaving Squad '{squad.name}''...")
# squad = await client.LeaveSquad()
# print(f"Current Squad: {squad.name} - {squad.description} (Members: {len(squad.members)})")
# squad = await client.GetSquad("Hmmmm")
# print(f"Joining Squad '{squad.name}'...")
# await squad.join()
# squad = await client.GetMySquad()
# print(f"Current Squad: {squad.name} - {squad.description} (Members: {len(squad.members)})")
# squad = await client.GetSquad("Hmmmm")
# await squad.report()
# challenge = await client.GetSquadsTournament(Title.ModernWarfare)
# print(f"{challenge.title.name} Squads Tournament: {challenge.name} - {challenge.description}")
asyncio.get_event_loop().run_until_complete(main())