Yonka2019

lolololo.py

Jun 14th, 2021 (edited)
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.53 KB | None | 0 0
  1. import socket
  2. import re
  3.  
  4. SERVER_IP = "44.224.228.136"
  5. SERVER_PORT = 1336
  6. BUFFER = 1024
  7. MY_ID = "713"  # Yonka / yonka2019 / yonka2003@gmail.com
  8.  
  9.  
  10. def main():
  11.     sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  12.     sock.connect((SERVER_IP, SERVER_PORT))
  13.  
  14.     login(sock, "yonka2019", "12345")
  15.     # . . .
  16.  
  17.  
  18. def custom_glit_upload(sock, feed_owner_id, publisher_avatar, background_color, date, content, font_color):
  19.     """
  20.    Custom glit uploading with editable parameters (the application allows u to edit only the content label,
  21.    here you can edit additional parameters) @param sock: current opened socket @param publisher_avatar: set any avatar (
  22.    im1->im8) @param background_color: set any background color @param date: set any date
  23.    YYYY-MM-DD'T'HH:MM:SS.MSMSMS'Z' @param content: the content of the uploaded glit @param font_color: the font
  24.    color of the text
  25.    """
  26.     sock.sendall(('550#{gli&&er}{"feed_owner_id":' + feed_owner_id + ',"publisher_id":' + MY_ID + ','
  27.                   '"publisher_screen_name":"Yonka", '
  28.                   '"publisher_avatar":"' + publisher_avatar + '","background_color":"' + background_color
  29.                   + '","date":"' + date + '",'  # UTC
  30.                   '"content":"' + content + '","font_color":"' + font_color + '","id":-1}##').encode())
  31.     print(sock.recv(BUFFER).decode())
  32.  
  33.  
  34. def custom_comment_upload(sock, content, date):
  35.     """
  36.    Custom comment uploading with editable parameters (the application allows u to edit only the content label,
  37.    here you can edit additional parameters)
  38.    @param sock: current opened socket
  39.    @param content: the content of the uploaded comment
  40.    @param date: set any date YYYY-MM-DD'T'HH:MM:SS.MSMSMS'Z'
  41.    """
  42.     sock.sendall(('650#{gli&&er}{"glit_id":5214,"user_id":' + MY_ID + ',"user_screen_name":"Yonka","id":-1,"content":"' + content
  43.                   + '","date":"' + date + '"}##').encode())
  44.     print(sock.recv(BUFFER))
  45.  
  46.  
  47. def get_description(sock, profile_id):
  48.     """
  49.    Returns the description (Life Motto) of the given profile (id)
  50.    @param sock: current opened socket
  51.    @param profile_id: id of the profile which we want to get his description
  52.    @return: (str) the description (Life Motto) of the profile (that we set in the settings)
  53.    """
  54.     description_pattern = r'description":"(.+?)"'
  55.     sock.sendall(('310#{gli&&er}' + profile_id + '##').encode())
  56.  
  57.     reply = sock.recv(BUFFER).decode()
  58.     print(reply)
  59.  
  60.     matches = re.search(description_pattern, reply)
  61.  
  62.     return matches.group(1)
  63.  
  64.  
  65. def login(sock, user_name, password):
  66.     """
  67.    login to system
  68.    @param sock: current opened socket
  69.    @param user_name: user name to log with
  70.    @param password: password to log with
  71.    """
  72.     sock.sendall(('100#{gli&&er}{"user_name":"' + user_name + '","password":"' + password + '",'
  73.                   '"enable_push_notifications":true}##').encode())  # Login
  74.     print(sock.recv(BUFFER).decode())
  75.     sock.sendall('110#{gli&&er}1005##'.encode())  # CHECKSUM send
  76.     print(sock.recv(BUFFER).decode())
  77.  
  78.  
  79. def add_likes(sock, id_add_to, likes_number):
  80.     """
  81.    Add any number of likes to the given glit
  82.    @param sock: current opened glit
  83.    @param id_add_to: id of the glit to add likes
  84.    @param likes_number: number of likes to add to the given glit
  85.    """
  86.     for i in range(likes_number):
  87.         sock.sendall(
  88.             ('710#{gli&&er}{"glit_id":' + id_add_to + ',"user_id":' + MY_ID + ',"user_screen_name":"Yonka","id":-1}##').encode())
  89.         print(sock.recv(BUFFER).decode())
  90.  
  91.  
  92. def get_email(sock, username):
  93.     """
  94.    Returns the email of the given username in the Glit system
  95.    @param sock: current opened socket
  96.    @param username: username to get his email
  97.    @return: (str) email of the given username
  98.    """
  99.     email_pattern = r'{"screen_name":"' + username + '".+?"mail":"(.+?)"'
  100.     sock.sendall(('300#{gli&&er}{"search_type":"SIMPLE","search_entry":"' + username + '"}##').encode())
  101.     reply = sock.recv(BUFFER).decode()
  102.     print(reply)
  103.  
  104.     matches = re.search(email_pattern, reply)
  105.  
  106.     return matches.group(1)
  107.  
  108.  
  109. def accept_glance_request(sock, future_friend_id):
  110.     """
  111.    Accept some glance request that we sent from another user
  112.    @param sock: current opened socket
  113.    @param future_friend_id: friend which we send and want to accept the glance
  114.    """
  115.     sock.sendall(('420#{gli&&er}[' + MY_ID + ',' + future_friend_id + ']##').encode())
  116.     print(sock.recv(BUFFER).decode())
  117.  
  118.  
  119. if __name__ == '__main__':
  120.     main()
  121.  
Add Comment
Please, Sign In to add comment