"""
    Work with
        whitelist, blacklist,
        seleb account,
"""

import os

def read_list(file_path):
    """
        Reads whitelist/blacklist users from input file.
        Returns the list if file items
    """
    if not os.path.exists(file_path):
        print ("file %s does not exist." % file_path)
        return False
    with open(file_path, "r") as f:
        content = f.readlines()
        content = [item.strip() for item in content if len(item.strip()) > 0]
        return content

def add_whitelist(bot, file_path):
    bot.whitelist = read_list(file_path)
    return not not bot.whitelist

def add_blacklist(bot, file_path):
    bot.blacklist = read_list(file_path)
    return not not bot.blacklist

def get_media_owner(bot, media_id):
    pass
    return False

def check_media(bot, media_id):
    return check_user(bot, get_media_owner(bot, media_id))

def check_user(bot, user_id):
    """
        Decide should you interract with that user_id or not.
        Decision based on
            1) Following/followers ratio
            2) Approved account
            3) Black-whitelist
            4) Closed accs
    """
    if not user_id:
        return True
    return True

"""
    Work with
        whitelist, blacklist,
        seleb account,
"""

import os

def read_list(file_path):
    """
        Reads whitelist/blacklist users from input file.
        Returns the list if file items
    """
    if not os.path.exists(file_path):
        print ("file %s does not exist." % file_path)
        return False
    with open(file_path, "r") as f:
        content = f.readlines()
        content = [item.strip() for item in content if len(item.strip()) > 0]
        return content

def add_whitelist(bot, file_path):
    bot.whitelist = read_list(file_path)
    return not not bot.whitelist

def add_blacklist(bot, file_path):
    bot.blacklist = read_list(file_path)
    return not not bot.blacklist

def get_media_owner(bot, media_id):
    bot.mediaInfo(media_id)
    try:
        return bot.LastJson["items"][0]["user"]["pk"]
    except:    
        return False

def check_media(bot, media_id):
    return check_user(bot, get_media_owner(bot, media_id))

def check_user(bot, user_id):
    """
        Decide should you interract with that user_id or not.
        Decision based on
            1) Following/followers ratio
            2) Approved account
            3) Black-whitelist
            4) Closed accs
    """
    if not user_id:
        return True
    return True

write get_media_owner method