Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User:
- def __init__(self, response):
- self.userid = int(response["user_id"])
- self.username = response["username"]
- self.join_date = Osu._parse_time(response["join_date"])
- self.count300 = int(response["count300"])
- self.count100 = int(response["count100"])
- self.count50 = int(response["count50"])
- self.playcount = int(response["playcount"])
- self.ranked_score = int(response["ranked_score"])
- self.total_score = int(response["total_score"])
- self.rank = int(response["pp_rank"])
- self.level = float(response["level"])
- self.pp = float(response["pp_raw"])
- self.acc = float(response["accuracy"])
- self.rank_ss = float(response["count_rank_ss"])
- self.rank_ssh = float(response["count_rank_ssh"])
- self.rank_s = float(response["count_rank_s"])
- self.rank_sh = float(response["count_rank_sh"])
- self.rank_a = float(response["count_rank_a"])
- self.country = response["country"]
- self.time_played = int(response["total_seconds_played"])
- self.rank_country = int(response["pp_country_rank"])
- self.events = self.get_events(response["events"])
- def get_events(self, raw):
- events = []
- for e in raw:
- events.append(Event(e))
- return events
- class Event:
- def __init__(self, response):
- self.html = response["display_html"]
- self.beatmap_id = int(response["beatmap_id"])
- self.beatmapset_id = int(response["beatmapset_id"])
- self.date = Osu._parse_time(response["date"])
- self.epic = response["epicfactor"]
- class Beatmap:
- def __init__(self, response):
- self.approved = int(response["approved"]) # add table for this
- self.submit_date = Osu._parse_time(response["submit_date"])
- self.approved_date = Osu._parse_time(response["approved_date"])
- self.last_update = Osu._parse_time(response["last_update"])
- self.artist = response["artist"]
- self.beatmap_id = int(response["beatmap_id"])
- self.beatmapset_id = int(response["beatmapset_id"])
- self.bpm = float(response["bpm"])
- self.creator = response["creator"]
- self.creator_id = int(response["creator_id"])
- self.diff_star = float(response["difficultyrating"])
- #self.diff_aim = float(response["diff_aim"]) #NYI
- #self.diff_speed = float(response["diff_speed"]) #NYI
- self.cs = float(response["diff_size"])
- self.od = float(response["diff_overall"])
- self.ar = float(response["diff_approach"])
- self.drain = float(response["diff_drain"]) #drain gang
- self.hit_length = float(response["hit_length"])
- self.source = response["source"]
- self.genre_id = int(response["genre_id"]) #add table for this
- self.language_id = int(response["language_id"]) #add table for this
- self.title = response["title"]
- self.total_length = float(response["total_length"])
- self.diff_name = response["version"]
- self.file_md5 = response["file_md5"]
- self.mode = int(response["mode"])
- self.tags = response["tags"].split(" ")
- self.favourite_count = int(response["favourite_count"])
- self.rating = float(response["rating"])
- self.play_count = int(response["playcount"])
- self.pass_count = int(response["passcount"])
- self.count_normal = int(response["count_normal"])
- self.count_slider = int(response["count_slider"])
- self.count_spinner = int(response["count_spinner"])
- #self.max_combo = int(response["max_combo"]) #NYI
- self.download_unavailable = bool(int(response["download_unavailable"]))
- self.audio_unavailable = bool(int(response["audio_unavailable"]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement