spotify_scraper.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:spotify-scraper 作者: naschorr 项目源码 文件源码
def captureAlbumArt(self):
        while(self.windowHandle != GetForegroundWindow()):
            SetForegroundWindow(self.windowHandle)
            time.sleep(WAIT_TIME)   ## Give Spotify a moment to come to the foreground
        ShowWindow(self.windowHandle, SW_SHOWMAXIMIZED)
        time.sleep(WAIT_TIME)   ## Give Spotify a second to become maximized

        ## Get the edges of the window
        left, top, right, bottom = GetWindowRect(self.windowHandle)
        left += self.artOffsets[0]
        bottom -= self.artOffsets[1]
        ## Get the album art's location from those edges and user specified offsets.
        region = (left, bottom - self.artSideLength, left + self.artSideLength, bottom)
        return pyscreenshot.grab(bbox=region, childprocess=False)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号