mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-25 19:03:46 +03:00
Fetch invalid bot methods from pwrtelegram
This commit is contained in:
parent
ed5c44a260
commit
c7d7977951
|
@ -64,3 +64,4 @@ USER_ALREADY_PARTICIPANT=The authenticated user is already a participant of the
|
|||
USER_DEACTIVATED=The user has been deleted/deactivated
|
||||
FLOOD_WAIT_X=A wait of {} seconds is required
|
||||
FLOOD_TEST_PHONE_WAIT_X=A wait of {} seconds is required in the test servers
|
||||
CHAT_NOT_MODIFIED=The chat or channel wasn't modified (title, invites, username, admins, etc. are the same).ç
|
||||
|
|
File diff suppressed because one or more lines are too long
1
telethon_generator/data/invalid_bot_methods.json
Normal file
1
telethon_generator/data/invalid_bot_methods.json
Normal file
|
@ -0,0 +1 @@
|
|||
["account.changePhone", "account.checkUsername", "account.confirmPhone", "account.deleteAccount", "account.getAccountTTL", "account.getAuthorizations", "account.getNotifySettings", "account.getPassword", "account.getPasswordSettings", "account.getPrivacy", "account.getTmpPassword", "account.getWallPapers", "account.registerDevice", "account.reportPeer", "account.resetAuthorization", "account.resetNotifySettings", "account.sendChangePhoneCode", "account.sendConfirmPhoneCode", "account.setAccountTTL", "account.setPrivacy", "account.unregisterDevice", "account.updateDeviceLocked", "account.updateNotifySettings", "account.updatePasswordSettings", "account.updateProfile", "account.updateStatus", "account.updateUsername", "auth.cancelCode", "auth.checkPassword", "auth.checkPhone", "auth.recoverPassword", "auth.requestPasswordRecovery", "auth.resendCode", "auth.resetAuthorizations", "auth.sendCode", "auth.sendInvites", "auth.signIn", "auth.signUp", "channels.checkUsername", "channels.createChannel", "channels.deleteChannel", "channels.deleteUserHistory", "channels.exportMessageLink", "channels.getAdminedPublicChannels", "channels.getAdminLog", "channels.inviteToChannel", "channels.joinChannel", "channels.readHistory", "channels.readMessageContents", "channels.reportSpam", "channels.toggleInvites", "channels.toggleSignatures", "channels.updateUsername", "contacts.block", "contacts.deleteContact", "contacts.deleteContacts", "contacts.exportCard", "contacts.getBlocked", "contacts.getContacts", "contacts.getStatuses", "contacts.getTopPeers", "contacts.importCard", "contacts.importContacts", "contacts.resetTopPeerRating", "contacts.search", "contacts.unblock", "help.getAppChangelog", "help.getAppUpdate", "help.getInviteText", "help.getNearestDc", "help.getSupport", "help.getTermsOfService", "help.saveAppLog", "langpack.getDifference", "langpack.getLangPack", "langpack.getLanguages", "langpack.getStrings", "messages.acceptEncryption", "messages.addChatUser", "messages.checkChatInvite", "messages.clearRecentStickers", "messages.createChat", "messages.deleteHistory", "messages.discardEncryption", "messages.editChatAdmin", "messages.exportChatInvite", "messages.getAllChats", "messages.getAllDrafts", "messages.getAllStickers", "messages.getArchivedStickers", "messages.getAttachedStickers", "messages.getBotCallbackAnswer", "messages.getCommonChats", "messages.getDhConfig", "messages.getDialogs", "messages.getFeaturedStickers", "messages.getHistory", "messages.getInlineBotResults", "messages.getMaskStickers", "messages.getMessageEditData", "messages.getMessagesViews", "messages.getPeerDialogs", "messages.getPeerSettings", "messages.getPinnedDialogs", "messages.getRecentStickers", "messages.getSavedGifs", "messages.getUnreadMentions", "messages.getWebPage", "messages.getWebPagePreview", "messages.hideReportSpam", "messages.importChatInvite", "messages.installStickerSet", "messages.migrateChat", "messages.readFeaturedStickers", "messages.readHistory", "messages.readMessageContents", "messages.receivedMessages", "messages.reorderPinnedDialogs", "messages.reorderStickerSets", "messages.reportEncryptedSpam", "messages.reportSpam", "messages.requestEncryption", "messages.saveDraft", "messages.saveGif", "messages.saveRecentSticker", "messages.search", "messages.searchGifs", "messages.searchGlobal", "messages.sendInlineBotResult", "messages.sendScreenshotNotification", "messages.setEncryptedTyping", "messages.startBot", "messages.toggleChatAdmins", "messages.toggleDialogPin", "messages.uninstallStickerSet", "payments.clearSavedInfo", "payments.getPaymentForm", "payments.getPaymentReceipt", "payments.getSavedInfo", "payments.sendPaymentForm", "payments.validateRequestedInfo", "phone.acceptCall", "phone.confirmCall", "phone.discardCall", "phone.getCallConfig", "phone.receivedCall", "phone.requestCall", "phone.saveCallDebug", "phone.setCallRating", "photos.deletePhotos", "photos.updateProfilePhoto", "photos.uploadProfilePhoto", "upload.getCdnFile", "upload.getWebFile"]
|
|
@ -1,32 +0,0 @@
|
|||
import sys
|
||||
import json
|
||||
import urllib.request
|
||||
|
||||
OUT = 'data/errors.json'
|
||||
URL = 'https://rpc.pwrtelegram.xyz/?all'
|
||||
|
||||
|
||||
def fetch_errors(output, url=URL):
|
||||
print('Opening a connection to', url, '...')
|
||||
r = urllib.request.urlopen(urllib.request.Request(
|
||||
url, headers={'User-Agent' : 'Mozilla/5.0'}
|
||||
))
|
||||
print('Checking response...')
|
||||
data = json.loads(
|
||||
r.read().decode(r.info().get_param('charset') or 'utf-8')
|
||||
)
|
||||
if data.get('ok'):
|
||||
print('Response was okay, saving data')
|
||||
with open(output, 'w', encoding='utf-8') as f:
|
||||
json.dump(data, f, sort_keys=True)
|
||||
return True
|
||||
else:
|
||||
print('The data received was not okay:')
|
||||
print(json.dumps(data, indent=4, sort_keys=True))
|
||||
return False
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
out = OUT if len(sys.argv) < 2 else sys.argv[2]
|
||||
url = URL if len(sys.argv) < 3 else sys.argv[3]
|
||||
fetch_errors(out, url)
|
30
telethon_generator/fetch_pwrtelegram.py
Normal file
30
telethon_generator/fetch_pwrtelegram.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
import sys
|
||||
import json
|
||||
import urllib.request
|
||||
|
||||
FILES = (
|
||||
('data/errors.json', 'https://rpc.pwrtelegram.xyz/?all'),
|
||||
('data/invalid_bot_methods.json', 'https://rpc.pwrtelegram.xyz/?bot')
|
||||
)
|
||||
|
||||
|
||||
def fetch_json(output, url):
|
||||
r = urllib.request.urlopen(urllib.request.Request(
|
||||
url, headers={'User-Agent' : 'Mozilla/5.0'}
|
||||
))
|
||||
data = json.loads(
|
||||
r.read().decode(r.info().get_param('charset') or 'utf-8')
|
||||
)
|
||||
if data.get('ok'):
|
||||
del data['ok']
|
||||
if len(data) == 1:
|
||||
data = data[next(iter(data.keys()))]
|
||||
with open(output, 'w', encoding='utf-8') as f:
|
||||
json.dump(data, f, sort_keys=True)
|
||||
else:
|
||||
print(json.dumps(data, indent=4, sort_keys=True), file=sys.stderr)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
for output, url in FILES:
|
||||
fetch_json(output, url)
|
Loading…
Reference in New Issue
Block a user