def fanboxGetSupportedUsers(self): ''' get all supported users from the list from https://www.pixiv.net/ajax/fanbox/support''' url = 'https://www.pixiv.net/ajax/fanbox/support' PixivHelper.print_and_log('info', 'Getting supported artists from ' + url) # read the json response response = self.open_with_retry(url).read() result = Fanbox(response) return result
def testFanboxSupportedArtist(self): p = open('./test/Fanbox_supported_artist.json', 'r').read() result = Fanbox(p) self.assertIsNotNone(result) self.assertEqual(len(result.supportedArtist), 19) self.assertTrue(7968 in result.supportedArtist) self.assertTrue(3931854 in result.supportedArtist) self.assertTrue(30716447 in result.supportedArtist)
def testFanboxSupportedArtist(self): p = open('./test/Fanbox_supported_artist.json', 'r').read() result = Fanbox(p) self.assertIsNotNone(result) self.assertEqual(len(result.supportedArtist), 3) self.assertTrue(190026 in result.supportedArtist) self.assertTrue(685000 in result.supportedArtist) self.assertTrue(15521131 in result.supportedArtist)
def testFanboxSupportedArtist(self): # https://fanbox.pixiv.net/api/plan.listSupporting p = open('./test/Fanbox_supported_artist.json', 'r', encoding="utf-8").read() result = Fanbox(p) self.assertIsNotNone(result) self.assertEqual(len(result.supportedArtist), 52) self.assertTrue(4820 in result.supportedArtist) self.assertTrue(11443 in result.supportedArtist) self.assertTrue(226267 in result.supportedArtist)
def fanboxGetSupportedUsers(self): ''' get all supported users from the list from https://fanbox.pixiv.net/api/plan.listSupporting''' url = 'https://fanbox.pixiv.net/api/plan.listSupporting' PixivHelper.print_and_log('info', f'Getting supported artists from {url}') referer = "https://www.pixiv.net/fanbox/support/creators" req = mechanize.Request(url) req.add_header('Accept', 'application/json, text/plain, */*') req.add_header('Referer', referer) req.add_header('Origin', 'https://www.pixiv.net') req.add_header('User-Agent', self._config.useragent) res = self.open_with_retry(req) # read the json response response = res.read() res.close() result = Fanbox(response) return result