42 lines
14 KiB
Markdown
42 lines
14 KiB
Markdown
We have some sample usage of this library here:
|
|
|
|
|
|
```
|
|
In [40]: client = ScoreSaberClient(base_url="https://scoresaber.com")
|
|
...:
|
|
...: player_id = '76561199407393962'
|
|
...:
|
|
...: player_score_collection: PlayerScoreCollection = get_api_player_player_id_scores.sync(
|
|
...: client=client,
|
|
...: player_id=player_id,
|
|
...: # page=1,
|
|
...: # limit=50,
|
|
...: # sort='recent'
|
|
...: )
|
|
...:
|
|
2024-09-30 09:30:49 DEBUG: load_ssl_context verify=True cert=None trust_env=True http2=False
|
|
2024-09-30 09:30:49 DEBUG: load_verify_locations cafile='/home/blee/ops/beatsaber/playlist-tool/.venv/lib/python3.11/site-packages/certifi/cacert.pem'
|
|
2024-09-30 09:30:49 DEBUG: connect_tcp.started host='scoresaber.com' port=443 local_address=None timeout=None socket_options=None
|
|
2024-09-30 09:30:49 DEBUG: connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x7fcc7be40c90>
|
|
2024-09-30 09:30:49 DEBUG: start_tls.started ssl_context=<ssl.SSLContext object at 0x7fcc81720170> server_hostname='scoresaber.com' timeout=None
|
|
2024-09-30 09:30:49 DEBUG: start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x7fcc7be41b10>
|
|
2024-09-30 09:30:49 DEBUG: send_request_headers.started request=<Request [b'GET']>
|
|
2024-09-30 09:30:49 DEBUG: send_request_headers.complete
|
|
2024-09-30 09:30:49 DEBUG: send_request_body.started request=<Request [b'GET']>
|
|
2024-09-30 09:30:49 DEBUG: send_request_body.complete
|
|
2024-09-30 09:30:49 DEBUG: receive_response_headers.started request=<Request [b'GET']>
|
|
2024-09-30 09:30:49 DEBUG: receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Mon, 30 Sep 2024 16:30:49 GMT'), (b'Content-Type', b'application/json; charset=utf-8'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'Content-Security-Policy', b"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"), (b'Cross-Origin-Embedder-Policy', b'require-corp'), (b'Cross-Origin-Opener-Policy', b'same-origin'), (b'Cross-Origin-Resource-Policy', b'same-origin'), (b'Origin-Agent-Cluster', b'?1'), (b'Referrer-Policy', b'no-referrer'), (b'Strict-Transport-Security', b'max-age=15552000; includeSubDomains'), (b'X-Content-Type-Options', b'nosniff'), (b'X-DNS-Prefetch-Control', b'off'), (b'X-Download-Options', b'noopen'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'X-Permitted-Cross-Domain-Policies', b'none'), (b'X-XSS-Protection', b'0'), (b'X-RateLimit-Limit', b'400'), (b'X-RateLimit-Remaining', b'399'), (b'X-RateLimit-Reset', b'1727713862'), (b'ETag', b'W/"3369-agcCR95tngk5ACxBE2z3E87S8IM"'), (b'CF-Cache-Status', b'DYNAMIC'), (b'Report-To', b'{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=3WgwWJyhnP7LHZaTLYLst9jpVmzOj5bhgASSmRqf97BJDejCgVN2K%2BD1XI79HkY4TAXyQVzNxgYWid9iMXy2lmS0q6QVpYZKakJZhoPOj1GEKQeV22VgLUfKXsgPbxK2aQ%3D%3D"}],"group":"cf-nel","max_age":604800}'), (b'NEL', b'{"success_fraction":0,"report_to":"cf-nel","max_age":604800}'), (b'Server', b'cloudflare'), (b'CF-RAY', b'8cb59986999b0cbb-LAX'), (b'Content-Encoding', b'gzip')])
|
|
2024-09-30 09:30:49 INFO: HTTP Request: GET https://scoresaber.com/api/player/76561199407393962/scores "HTTP/1.1 200 OK"
|
|
2024-09-30 09:30:49 DEBUG: receive_response_body.started request=<Request [b'GET']>
|
|
2024-09-30 09:30:49 DEBUG: receive_response_body.complete
|
|
2024-09-30 09:30:49 DEBUG: response_closed.started
|
|
2024-09-30 09:30:49 DEBUG: response_closed.complete
|
|
|
|
2024-09-30 09:30:49 DEBUG: Using selector: EpollSelector
|
|
In [41]: player_score_collection
|
|
Out[41]: PlayerScoreCollection(player_scores=[PlayerScore(score=Score(id=84950667, rank=104, base_score=1099231, modified_score=1099231, pp=341.7099, weight=1, modifiers='', multiplier=1, bad_cuts=0, missed_notes=2, max_combo=775, full_combo=False, hmd=0, has_replay=True, time_set=datetime.datetime(2024, 9, 5, 1, 8, 57, tzinfo=tzutc()), device_hmd='Vive', device_controller_left='Touch', device_controller_right='Touch', leaderboard_player_info=None), leaderboard=LeaderboardInfo(id=617336, song_hash='CEE98A6F3D644468E231D385CA609F804977583A', song_name='Unlimited Hyperlink', song_sub_name='', song_author_name='Kobaryo', level_author_name='Timbo', difficulty=Difficulty(leaderboard_id=617336, difficulty=5, game_mode='SoloStandard', difficulty_raw='_Hard_SoloStandard'), max_score=1165755, created_date=datetime.datetime(2024, 7, 20, 0, 17, 12, tzinfo=tzutc()), ranked_date=datetime.datetime(2024, 9, 2, 17, 38, 15, tzinfo=tzutc()), qualified_date=datetime.datetime(2024, 8, 4, 7, 39, 33, tzinfo=tzutc()), loved_date=None, ranked=True, qualified=False, loved=False, max_pp=-1, stars=8.46, positive_modifiers=False, plays=357, daily_plays=10, cover_image='https://cdn.scoresaber.com/covers/CEE98A6F3D644468E231D385CA609F804977583A.png', player_score=None, difficulties=[], additional_properties={})), PlayerScore(score=Score(id=84877397, rank=556, base_score=1440841, modified_score=1440841, pp=313.5614, weight=0.965, modifiers='', multiplier=1, bad_cuts=1, missed_notes=1, max_combo=979, full_combo=False, hmd=0, has_replay=False, time_set=datetime.datetime(2024, 9, 3, 0, 40, 42, tzinfo=tzutc()), device_hmd='Vive', device_controller_left='Touch', device_controller_right='Touch', leaderboard_player_info=None), leaderboard=LeaderboardInfo(id=292442, song_hash='5EEA46E777960913951ED9D0257404CC3A1BE305', song_name='Memecore', song_sub_name='', song_author_name='HiTECH NINJA', level_author_name='FatBeanzoop', difficulty=Difficulty(leaderboard_id=292442, difficulty=7, game_mode='SoloStandard', difficulty_raw='_Expert_SoloStandard'), max_score=1541115, created_date=datetime.datetime(2020, 9, 10, 3, 12, 50, tzinfo=tzutc()), ranked_date=datetime.datetime(2020, 9, 15, 9, 27, 51, tzinfo=tzutc()), qualified_date=datetime.datetime(2020, 9, 10, 16, 7, 16, tzinfo=tzutc()), loved_date=None, ranked=True, qualified=False, loved=False, max_pp=-1, stars=8.07, positive_modifiers=False, plays=5560, daily_plays=4, cover_image='https://cdn.scoresaber.com/covers/5EEA46E777960913951ED9D0257404CC3A1BE305.png', player_score=None, difficulties=[], additional_properties={})), PlayerScore(score=Score(id=83361463, rank=132, base_score=1363346, modified_score=1363346, pp=306.9723, weight=0.931225, modifiers='', multiplier=1, bad_cuts=0, missed_notes=0, max_combo=1572, full_combo=True, hmd=0, has_replay=True, time_set=datetime.datetime(2024, 8, 15, 23, 10, 29, tzinfo=tzutc()), device_hmd='Vive', device_controller_left='Touch', device_controller_right='Touch', leaderboard_player_info=None), leaderboard=LeaderboardInfo(id=299718, song_hash='A51425319D892986A4867388153BCE45B3C28483', song_name='Shake The Ground', song_sub_name='(feat. Sullivan King & Jonah Kay)', song_author_name='Kill The Noise & SNAILS', level_author_name='Checkthepan', difficulty=Difficulty(leaderboard_id=299718, difficulty=7, game_mode='SoloStandard', difficulty_raw='_Expert_SoloStandard'), max_score=1438995, created_date=datetime.datetime(2020, 10, 9, 0, 26, 9, tzinfo=tzutc()), ranked_date=datetime.datetime(2020, 10, 16, 15, 28, 19, tzinfo=tzutc()), qualified_date=datetime.datetime(2020, 10, 11, 16, 10, 9, tzinfo=tzutc()), loved_date=None, ranked=True, qualified=False, loved=False, max_pp=-1, stars=7.4, positive_modifiers=False, plays=3317, daily_plays=1, cover_image='https://cdn.scoresaber.com/covers/A51425319D892986A4867388153BCE45B3C28483.png', player_score=None, difficulties=[], additional_properties={})), PlayerScore(score=Score(id=83135043, rank=512, base_score=884286, modified_score=884286, pp=302.4246, weight=0.8986321249999999, modifiers='', multiplier=1, bad_cuts=0, missed_notes=2, max_combo=797, full_combo=False, hmd=0, has_replay=True, time_set=datetime.datetime(2024, 5, 1, 22, 58, 43, tzinfo=tzutc()), device_hmd='Quest 2', device_controller_left='Quest 2 Touch', device_controller_right='Quest 2 Touch', leaderboard_player_info=None), leaderboard=LeaderboardInfo(id=320372, song_hash='62128DFDD39DB6A2CC380C254031A9D4367B87A1', song_name='Nibelungen', song_sub_name='', song_author_name='Gram', level_author_name='ComplexFrequency', difficulty=Difficulty(leaderboard_id=320372, difficulty=5, game_mode='SoloStandard', difficulty_raw='_Hard_SoloStandard'), max_score=937595, created_date=datetime.datetime(2021, 1, 11, 2, 21, 1, tzinfo=tzutc()), ranked_date=datetime.datetime(2021, 1, 22, 5, 8, 50, tzinfo=tzutc()), qualified_date=datetime.datetime(2021, 1, 11, 2, 57, 56, tzinfo=tzutc()), loved_date=None, ranked=True, qualified=False, loved=False, max_pp=-1, stars=7.48, positive_modifiers=False, plays=5915, daily_plays=4, cover_image='https://cdn.scoresaber.com/covers/62128DFDD39DB6A2CC380C254031A9D4367B87A1.png', player_score=None, difficulties=[], additional_properties={})), PlayerScore(score=Score(id=82951813, rank=225, base_score=1063732, modified_score=1063732, pp=299.8663, weight=0.8671800006249999, modifiers='', multiplier=1, bad_cuts=0, missed_notes=0, max_combo=1228, full_combo=True, hmd=0, has_replay=True, time_set=datetime.datetime(2024, 9, 17, 21, 0, 28, tzinfo=tzutc()), device_hmd='Vive', device_controller_left='Touch', device_controller_right='Touch', leaderboard_player_info=None), leaderboard=LeaderboardInfo(id=290861, song_hash='2E6CB362F31D00EE9F2B9C8640CFD94BBFB8377F', song_name='Astronomia', song_sub_name='(Camellia Remix)', song_author_name='Vicetone and Tony Igy', level_author_name='That_Narwhal', difficulty=Difficulty(leaderboard_id=290861, difficulty=7, game_mode='SoloStandard', difficulty_raw='_Expert_SoloStandard'), max_score=1122515, created_date=datetime.datetime(2020, 9, 3, 4, 19, 55, tzinfo=tzutc()), ranked_date=datetime.datetime(2020, 9, 8, 12, 35, 3, tzinfo=tzutc()), qualified_date=datetime.datetime(2020, 9, 3, 13, 24, 17, tzinfo=tzutc()), loved_date=None, ranked=True, qualified=False, loved=False, max_pp=-1, stars=7.22, positive_modifiers=False, plays=5830, daily_plays=3, cover_image='https://cdn.scoresaber.com/covers/2E6CB362F31D00EE9F2B9C8640CFD94BBFB8377F.png', player_score=None, difficulties=[], additional_properties={})), PlayerScore(score=Score(id=82951898, rank=284, base_score=1190738, modified_score=1190738, pp=299.2155, weight=0.8368287006031249, modifiers='', multiplier=1, bad_cuts=1, missed_notes=2, max_combo=900, full_combo=False, hmd=0, has_replay=True, time_set=datetime.datetime(2024, 4, 12, 22, 25, 4, tzinfo=tzutc()), device_hmd='Quest 2', device_controller_left='Quest 2 Touch', device_controller_right='Quest 2 Touch', leaderboard_player_info=None), leaderboard=LeaderboardInfo(id=198670, song_hash='9E6DEB75CA74B96497BC5EF0BB5B98EE5C0B7E69', song_name='Twisted Drop Party', song_sub_name='', song_author_name='t+pazolite & Getty', level_author_name='Depito & ExUnReal', difficulty=Difficulty(leaderboard_id=198670, difficulty=7, game_mode='SoloStandard', difficulty_raw='_Expert_SoloStandard'), max_score=1267875, created_date=datetime.datetime(2020, 1, 21, 17, 27, 38, tzinfo=tzutc()), ranked_date=datetime.datetime(2020, 4, 9, 18, 0, 31, tzinfo=tzutc()), qualified_date=datetime.datetime(2020, 4, 5, 0, 59, 34, tzinfo=tzutc()), loved_date=None, ranked=True, qualified=False, loved=False, max_pp=-1, stars=7.57, positive_modifiers=False, plays=3988, daily_plays=1, cover_image='https://cdn.scoresaber.com/covers/9E6DEB75CA74B96497BC5EF0BB5B98EE5C0B7E69.png', player_score=None, difficulties=[], additional_properties={})), PlayerScore(score=Score(id=84617098, rank=268, base_score=695542, modified_score=695542, pp=298.7397, weight=0.8075396960820155, modifiers='', multiplier=1, bad_cuts=0, missed_notes=0, max_combo=816, full_combo=True, hmd=0, has_replay=True, time_set=datetime.datetime(2024, 8, 16, 23, 28, 18, tzinfo=tzutc()), device_hmd='Vive', device_controller_left='Touch', device_controller_right='Touch', leaderboard_player_info=None), leaderboard=LeaderboardInfo(id=597749, song_hash='61FD5B17CBA13ABE1E76591121E1AC7FE8A5F425', song_name='ANALYS', song_sub_name='', song_author_name='HAYAKO', level_author_name='RetrX', difficulty=Difficulty(leaderboard_id=597749, difficulty=7, game_mode='SoloStandard', difficulty_raw='_Expert_SoloStandard'), max_score=743475, created_date=datetime.datetime(2024, 3, 2, 5, 38, 26, tzinfo=tzutc()), ranked_date=datetime.datetime(2024, 3, 18, 3, 3, 12, tzinfo=tzutc()), qualified_date=datetime.datetime(2024, 3, 4, 19, 50, 44, tzinfo=tzutc()), loved_date=None, ranked=True, qualified=False, loved=False, max_pp=-1, stars=7.67, positive_modifiers=False, plays=1253, daily_plays=3, cover_image='https://cdn.scoresaber.com/covers/61FD5B17CBA13ABE1E76591121E1AC7FE8A5F425.png', player_score=None, difficulties=[], additional_properties={})), PlayerScore(score=Score(id=83669721, rank=1373, base_score=1687417, modified_score=1687417, pp=298.7396, weight=0.7792758067191449, modifiers='', multiplier=1, bad_cuts=0, missed_notes=4, max_combo=764, full_combo=False, hmd=0, has_replay=False, time_set=datetime.datetime(2024, 9, 6, 21, 32, 52, tzinfo=tzutc()), device_hmd='Vive', device_controller_left='Touch', device_controller_right='Touch', leaderboard_player_info=None), leaderboard=LeaderboardInfo(id=368474, song_hash='9E3CD9B0C5559167E31E6894C14E391AEA937991', song_name='KillerToy', song_sub_name='', song_author_name='Camellia', level_author_name='Jabob', difficulty=Difficulty(leaderboard_id=368474, difficulty=7, game_mode='SoloStandard', difficulty_raw='_Expert_SoloStandard'), max_score=1818955, created_date=datetime.datetime(2021, 7, 14, 17, 31, 30, tzinfo=tzutc()), ranked_date=datetime.datetime(2021, 9, 19, 16, 56, 7, tzinfo=tzutc()), qualified_date=datetime.datetime(2021, 9, 10, 18, 53, 58, tzinfo=tzutc()), loved_date=None, ranked=True, qualified=False, loved=False, max_pp=-1, stars=7.91, positive_modifiers=False, plays=6698, daily_plays=8, cover_image='https://cdn.scoresaber.com/covers/9E3CD9B0C5559167E31E6894C14E391AEA937991.png', player_score=None, difficulties=[], additional_properties={}))], metadata=Metadata(total=961, page=1, items_per_page=8))
|
|
|
|
2024-09-30 09:31:03 DEBUG: Using selector: EpollSelector
|
|
```
|
|
|