Exemplo n.º 1
0
    def test_remove_player(self):
        score_posts = []
        score_post_with_player = fp.ScorePostInfo(comment_text="test",
                                                  post_title="title")
        score_post_with_player.player_link = "https://osu.ppy.sh/u/6169483"
        score_posts.append(score_post_with_player)

        score_post_without_player = fp.ScorePostInfo(comment_text="test",
                                                     post_title="title")
        score_post_without_player.player_link = "https://osu.ppy.sh/u/1234567"
        score_posts.append(score_post_without_player)
        score_posts = fp.filter_playernames(score_posts, "temp.txt")

        self.assertEqual([score_post_without_player], score_posts)
Exemplo n.º 2
0
    def test_catch_post(self):
        post = """#### [xi - FREEDOM DiVE [Another]](https://osu.ppy.sh/b/126645?m=2) [(⬇)](https://osu.ppy.sh/d/39804 "Download this beatmap") by [Nakagawa-Kanon](https://osu.ppy.sh/u/87065 "20 ranked, 0 qualified, 2 loved, 31 unranked") || osu!catch
        **#1: [T s u m i](https://osu.ppy.sh/u/4080520 "7,703pp - rank #537 (#45 KR) - 99.78% accuracy - 98,978 playcount") (+HDHR - 99.96% - 336pp) || 1,943x max combo || Ranked (2012) || 7,348,090 plays**

        |       | CS | AR | OD | HP | SR   | BPM | Length | pp (95% | 98% | 99% | 100%) |
        :-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:
        | NoMod | 4  | 9  | 8  | 7  | 4.38 | 222 | 04:18  | 180 | 213 | 225 | 238       |
        | +FL   | 4  | 9  | 8  | 7  | 4.38 | 222 | 04:18  | 293 | 348 | 368 | 389       |

        | Player                                                                | Rank                    | pp    | Accuracy | Playcount | Top Play                                                                                                                                                                                                                       |
        :-:|:-:|:-:|:-:|:-:|:-:
        | [Morsay](https://osu.ppy.sh/u/4223607 "Previously known as 'Hibari'") | #244 (#18 FR) | 9,770 | 99.58%   | 163,714   | [Hitsuji to Ojisan ‑ XENO [Spec's Overdose]](https://osu.ppy.sh/b/663001?m=2 "SR6.92 - CS5.2 - AR10 - OD10 - HP10 - 186BPM - 02:28") +HRFL | 99.10% | 678pp |

        ***

        ^(can just shut up – )[^Source](https://github.com/christopher-dG/osu-bot)^( | )[^Developer](https://reddit.com/u/PM_ME_DOG_PICS_PLS)^( | )^(osu!catch pp is experimental) [ ](http://x "Beatmap: Found in events
        Max combo: Found via API
        .osu: Downloaded from S3")
        """
        play = fp.ScorePostInfo(comment_text=post, post_title="title")
        self.assertEqual(play.length, 258)
        self.assertEqual(play.player_name, "Morsay")
        self.assertEqual(play.player_link, "https://osu.ppy.sh/u/4223607")
        self.assertEqual(play.mapper_name, "Nakagawa-Kanon")
        self.assertEqual(play.mapper_link, "https://osu.ppy.sh/u/87065")
        self.assertEqual(play.beatmap_link, "https://osu.ppy.sh/b/126645?m=2")
        self.assertEqual(play.beatmapset_download,
                         "https://osu.ppy.sh/d/39804")
Exemplo n.º 3
0
    def test_length_change_mod(self):
        post = """#### [07th Expansion - rog-unlimitation [AngelHoney]](https://osu.ppy.sh/b/116128?m=0) [(⬇)](https://osu.ppy.sh/d/28751 "Download this beatmap") by [AngelHoney](https://osu.ppy.sh/u/104401) || osu!standard
        **#1: [aetrna](https://osu.ppy.sh/u/6447454 "16,571pp - rank #10 (#2 CA) - 97.14% accuracy - 131,150 playcount") (+HDDT - 96.25% - 1,121pp) || 850x max combo || Ranked (2012) || 2,065,166 plays**

        |       | CS | AR | OD  | HP | SR   | BPM | Length | pp (85.17% | 95% | 98% | 99% | 100%) |
        :-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:
        | NoMod | 3  | 10 | 7   | 7  | 6.35 | 220 | 02:16  | 220 | 245 | 262 | 272 | 285          |
        | +DT   | 3  | 11 | 9.1 | 7  | 9.77 | 330 | 01:31  | 954 | 1,057 | 1,113 | 1,140 | 1,175  |

        | Player                                                                            | Rank                          | pp    | Accuracy | Playstyle | Playcount | Top Play                                                                                                                                                               |
        :-:|:-:|:-:|:-:|:-:|:-:|:-:
        | [XxfortniteproxX](https://osu.ppy.sh/u/11858088 "Previously known as 'lokikaos'") | #14,867 (#2,551 US) | 6,402 | 93.60%   | TB+KB     | 77,575    | [07th Expansion ‑ rog‑unlimitation [AngelHoney]](https://osu.ppy.sh/b/116128?m=0) +DT | 85.17% | 681pp |

        ***

        ^(nice pass ecks dee – )[^Source](https://github.com/christopher-dG/osu-bot)^( | )[^Developer](https://reddit.com/u/PM_ME_DOG_PICS_PLS) [ ](http://x "Beatmap: Found in best
        .osu: Downloaded from S3")
        """
        title = "XxfortniteproxX | 07th Expansion - rog-unlimitation [AngelHoney] +DT 85.17% 0 MISS! (9.77*) | 681pp | 954pp for FC | 557/850x | His new top play, Skipped 400, 500"
        play = fp.ScorePostInfo(comment_text=post, post_title=title)
        self.assertEqual(play.post_title, title)
        self.assertEqual(play.length, 91)
        self.assertEqual(play.player_name, "XxfortniteproxX")
        # self.assertEqual(play.top_play_of_player, "[07th Expansion ‑ rog‑unlimitation [AngelHoney]](https://osu.ppy.sh/b/116128?m=0) +DT | 85.17% | 681pp")
        self.assertIsNone(play.top_play_of_player)
        self.assertEqual(play.player_link, "https://osu.ppy.sh/u/11858088")
        self.assertEqual(play.mapper_name, "AngelHoney")
        self.assertEqual(play.mapper_link, "https://osu.ppy.sh/u/104401")
        self.assertEqual(play.beatmap_link, "https://osu.ppy.sh/b/116128?m=0")
        self.assertEqual(play.beatmapset_download,
                         "https://osu.ppy.sh/d/28751")
        # self.assertEqual(play.top_on_map, "aetrna")
        self.assertIsNone(play.top_on_map)
Exemplo n.º 4
0
    def test_map_and_player(self):
        post = """#### [Chopin - Revolutionary Etude [Prestissimissimo]](https://osu.ppy.sh/b/1142884?m=0) [(⬇)](https://osu.ppy.sh/d/539300 "Download this beatmap") by [Louis Cyphre](https://osu.ppy.sh/u/186243) || osu!standard
            **#1: [goink](https://osu.ppy.sh/u/1920049 "8,530pp - rank #3,019 (#512 US) - 87.02% accuracy - 74,326 playcount") (+SOTD - 90.12%) || 681x max combo || Loved (2018) || 62,964 plays**

            |       | CS  | AR | OD | HP | SR    | BPM | Length | pp (89.24% | 95% | 98% | 99% | 100%) |
            :-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:
            | NoMod | 4   | 10 | 9  | 8  | 9.66  | 145 | 01:21  | 800 | 841 | 882 | 904 | 932          |
            | +HRNF | 5.2 | 10 | 10 | 10 | 10.36 | 145 | 01:21  | 898 | 946 | 999 | 1,027 | 1,064      |

            | Player                                                                    | Rank                 | pp     | Accuracy | Playstyle | Playcount |
            :-:|:-:|:-:|:-:|:-:|:-:
            | [Vaxei](https://osu.ppy.sh/u/4787150 "Previously known as 'Donkey Kong'") | #4 (#1 US) | 17,429 | 98.68%   | TB+KB     | 145,283   |

            ***

            ^(nice pass ecks dee – )[^Source](https://github.com/christopher-dG/osu-bot)^( | )[^Developer](https://reddit.com/u/PM_ME_DOG_PICS_PLS) [ ](http://x "Beatmap: Found in events
            .osu: Downloaded from S3")
            """
        play = fp.ScorePostInfo(comment_text=post, post_title="")
        self.assertEqual(play.comment_text, post)
        self.assertEqual(play.player_name, "Vaxei")
        self.assertEqual(play.player_link, "https://osu.ppy.sh/u/4787150")
        self.assertEqual(play.post_title, "")
        self.assertIsNone(play.top_play_of_player)
        self.assertEqual(play.beatmap_name,
                         "Chopin - Revolutionary Etude [Prestissimissimo]")
        self.assertEqual(play.beatmap_link, "https://osu.ppy.sh/b/1142884?m=0")
        self.assertEqual(play.beatmapset_download,
                         "https://osu.ppy.sh/d/539300")
        self.assertEqual(play.mapper_link, "https://osu.ppy.sh/u/186243")
        self.assertEqual(play.mapper_name, "Louis Cyphre")
        self.assertEqual(play.mods_string, "HRNF")
        self.assertEqual(play.mods_bitmask, 17)
        self.assertEqual(play.length, 81)
Exemplo n.º 5
0
    def test_map_gd(self):
        # score on guest difficulty
        post = """#### [Brandy - Cross Time !! [Muya's XX]](https://osu.ppy.sh/b/2150750?m=0) [(⬇)](https://osu.ppy.sh/d/973162 "Download this beatmap") by [Leader](https://osu.ppy.sh/u/631530) (GD by [Muya](https://osu.ppy.sh/u/153323 "30 ranked, 0 qualified, 0 loved, 23 unranked")) || osu!standard
**#2: [Woey](https://osu.ppy.sh/u/3792472 "11,859pp - rank #349 (#55 US) - 99.17% accuracy - 335,489 playcount") (+HD - 99.91% - 341pp) || 927x max combo || Ranked (2019) || 46,098 plays**

|       | CS  | AR | OD | HP  | SR   | BPM | Length | pp (95% | 96.76% | 98% | 99% | 100%) |
:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:
| NoMod | 5   | 9  | 9  | 7   | 5.93 | 160 | 02:04  | 221 | 239 | 259 | 281 | 310          |
| +HDHR | 6.5 | 10 | 10 | 9.8 | 7.06 | 160 | 02:04  | 400 | 429 | 461 | 497 | 546          |

| Player                                                                     | Rank                      | pp    | Accuracy | Playstyle | Playcount | Top Play                                                                                                                                                                                                                                       |
:-:|:-:|:-:|:-:|:-:|:-:|:-:
| [YokesPai](https://osu.ppy.sh/u/6399568 "Previously known as 'Yokes0708'") | #2,250 (#28 NO) | 9,025 | 97.97%   | TB+KB     | 66,434    | [Tanaka Hirokazu ‑ C‑TYPE [Bonsai's BasS‑TYPE]](https://osu.ppy.sh/b/1620144?m=0 "SR8.02 - CS6.2 - AR10.3 - OD10.4 - HP6 - 223BPM - 00:25") +HDDT | 97.94% | 555pp |

YouTube links: [[1]](https://youtu.be/ZDU0SNefyOM "'YokesPai | Brandy - Cross Time !! [Muya's XX] +HDHR FC #1 | 429pp | 1st HDHR FC!' by 'osu! Lazer Replays'")

***

^(omg kappadar big fan – )[^Source](https://github.com/christopher-dG/osu-bot)^( | )[^Developer](https://reddit.com/u/PM_ME_DOG_PICS_PLS) [ ](http://x "Beatmap: Found in events
.osu: Downloaded from S3")"""
        play = fp.ScorePostInfo(comment_text=post, post_title="title")
        self.assertEqual(play.length, 124)
        self.assertEqual(play.player_name, "YokesPai")
        self.assertEqual(play.player_link, "https://osu.ppy.sh/u/6399568")
        self.assertEqual(play.mapper_name, "Leader")
        self.assertEqual(play.mapper_link, "https://osu.ppy.sh/u/631530")
        self.assertEqual(play.beatmap_link, "https://osu.ppy.sh/b/2150750?m=0")
        self.assertEqual(play.beatmapset_download,
                         "https://osu.ppy.sh/d/973162")
Exemplo n.º 6
0
    def test_loved_post(self):
        # post is loved. mapper renamed. TD mod in #1. player renamed.
        post = """#### [DatManOvaDer - Busta Rhymes Goes To The Wii Shop Channel [oof]](https://osu.ppy.sh/b/1681634?m=0) [(⬇)](https://osu.ppy.sh/d/801074 "Download this beatmap") by [Fowwo](https://osu.ppy.sh/u/4547551 "Renamed to 'fowwo': 0 ranked, 0 qualified, 1 loved, 55 unranked") || osu!standard
**#1: [goink](https://osu.ppy.sh/u/1920049 "8,531pp - rank #3,074 (#521 US) - 87.03% accuracy - 74,988 playcount") (+TD - 88.72%) || 504x max combo || Loved (2019) || 397,431 plays**

| CS | AR | OD | HP | SR   | BPM | Length | pp (95% | 96.18% | 98% | 99% | 100%) |
:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:
| 4  | 10 | 10 | 6  | 8.37 | 150 | 00:59  | 589 | 605 | 645 | 670 | 708          |

| Player                                                                        | Rank                  | pp     | Accuracy | Playstyle | Playcount | Top Play                                                                                                                                                                                                            |
:-:|:-:|:-:|:-:|:-:|:-:|:-:
| [badeu](https://osu.ppy.sh/u/1473890 "Previously known as 'badeatudorpetre'") | #17 (#1 RO) | 16,254 | 97.48%   | TB+KB     | 102,140   | [Turbo ‑ PADORU / PADORU [Gift]](https://osu.ppy.sh/b/2245774?m=0 "SR9.37 - CS5.2 - AR11 - OD11.1 - HP8.7 - 285BPM - 00:21") +HDDTHR | 98.19% | 989pp |

***

^(play more – )[^Source](https://github.com/christopher-dG/osu-bot)^( | )[^Developer](https://reddit.com/u/PM_ME_DOG_PICS_PLS) [ ](http://x "Beatmap: Found in events
.osu: Downloaded from S3")
            """
        play = fp.ScorePostInfo(comment_text=post, post_title="title")
        self.assertEqual(play.length, 59)
        self.assertEqual(play.player_name, "badeu")
        self.assertEqual(play.player_link, "https://osu.ppy.sh/u/1473890")
        self.assertEqual(play.mapper_name, "Fowwo")
        self.assertEqual(play.mapper_link, "https://osu.ppy.sh/u/4547551")
        self.assertEqual(play.beatmap_link, "https://osu.ppy.sh/b/1681634?m=0")
        self.assertEqual(play.beatmapset_download,
                         "https://osu.ppy.sh/d/801074")
Exemplo n.º 7
0
    def test_remove_player_all(self):
        score_posts = []
        score_post_with_player = fp.ScorePostInfo(comment_text="test1",
                                                  post_title="title1")
        score_post_with_player.player_link = "https://osu.ppy.sh/u/6169483"
        score_posts.append(score_post_with_player)

        score_post_with_player = fp.ScorePostInfo(comment_text="test2",
                                                  post_title="title2")
        score_post_with_player.player_link = "https://osu.ppy.sh/u/6169483"
        score_posts.append(score_post_with_player)

        score_post_with_player = fp.ScorePostInfo(comment_text="test3",
                                                  post_title="title3")
        score_post_with_player.player_link = "https://osu.ppy.sh/u/6169483"
        score_posts.append(score_post_with_player)

        score_posts = fp.filter_playernames(score_posts, "temp.txt")
        self.assertEqual([], score_posts)
Exemplo n.º 8
0
def stream(scale=SCALE):
    reddit = fp.initialize()
    for post in reddit.subreddit("osugame").stream.submissions():
        try:
            print(post.title)
            if comment := fp.get_scorepost_comment(post, "osu-bot"):
                replay_info = download.ReplayRecording(
                    fp.ScorePostInfo(comment))
                download.download_beatmapsets([replay_info])
                download.download_replays([replay_info])
                import_maps([replay_info])
                print("Recording video", replay_info)
                make_video(replay_info, scale)
        except Exception:
            pass  # ¯\_(ツ)_/¯
Exemplo n.º 9
0
    def test_no_map(self):
        post = """| Player                                                                | Rank                  | pp     | Accuracy | Playcount |
            :-:|:-:|:-:|:-:|:-:
            | [Umbre](https://osu.ppy.sh/u/2766034 "Previously known as 'oharryo'") | #28 (#3 DE) | 15,359 | 99.42%   | 233,402   |

            YouTube links: [[1]](https://youtu.be/cTrZ6iBvngs "'[7.75⭐Live] Umbre | BABYMETAL - Road of Resistance [Determined] 99.83% {#2 816pp FC} - osu!' by 'cpol'") [[2]](https://youtu.be/6YrFyawPLHM "'osu! | Umbre | BABYMETAL - Road of Resistance [Determined] 7.75⭐ 99.83% FC | 816pp #2' by 'Circle People'")

            ***

            ^(kirito is legit – )[^Source](https://github.com/christopher-dG/osu-bot)^( | )[^Developer](https://reddit.com/u/PM_ME_DOG_PICS_PLS) [ ](http://x "Beatmap 'BABYMETAL - Road of Resistance  [Determined]': Not found")
        """
        play = fp.ScorePostInfo(comment_text=post, post_title="")
        self.assertEqual(play.comment_text, post)
        self.assertEqual(play.player_name, "Umbre")
        self.assertEqual(play.player_link, "https://osu.ppy.sh/u/2766034")
        self.assertEqual(play.post_title, "")
        self.assertIsNone(play.top_play_of_player)
        self.assertIsNone(play.beatmap_name)
        self.assertIsNone(play.beatmap_link)
        self.assertIsNone(play.beatmapset_download)
        self.assertIsNone(play.mapper_link)
        self.assertIsNone(play.mods_bitmask)
Exemplo n.º 10
0
    def __init__(self,
                 play: fp.ScorePostInfo = None,
                 beatmap_downloader: BeatmapDownloader = None,
                 comment: str = None,
                 title: str = None):
        self.play: fp.ScorePostInfo = None
        self._beatmap_downloader: BeatmapDownloader = None
        self.replay_file: str = None
        self.beatmap_file: str = None
        self.video_file: str = None
        self.video_title: str = None
        self.video_description: str = None
        self.video_tags: str = None
        self.video_category: str = None
        # self.video_visibility: str = None # only relevant at the upload step

        if play is not None:
            self.play = play
        elif comment is not None and title is not None:
            self.play = fp.ScorePostInfo(comment_text=comment,
                                         post_title=title)
        self._beatmap_downloader = beatmap_downloader