コード例 #1
0
ファイル: main.py プロジェクト: ikeadoorframe/Discortiser
def FourAccounts():
    eel.sendLog('Ads will continue to be posted as long as window is open.\n')
    while True:
        #use first account
        RandomTitle()
        account_one.subreddit('discordservers').submit(title, url=invite)
        eel.sendLog("Posted to r/discordservers using: " +
                    account_one_username + " with ad: " + title)
        eel.sleep(delay)
        #use second account
        RandomTitle()
        account_two.subreddit('discordservers').submit(title, url=invite)
        eel.sendLog("Posted to r/discordservers using: " +
                    account_two_username + " with ad: " + title)
        eel.sleep(delay)
        #use third account
        RandomTitle()
        account_three.subreddit('discordservers').submit(title, url=invite)
        eel.sendLog("Posted to r/discordservers using: " +
                    account_three_username + " with ad: " + title)
        eel.sleep(delay)
        #use fourth account
        RandomTitle()
        account_four.subreddit('discordservers').submit(title, url=invite)
        eel.sendLog("Posted to r/discordservers using: " +
                    account_four_username + " with ad: " + title)
        eel.sleep(delay)
コード例 #2
0
ファイル: main.py プロジェクト: ikeadoorframe/Discortiser
def OneAccount():
    eel.sendLog('Ads will continue to be posted as long as window is open.\n')
    while True:
        RandomTitle()
        account_one.subreddit('discordservers').submit(title, url=invite)
        eel.sendLog("Posted to r/discordservers using: " +
                    account_one_username + " with ad: " + title)
        eel.sleep(delay)
コード例 #3
0
def download_media(media):
    global PROFILE
    id = str(media["id"])
    source = media["source"]["source"]

    if media["type"] != "photo" and media["type"] != "video":
        return

    ext = re.findall('\.\w+\?', source)
    if len(ext) == 0:
        return
    ext = ext[0][:-1]

    path = "/" + media["type"] + "s/" + id + ext
    file = id + ext
    eel.sendLog(file + "\n")
    r = requests.get(source, stream=True)
    with open("downloads/" + PROFILE + path, 'wb') as f:
        r.raw.decode_content = True
        shutil.copyfileobj(r.raw, f)
コード例 #4
0
def main():
    global URL
    global API_URL
    global API_HEADER
    global APP_TOKEN
    global PROFILE
    global POST_LIMIT

    URL = "https://onlyfans.com"
    API_URL = "/api2/v2"
    APP_TOKEN = "33d57ade8c02dbc5a333db99ff9ae26a"
    USER_INFO = {}
    PROFILE_INFO = {}
    PROFILE_ID = ""

    eel.sendLog("Getting auth info...\n")

    USER_INFO = get_user_info("customer")
    API_HEADER["user-id"] = str(USER_INFO["id"])
    eel.sendLog("Getting profile info...\n")
    PROFILE_INFO = get_user_info(PROFILE)
    PROFILE_ID = str(PROFILE_INFO["id"])

    if not os.path.isdir("downloads"):
        os.mkdir("downloads")
        eel.sendLog("Created downloads\n")

    if not os.path.isdir("downloads/" + PROFILE):
        os.mkdir("downloads/" + PROFILE)
        eel.sendLog("Created downloads/" + PROFILE + "\n")

    if not os.path.isdir("downloads/" + PROFILE + "/photos"):
        os.mkdir("downloads/" + PROFILE + "/photos")
        eel.sendLog("Created downloads/" + PROFILE + "/photos" + "\n")

    if not os.path.isdir("downloads/" + PROFILE + "/videos"):
        os.mkdir("downloads/" + PROFILE + "/videos")
        eel.sendLog("Created downloads/" + PROFILE + "/videos" + "\n")

    eel.sendLog("Downloading content to downloads/" + PROFILE + "\n\n")
    # get all user posts
    eel.sendLog("Finding posts...\n")
    posts = api_request("/users/" + PROFILE_ID + "/posts",
                        getdata={
                            "limit": POST_LIMIT
                        }).json()

    if len(posts) == 0:
        eel.sendLog("ERROR: 0 posts found.\n")
        exit()

    eel.sendLog("Downloading " + str(len(posts)) + " posts...\n")

    for post in posts:
        if not post["canViewMedia"]:
            continue

        for media in post["media"]:
            executor.submit(download_media, media)
コード例 #5
0
def get_user_info(profile):
    info = api_request("/users/" + profile).json()
    if "error" in info:
        eel.sendLog("ERROR: " + info["error"]["message"] + "\n")
        exit()
    return info
コード例 #6
0
ファイル: main.py プロジェクト: ikeadoorframe/Discortiser
def CheckAccounts():
    global a
    with open("data/AccountConfig.txt") as json_file:
        data = json.load(json_file)
    if data["first_account"]["CLIENT_ID"] == "":
        a = 0

    if not data["first_account"]["CLIENT_ID"] == "":
        if not data["first_account"]["CLIENT_SECRET"] == "":
            if not data["first_account"]["USERNAME"] == "":
                if not data["first_account"]["PASSWORD"] == "":
                    global account_one
                    global account_one_username
                    account_one = praw.Reddit(
                        client_id=data["first_account"]["CLIENT_ID"],
                        client_secret=data["first_account"]["CLIENT_SECRET"],
                        username=data["first_account"]["USERNAME"],
                        password=data["first_account"]["PASSWORD"],
                        user_agent='iloveikea')

                    account_one_username = data["first_account"]["USERNAME"]
                    eel.sendLog("First account loaded.\n")
                    a = 1

    if not data["second_account"]["CLIENT_ID"] == "":
        if not data["second_account"]["CLIENT_SECRET"] == "":
            if not data["second_account"]["USERNAME"] == "":
                if not data["second_account"]["PASSWORD"] == "":
                    global account_two
                    global account_two_username
                    account_two = praw.Reddit(
                        client_id=data["second_account"]["CLIENT_ID"],
                        client_secret=data["second_account"]["CLIENT_SECRET"],
                        username=data["second_account"]["USERNAME"],
                        password=data["second_account"]["PASSWORD"],
                        user_agent='iloveikea')

                    account_two_username = data["second_account"]["USERNAME"]
                    eel.sendLog("Second account loaded.\n")
                    a = 2

    if not data["third_account"]["CLIENT_ID"] == "":
        if not data["third_account"]["CLIENT_SECRET"] == "":
            if not data["third_account"]["USERNAME"] == "":
                if not data["third_account"]["PASSWORD"] == "":
                    global account_three
                    global account_three_username
                    account_three = praw.Reddit(
                        client_id=data["third_account"]["CLIENT_ID"],
                        client_secret=data["third_account"]["CLIENT_SECRET"],
                        username=data["third_account"]["USERNAME"],
                        password=data["third_account"]["PASSWORD"],
                        user_agent='iloveikea')

                    account_three_username = data["third_account"]["USERNAME"]
                    eel.sendLog("Third account loaded.\n")
                    a = 3

    if not data["fourth_account"]["CLIENT_ID"] == "":
        if not data["fourth_account"]["CLIENT_SECRET"] == "":
            if not data["fourth_account"]["USERNAME"] == "":
                if not data["fourth_account"]["PASSWORD"] == "":
                    global account_four
                    global account_four_username
                    account_four = praw.Reddit(
                        client_id=data["fourth_account"]["CLIENT_ID"],
                        client_secret=data["fourth_account"]["CLIENT_SECRET"],
                        username=data["fourth_account"]["USERNAME"],
                        password=data["fourth_account"]["PASSWORD"],
                        user_agent='iloveikea')

                    account_four_username = data["fourth_account"]["USERNAME"]
                    eel.sendLog("Fourth account loaded.\n")
                    a = 4

    if not data["fifth_account"]["CLIENT_ID"] == "":
        if not data["fifth_account"]["CLIENT_SECRET"] == "":
            if not data["fifth_account"]["USERNAME"] == "":
                if not data["fifth_account"]["PASSWORD"] == "":
                    global account_five
                    global account_five_username
                    account_five = praw.Reddit(
                        client_id=data["fifth_account"]["CLIENT_ID"],
                        client_secret=data["fifth_account"]["CLIENT_SECRET"],
                        username=data["fifth_account"]["USERNAME"],
                        password=data["fifth_account"]["PASSWORD"],
                        user_agent='iloveikea')

                    account_five_username = data["fifth_account"]["USERNAME"]
                    eel.sendLog("Fifth account loaded.\n")
                    a = 5
    return a  #i dont think this is needed but im leaving it bc the script works
コード例 #7
0
ファイル: main.py プロジェクト: ikeadoorframe/Discortiser
def CheckInputs(server_invite, post_delay, delay_type):
    global invite
    global delay
    invite = server_invite

    #Check invite link
    if server_invite == "":
        eel.sendLog("Invalid server invite.\n")
        return
    #Check delay
    if (post_delay == "" or post_delay == "0"):
        eel.sendLog("Invalid post delay.\n")
        return

    try:
        pd = int(post_delay)  #convert to integer

    except ValueError:
        eel.sendLog("Invalid post delay.\n")
        return

    if delay_type == "Minutes":
        if pd < 15:
            eel.sendLog("Minumum delay is 15 minutes.\n")
            return
        delay = pd * 60  #Convert to minutes

    if delay_type == "Hours":
        delay = pd * 60 * 60  #Convert to hours

    if (delay_type == "Hours" and post_delay == "1"):
        eel.sendLog("Delay set to: " + post_delay + " hour.\n")

    else:
        eel.sendLog("Delay set to: " + post_delay + " " + delay_type.lower() +
                    ".\n")

    #Check how many accounts are in use
    CheckAccounts()
    if a == 0:
        eel.sendLog(
            "\n[ERROR] No accounts detected\nConfigure accounts and retry.\n")

    elif a == 1:
        eel.sendLog("\nProceeding with one account.\n")
        OneAccount()

    elif a == 2:
        eel.sendLog("\nProceeding with two accounts.\n")
        TwoAccounts()

    elif a == 3:
        eel.sendLog("\nProceeding with three accounts.\n")
        ThreeAccounts()

    elif a == 4:
        eel.sendLog("\nProceeding with four accounts.\n")
        FourAccounts()

    elif a == 5:
        eel.sendLog("\nProceeding with five accounts.\n")
        FiveAccounts()
コード例 #8
0
ファイル: main.py プロジェクト: ikeadoorframe/Discortiser
        RandomTitle()
        account_four.subreddit('discordservers').submit(title, url=invite)
        eel.sendLog("Posted to r/discordservers using: " +
                    account_four_username + " with ad: " + title)
        eel.sleep(delay)
        #use fifth account
        RandomTitle()
        account_five.subreddit('discordservers').submit(title, url=invite)
        eel.sendLog("Posted to r/discordservers using: " +
                    account_five_username + " with ad: " + title)
        eel.sleep(delay)


#Make directories if they dont already exist
if not os.path.isfile("praw.ini"):
    subprocess.call('buildprawini.py', shell=True, cwd='subprocesses/')
    eel.sendLog("Created praw.ini.\n")

if not os.path.isdir("data"):
    os.mkdir("data")

if not os.path.isfile("data/AccountConfig.txt"):
    subprocess.call('buildAccountConfig.py', shell=True, cwd='subprocesses/')
    eel.sendLog("Created data/AccountConfig.txt.\n")

if not os.path.isfile("data/AdList.txt"):
    subprocess.call('buildAdList.py', shell=True, cwd='subprocesses/')
    eel.sendLog("Created data/AdList.txt.\n")

eel.start("main.html", size=(705, 305))